MCP for Unity
Lets an assistant control the Unity Editor: build scenes, edit C# scripts, manage assets, run tests.
Drive the Unity Editor from an agent through RQL queries, C# scripts, tests and screenshots
By Ivan Murzak (individual) C# Remote (hosted) · Streamable HTTPLocal · stdio Developer toolsMedia
82 popularity score ★ 4.6k ↓ 2.9k/wk
Opens the app, which asks before it adds the server.
claude mcp add --transport http unity https://ai-game.dev/mcphttps://ai-game.dev/mcp{
"mcpServers": {
"unity": {
"url": "https://ai-game.dev/mcp"
}
}
}[mcp_servers.unity]
url = "https://ai-game.dev/mcp"{
"servers": {
"unity": {
"type": "http",
"url": "https://ai-game.dev/mcp"
}
}
}Opens the app, which asks before it adds the server.
claude mcp add unity -- docker run -i --rm -e MCP_PLUGIN_CLIENT_TRANSPORT=stdio -p 8080:8080 ivanmurzakdev/unity-mcp-server:latest{
"mcpServers": {
"unity": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_PLUGIN_CLIENT_TRANSPORT=stdio",
"-p",
"8080:8080",
"ivanmurzakdev/unity-mcp-server:latest"
]
}
}
}{
"mcpServers": {
"unity": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_PLUGIN_CLIENT_TRANSPORT=stdio",
"-p",
"8080:8080",
"ivanmurzakdev/unity-mcp-server:latest"
]
}
}
}{
"servers": {
"unity": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_PLUGIN_CLIENT_TRANSPORT=stdio",
"-p",
"8080:8080",
"ivanmurzakdev/unity-mcp-server:latest"
]
}
}
}[mcp_servers.unity]
command = "docker"
args = ["run", "-i", "--rm", "-e", "MCP_PLUGIN_CLIENT_TRANSPORT=stdio", "-p", "8080:8080", "ivanmurzakdev/unity-mcp-server:latest"]gemini mcp add --scope user unity docker -- run -i --rm -e MCP_PLUGIN_CLIENT_TRANSPORT=stdio -p 8080:8080 ivanmurzakdev/unity-mcp-server:latestOpens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
claude mcp add unity -- '<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server' --port=8080 --client-transport=stdio{
"mcpServers": {
"unity": {
"command": "<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server",
"args": [
"--port=8080",
"--client-transport=stdio"
]
}
}
}{
"mcpServers": {
"unity": {
"command": "<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server",
"args": [
"--port=8080",
"--client-transport=stdio"
]
}
}
}{
"servers": {
"unity": {
"type": "stdio",
"command": "<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server",
"args": [
"--port=8080",
"--client-transport=stdio"
]
}
}
}[mcp_servers.unity]
command = "<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server"
args = ["--port=8080", "--client-transport=stdio"]gemini mcp add --scope user unity '<UNITY_PROJECT_PATH>/Library/mcp-server/<PLATFORM>/gamedev-mcp-server' -- --port=8080 --client-transport=stdioMCP_PLUGIN_CLIENT_TRANSPORT |
Optional: How clients connect: stdio or streamableHttp. |
|---|---|
MCP_PLUGIN_PORT |
Optional: Port for the plugin and HTTP clients; must match the port set in the plugin. |
MCP_PLUGIN_CLIENT_TIMEOUT |
Optional: Milliseconds to wait for the plugin to answer. |
MCP_PLUGIN_TOOL_TIMEOUT |
Optional: Milliseconds a single tool call may run. A tool call is never sent twice. |
MCP_BIND |
Optional: Where the HTTP listener binds: loopback when unset, any or 0.0.0.0 to expose it. |
MCP_PLUGIN_IDLE_TIMEOUT_SECONDS |
Optional: Seconds with no connections before the server exits. |
| Set together: auth | |
MCP_AUTH |
Optional: Client auth mode: none, token or oauth. It wins over the older MCP_AUTHORIZATION, where required means token. |
MCP_PLUGIN_TOKEN secret |
Optional: Shared bearer token checked on client and plugin connections in token mode. |
In a container, a setting goes in with -e NAME=value after docker run.
Unity MCP, which its maker also brands AI Game Developer, comes in two parts. A plugin installed in a Unity project exposes the Editor as MCP tools. A separate server program relays between the MCP client and that plugin on a local port, 8080 unless changed, and talks to the client over stdio or streamable HTTP. The plugin drops a prebuilt copy of that server under the project's Library folder. A Docker image is published as well.
Version 1.5.0 reworked the tool set. Most of the old per-area tools for scenes, GameObjects and the Profiler are gone. In their place sits a small query language called RQL. rql-query reads from sources like objects, prefabs, the console, test results or the profiler, and rql-mutate changes them in one checked batch that the Editor can undo and that is saved to disk. rql-schema tells the agent what each type holds.
Around that core sit tools to compile and run C# inside the Editor and to run EditMode or PlayMode tests. Another renders a single GameObject to an image so the agent can see its work. Script file editing and package management exist too, but they ship switched off, along with most screenshot tools. A user turns them on in the plugin's window, or an agent does it with tool-set-enabled-state once that tool is enabled. Project code can add its own tools with attributes.
A Node.js CLI, unity-mcp-cli, installs the plugin, opens projects and writes client configs for 14 agents. By default it signs in to the author's ai-game.dev service and points agents at a hosted endpoint there rather than at a local server.
| To run it yourself | A prebuilt binaryNode.js 20+Docker |
|---|---|
| Runs on | macOS, Windows, Linux |
| ai-game.dev | Only for the CLI's default hosted route. The local binary and Docker server need no account |
| Also |
|
The plugin goes into the Unity project from the .unitypackage installer or OpenUPM, or with unity-mcp-cli install-plugin <UNITY_PROJECT_PATH>. Once the project is opened in the Editor, the prebuilt server sits under <project>/Library/mcp-server/<platform>/. Node.js is only needed for the CLI, which asks for ^20.19.0 or 22.12.0 and later. Docker is only needed for the container route.
Tools act only through a running Unity Editor with the plugin connected; the server alone does nothing. Project paths with spaces are not supported. In a built game no tools exist until the developer writes them. The plugin port and the server port must match. The server shuts itself down after 600 seconds with no connections by default.
Fits Unity developers who want an agent working inside the Editor on scenes, scripts and tests, and who are happy for it to go through one query language rather than dozens of narrow tools. It is a community project, not Unity's own. script-execute runs any C# the agent writes, so keep the project under version control. Those who want no third-party account should run the local binary or the Docker image instead of the CLI's default ai-game.dev endpoint. coplaydev/unity-mcp, which we also list, is a separate Unity bridge by another maker with its own tool set.
12 only read, 7 change things, 3 can delete or overwrite. A ? marks an optional parameter.
rql-queryquery: stringrql-mutate changesquery: stringdry_run?: booleanrql-schematype?: stringscript-execute changescsharpCode: stringclassName?: stringmethodName?: stringparameters?: objectisMethodBody?: booleanusings?: arrayinclude?: arrayscript-readfilePath: stringlineFrom?: integerlineTo?: integerscript-update-or-create deletesfilePath: stringcontent: stringscript-delete deletesfiles: arraytests-runtestMode?: enumtestAssembly?: stringtestNamespace?: stringtestClass?: stringtestMethod?: stringquery?: stringresult?: stringincludePassingTests?: booleanincludeMessages?: booleanincludeStacktrace?: booleanincludeLogs?: booleanlogType?: enumincludeLogsStacktrace?: booleanscreenshot-isolatedgameObjectRef: objectincludeChildren?: booleanisolated?: booleanbackgroundMode?: enumbackgroundColor?: stringcameraView?: enumfieldOfView?: numbernearClipPlane?: numberfarClipPlane?: numberpadding?: numberlights?: stringresolution?: integerscreenshot-cameracameraRef?: objectwidth?: integerheight?: integerscreenshot-game-viewscreenshot-scene-viewwidth?: integerheight?: integerpackage-listsourceFilter?: enumnameFilter?: stringdirectDependenciesOnly?: booleanpackage-searchquery: stringmaxResults?: integerofflineMode?: booleanpackage-add changespackageId: stringpackage-remove deletespackageId: stringunity-tool-listregexSearch?: stringincludeDescription?: booleanincludeInputs?: enumtool-set-enabled-state changestools: arrayincludeLogs?: booleanpingmessage?: stringeditor-session-quit changesnonce: stringunity-skill-create changesunity-skill-generate changespath?: string