@jamius19/unity-ai-context-bridge-mcp
v1.0.2
Published
MCP server that feeds AI tools the currently selected Unity GameObjects and assets of interest. Requires the "Unity AI Context Bridge" Unity package to be installed in the Unity project.
Readme
Unity AI Context Bridge MCP
Node MCP server that feeds AI tools Unity GameObjects, assets, and other resources that are selected by the user. Think of it like when you drag source code in Cursor, Antigravity, Github Copilot window to add that file to context, but for Unity.
[!IMPORTANT]
The MCP server requires theUnity AI Context BridgeUnity package to be installed in the Unity project. See more details at https://github.com/jamius19/unity-ai-context-bridge
[!TIP]
For the best experience, use Unity Official MCP server along with this.
NPM Package Page at https://npmjs.com/package/@jamius19/unity-ai-context-bridge-mcp
Installation
Install the package globally:
npm install -g @jamius19/unity-ai-context-bridge-mcpThen the MCP server will be available on your terminal with the uacb-mcp command.
MCP Client Installation
Install the NPM package globally before wiring an MCP client to it. This will enable the uacb-mcp command in your terminal,
Choose one transport per client entry:
- Stdio: the MCP client launches this server as a subprocess. (Recommended)
- Streamable HTTP: you start this server with
uacb-mcp --http, then the MCP client connects tohttp://127.0.0.1:3333/mcp.
GitHub Copilot (VS Code)
Create or update .vscode/mcp.json in a project, or run MCP: Open User Configuration from the Command Palette for a user-wide setup.
Stdio:
{
"servers": {
"unity-ai-context-bridge": {
"type": "stdio",
"command": "uacb-mcp",
"args": ["--stdio"]
}
}
}HTTP with auth:
{
"servers": {
"unity-ai-context-bridge": {
"type": "http",
"url": "http://127.0.0.1:3333/mcp",
"headers": {
"Authorization": "Bearer change-me"
}
}
}
}HTTP without auth:
{
"servers": {
"unity-ai-context-bridge": {
"type": "http",
"url": "http://127.0.0.1:3333/mcp"
}
}
}After adding the server, run MCP: List Servers from the Command Palette and start unity-ai-context-bridge if VS Code does not start it automatically. Then open GitHub Copilot Chat in Agent mode and enable the server tools from the tools menu if needed.
Rider/Other mcp.json clients
Many MCP clients, including Claude Desktop-style JSON configs, accept the same mcpServers shape.
Stdio:
{
"mcpServers": {
"unity-ai-context-bridge": {
"command": "uacb-mcp",
"args": ["--stdio"]
}
}
}HTTP:
{
"mcpServers": {
"unity-ai-context-bridge": {
"url": "http://127.0.0.1:3333/mcp",
"headers": {
"Authorization": "Bearer change-me"
}
}
}
}Claude Code
Stdio:
claude mcp add --transport stdio unity-ai-context-bridge -- uacb-mcp --stdioHTTP with auth:
claude mcp add --transport http --header "Authorization: Bearer change-me" unity-ai-context-bridge http://127.0.0.1:3333/mcpHTTP without auth:
claude mcp add --transport http unity-ai-context-bridge http://127.0.0.1:3333/mcpCodex
Add one of these entries to ~/.codex/config.toml.
Stdio:
[mcp_servers.unity_ai_context_bridge]
command = "uacb-mcp"
args = ["--stdio"]
enabled = trueHTTP with auth:
[mcp_servers.unity_ai_context_bridge]
url = "http://127.0.0.1:3333/mcp"
http_headers = { Authorization = "Bearer change-me" }
enabled = trueHTTP without auth:
[mcp_servers.unity_ai_context_bridge]
url = "http://127.0.0.1:3333/mcp"
enabled = trueGemini CLI
Stdio:
gemini mcp add unity-ai-context-bridge uacb-mcp --stdioHTTP with auth:
gemini mcp add --transport http unity-ai-context-bridge http://127.0.0.1:3333/mcp --header "Authorization: Bearer change-me"HTTP without auth:
gemini mcp add --transport http unity-ai-context-bridge http://127.0.0.1:3333/mcpCursor
Create or update .cursor/mcp.json in a project, or ~/.cursor/mcp.json for a user-wide setup.
Stdio:
{
"mcpServers": {
"unity-ai-context-bridge": {
"type": "stdio",
"command": "uacb-mcp",
"args": ["--stdio"]
}
}
}HTTP with auth:
{
"mcpServers": {
"unity-ai-context-bridge": {
"url": "http://127.0.0.1:3333/mcp",
"headers": {
"Authorization": "Bearer change-me"
}
}
}
}HTTP without auth:
{
"mcpServers": {
"unity-ai-context-bridge": {
"url": "http://127.0.0.1:3333/mcp"
}
}
}Run over stdio
uacb-mcp --stdioUse this transport from MCP clients that launch servers as subprocesses.
Run over HTTP
In HTTP mode it defaults to http://127.0.0.1:3333/mcp URL.
You can customize it via the following ways,
PowerShell:
$env:MCP_AUTH_TOKEN = "change-me"
$env:PORT = "3333"
uacb-mcp --httpBash:
MCP_AUTH_TOKEN=change-me PORT=3333 uacb-mcp --httpIf you do not want HTTP auth during local development, omit MCP_AUTH_TOKEN:
uacb-mcp --httpHTTP endpoints:
GET /healthdoes not require auth.GET /contextreturns the raw currently selected Unity objects/assets context JSON. It requires aprojectPathquery parameter to select a specific Unity project bridge.POST /mcpis the SDK Streamable HTTP MCP endpoint for AI tools.
Authenticated HTTP requests must include either:
Authorization: Bearer change-meor:
x-auth-token: change-meMCP surface
Resource template:
unity-context://projects/items{?projectPath}: currently selected Unity GameObjects/assets of interest for a specific project path. Listed concrete resources percent-encode the project path in the query string, so paths with spaces are represented safely, for exampleunity-context://projects/items?projectPath=C%3A%5Cexample%5Cunity%5Cunity%5Cprojectfor an Unity project in theC:\example\unity\unity\projectpath.
Tool:
get_unity_context_items: returns the current Unity selection context for AI tools. It requires a URL-encodedprojectPath; the server reads that project's bridge file and uses its URL.
Example JSON-RPC request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_unity_context_items",
"arguments": {
"projectPath": "C%3A%5Cexample%5Cunity%5Cunity%5Cproject"
}
}
}If you have Unity Official MCP installed, this will be done automatically, otheriwse you can update your AGENTS.md file with the full project path.
How does it work?
It automatically discovers the live Unity selection context from the bridge file under the requested Unity project path:
<projectPath>/Temp/unity-ai-context-bridge/bridge.jsonThe bridge file contains the local URL and auth key for that Unity editor instance. The MCP server reads that file for the requested projectPath, connects to its url, and sends the auth key to Unity AI Context Bridge.
This bridge file is auto generated by the Unity AI Context Bridge Unity Editor Extension.
