UnityCodeMCPServer
Unity Code MCP Server is a powerful tool for the Unity Editor that gives AI Agents ability to perform any action using Unity Editor API. This includes scripts, scenes, prefabs, assets, configuration changes, and more.
claude mcp add --transport stdio signal-loop-unitycodemcpserver uv run --directory <UNITY_PROJECT_PATH>/Assets/Plugins/UnityCodeMcpServer/Editor/STDIO~ unity-code-mcp-stdio \ --env UV_LOG_LEVEL="info" \ --env UNITY_LICENSE="path/to/Unity.lic"
How to use
Unity Code MCP Server exposes powerful tools to assistants operating inside a Unity Editor context. It provides direct access to the Unity API and the Editor workflow, enabling generated prompts to perform tasks such as creating assets, scenes, and game objects, configuring components, and running editor-side scripts. The built-in tools include execute_csharp_script_in_unity_editor for running dynamically generated C# code within the Editor, read_unity_console_logs to fetch and filter Editor logs, and run_unity_tests to execute Unity Test Runner tests. When connected via STDIO/bridge or HTTP, you can instruct the MCP client to issue actions that manipulate the Unity project in a controlled, traceable way, with logs and return values captured for debugging and validation.
How to install
Prerequisites:
- Unity 2022.3 LTS or newer installed on your development machine.
- uv (Python package manager) if you intend to use the STDIO bridge transport.
- A Unity project into which you will integrate the Unity Code MCP Server package.
- Basic familiarity with Git to pull the Unity Code MCP Server package.
Installation steps:
- Install uv (STDIO transport) if you plan to use STDIO:
# On macOS/Linux
curl -L https://get.uv.sh | sh
# On Windows, follow uv installation instructions from https://docs.astral.sh/uv/
- In your Unity project, install the Unity Code MCP Server package:
- Open Unity Package Manager: Window > Package Manager
- Click the + button and choose Add package from git URL...
- Enter the Git URL:
https://github.com/Signal-Loop/UnityCodeMCPServer.git?path=Assets/Plugins/UnityCodeMcpServer
- If you plan to use STDIO, ensure the STDIO bridge is available and configured. The README example shows the expected STDIO bridge configuration; adapt the directory path to your project:
{
"servers": {
"unity-code-mcp-stdio": {
"command": "uv",
"args": [
"run",
"--directory",
"<UNITY_PROJECT_PATH>/Assets/Plugins/UnityCodeMcpServer/Editor/STDIO~",
"unity-code-mcp-stdio"
]
}
}
}
-
Start the STDIO server via your MCP client configuration or the Unity editor menu as described in the repository's Quick Start section.
-
Open Unity and verify the MCP server is available by using the provided Tools menu commands (e.g., Show Settings, Restart Server, Print MCP configuration).
Additional notes
Tips and notes:
- The Unity MCP server executes scripts and editor actions with the same privileges as the Unity Editor process. Review and validate any generated C# code before execution.
- If using STDIO, ensure the Unity project path in the configuration matches your local workspace; port changes may require a restart of the STDIO bridge.
- When using the HTTP transport, you can rely on a separate MCP client that communicates over HTTP/SSE; this avoids STDIO but requires networking readiness.
- For debugging, enable verbose logging in the Unity plugin settings to capture detailed information about actions, errors, and returned values from the editor.
- Common issues include mismatched Unity versions, missing packages (e.g., UniTask), or permission-related problems when creating assets or writing to the project directory. Validate environment readiness before issuing complex automation prompts.
Related MCP Servers
robloxstudio
Create agentic AI workflows in ROBLOX Studio
UnityMCPIntegration
Enable AI Agents to Control Unity
mcp
🤖 Taskade MCP · Official MCP server and OpenAPI to MCP codegen. Build AI agent tools from any OpenAPI API and connect to Claude, Cursor, and more.
advanced-unity
Public repository for Advanced Unity MCP by Code Maestro (www.code-maestro.com).
Unity-AI-Animation
AI-powered tools for Unity animation workflow. Create and modify AnimationClips and AnimatorControllers directly through natural language commands.
unity-api
Instant, accurate Unity API lookups instead of expensive source file reads, saving your agent tokens, context, and hallucinations