Unity MCP
Runs an MCP server inside the Unity Editor, enabling agents to inspect editor and project state, compile code and read errors, manage scenes and GameObjects, components, materials, prefabs, and assets, take screenshots, control play mode, run menu items, and run EditMode tests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unity MCPcompile the project, fix any errors, then run the tests"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Add the package, and your editor serves MCP at http://127.0.0.1:8765/mcp. Point Claude Code, Cursor, VS Code, Codex or any other MCP client at it. The agent can then compile your code and read the errors, build and change scenes, look at screenshots of what it made, and run your tests.
There is no Python server, no Node process, no uv, no bridge to keep alive. The server is a few C# files in an editor assembly, and it starts when Unity starts.
Install
Package Manager → + → Add package from git URL, then paste:
https://github.com/siiplasplas/unity-mcp.gitOr add it to Packages/manifest.json, pinned to a release:
"com.mirven.unity-mcp": "https://github.com/siiplasplas/unity-mcp.git#v0.1.0"When Unity finishes importing, the server is running. Window → Unity MCP shows its status, the URL and the calls it has handled.
Related MCP server: Unity MCP Server
Connect your agent
Claude Code
claude mcp add --transport http unity http://127.0.0.1:8765/mcpCursor, in .cursor/mcp.json
{ "mcpServers": { "unity": { "url": "http://127.0.0.1:8765/mcp" } } }VS Code, in .vscode/mcp.json
{ "servers": { "unity": { "type": "http", "url": "http://127.0.0.1:8765/mcp" } } }Codex, in ~/.codex/config.toml
[mcp_servers.unity]
url = "http://127.0.0.1:8765/mcp"Claude Desktop, which only speaks stdio, through mcp-remote
{ "mcpServers": { "unity": { "command": "npx", "args": ["mcp-remote", "http://127.0.0.1:8765/mcp"] } } }The Unity MCP window has all of these with a copy button, already filled in with your port.
What the agent sees
The island at the top was built in an empty scene by 55 tool calls: materials, primitives, a point light, a parented cottage and a boat. tools~/demo.py replays them, so you can build it yourself.
Screenshots come back as images, not file paths. A model that can see can check its own work: whether the roof sits on the walls, whether the camera frames the object, whether the light is on.
The loop: edit, compile, test, fix
compile waits for Unity to finish and returns the errors with file, line and column. run_tests waits for the Test Runner and returns each failure's message and the line it came from. Here is the output of one session, unedited:
Tools
21 tools. Every tool that changes the project is a single Undo step, so you can take back anything the agent did with Ctrl+Z, or ask it to call undo.
Area | Tool | What it does |
Editor |
| Unity version, project, render pipeline, play and compile state, open scenes, selection, console counts |
| Import changed files, compile, wait, and return errors and warnings with | |
| Recent Console entries, errors and warnings by default | |
| Enter, exit, pause, resume or step play mode | |
| Run any menu item by path | |
| Undo or redo the last changes | |
| Select objects or assets and frame them, so you see what the agent means | |
Scene |
| Compact tree of the open scenes, or of one object |
| List, open, save, create or save-as. Refuses to drop unsaved changes unless asked | |
| Transform and every component's serialized properties, with paths for | |
| Primitive, empty or prefab instance, with transform, components and material in one call | |
| Name, parent, transform, active, tag, layer, static flag, on one or many objects | |
| Delete objects and their children | |
| Add a built-in component or your own script, and set its fields | |
| Remove a component | |
| Set serialized properties on components, materials or ScriptableObjects. References take asset or scene paths | |
| Save a scene object as a prefab and connect it | |
Assets |
| Search like the Project window: |
| Create or update a material with the project's render pipeline shader | |
Seeing |
| Render the scene, one object, a scene camera or the Scene view, and return the image |
Testing |
| Run EditMode tests and return counts and failures. Appears when the Test Framework package is installed |
Writing scripts is left to the agent's own file tools, which every client already has and which are better at it. compile closes the loop.
How it compares
Most Unity MCP servers are a bridge: a Python or Node server that the client talks to, plus a Unity plugin that it relays to over a socket. Those projects cover more ground than this one, with tools for ProBuilder, VFX, shaders, asset generation and more. If you need that breadth, use them.
Unity MCP takes the other trade.
Unity MCP | Bridge-based servers | |
Install | One Unity package | Unity package, plus a Python or Node runtime and its server |
Processes | Just Unity | Unity, the server, and the connection between them |
Transport | Streamable HTTP, straight into the editor | stdio or HTTP to the server, then a socket to Unity |
Updating | Package Manager | The package and the server, kept in step |
What you also get here:
Every write is one Undo step.
Screenshots go back to the model as images.
compileandrun_testswait for the result and return it in the same call.One toggle makes the whole server read-only.
It runs in
-batchmode, with no editor window.
Settings
Window → Unity MCP
Server enabled starts and stops the server.
Read-only hides every tool that changes the project. The agent can still read the scene, the console and screenshots. Use it for reviews, or on a project you don't want touched.
Port defaults to
8765. Each Unity instance needs its own. TheUNITY_MCP_PORTenvironment variable overrides it, which is handy for CI or for running several editors.
Running headless
The server works in batch mode, so an agent can drive a project on a build machine or in CI without a window:
Unity -batchmode -projectPath path/to/project -logFile editor.logLeave out -quit and Unity keeps serving until you stop it. After a compile in batch mode the server loads the new scripts right away, instead of waiting for the next import.
Security
The server binds to
127.0.0.1andlocalhostonly. Nothing on your network can reach it.Requests with a browser
Originthat is not local get403, so a web page you visit cannot call your editor.There is no authentication beyond that. Any program running as you on your machine can call it, the same as it could edit your project files. Turn on Read-only or disable the server when you don't need it.
Checking it works
tools~/smoke.py needs only Python's standard library. It checks the protocol (initialize, notifications, batches, errors, the Origin check) and calls every read-only tool:
python smoke.py # all checks, prints PASS / FAIL
python smoke.py list # list the tools
python smoke.py call hierarchy "{\"depth\": 2}"
python smoke.py call screenshot "{}" --out shot.pngThe ~ at the end of tools~ and docs~ tells Unity not to import those folders.
Requirements
Unity 2021.3 or later. Developed and tested on Unity 6 (6000.4). Reports from older versions are welcome.
Any MCP client that supports Streamable HTTP, or stdio through
mcp-remote.run_testsneedscom.unity.test-framework, which new projects include.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Build, validate, and deploy multi-agent AI solutions from any AI environment.
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
Create and manage AI agents that collaborate and solve problems through natural language interacti…
Memory, reflection and safety for AI agents. Hosted or local, no vector database.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to interact with Unity projects through multimodal vision, code analysis, asset management, and scene manipulation. Supports real-time Unity editor control, project search, script creation, and visual debugging through screenshots.32MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to interact with Unity Editor projects through 68+ tools for manipulating scenes, GameObjects, components, and assets, plus live access to console logs, hierarchies, and test results.10 npm9MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to build and manage Unity projects directly through the Unity Editor, providing 150+ tools for scene creation, script generation, play mode control, input simulation, and performance analysis.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to operate directly inside a running Unity Editor project, using built-in tools for scene creation, script generation, play mode automation, input simulation, and performance analysis.33MIT