
Unity MCP (AI Game Developer)
Connect Claude, Cursor & Windsurf to the Unity Engine for AI-driven game development in Editor and Runtime.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npm install -g unity-mcp-cliPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"unity-mcp-ai-game-developer": {
"command": "<project>/Library/mcp-server/win-x64/gamedev-mcp-server.exe",
"args": [
"--port=8080",
"--plugin-timeout=10000",
"--client-transport=stdio"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Unity Editor (project path must not contain spaces)
- An MCP client / AI agent (Claude Code, Claude Desktop, Cursor, Windsurf, GitHub Copilot, Gemini, etc.)
- Node.js / npm if using the unity-mcp-cli for setup
- Docker (optional) for the streamableHttp containerized server
About Unity MCP (AI Game Developer)
Unity MCP serves as a bridge between LLMs and Unity: it exposes Unity's tools to an MCP client (Claude, Cursor, Windsurf, Copilot, Gemini, etc.) which then drives the Editor or a running game via natural language. Install the Unity plugin (installer .unitypackage, OpenUPM, or the unity-mcp-cli), pick an AI agent, then configure it from the in-Editor 'AI Game Developer' window (auto-generate Skills or Configure MCP) or via a manual mcpServers JSON / CLI command. It is highly extensible — custom MCP Tools, Resources, and Prompts can be defined directly in project C# code, and there are official add-on extensions (Animation, Cinemachine, Input System, Navigation, Particle System, ProBuilder, Splines, Terrain, Tilemap, Timeline).
Tools & capabilities (17)
gameobject-createCreate a new GameObject in the opened Prefab or in a Scene.
gameobject-modifyModify GameObjects and/or attached components' fields and properties.
gameobject-component-addAdd a Component to a GameObject.
assets-prefab-createCreate a prefab from a GameObject in the current active scene.
assets-material-createCreate a new material asset with default parameters.
scene-createCreate a new scene in the project assets.
scene-openOpen a scene from the project asset file.
script-update-or-createUpdate or create a script file with the provided C# code.
script-executeCompile and execute C# code dynamically using Roslyn.
reflection-method-callCall any C# method with input parameters and return results.
reflection-method-findFind a method in the project using C# reflection (even private methods).
tests-runExecute Unity tests (EditMode/PlayMode) with filtering and detailed results.
console-get-logsRetrieve Unity Editor logs with filtering options.
editor-application-set-stateControl the Unity Editor application state (start/stop/pause playmode).
screenshot-game-viewCapture a screenshot from the Unity Editor Game View.
profiler-get-rendering-statsReturn frame timing, FPS, vsync, target frame rate, and graphics device type.
package-addInstall a package from the Unity Package Manager registry, Git URL, or local path.
When to use it
- Drive the Unity Editor with natural language — e.g. 'Create 3 cubes in a circle with radius 2' or 'Create a metallic golden material and attach it to a new sphere'.
- Generate, edit, compile, and execute C# game code and run EditMode/PlayMode tests in a full AI develop-and-test loop.
- Let AI inspect the scene hierarchy, read logs, and profile performance to debug and fix project issues.
- Embed LLM-driven logic inside a compiled game at runtime (e.g. AI chess bot, dynamic NPC behavior).
- Automate repetitive editor and asset workflows by exposing project-specific C# methods as custom MCP Tools.
Security notes
The MCP server is unauthenticated by default (MCP_AUTHORIZATION=none). For remote/cloud (streamableHttp) deployments set --authorization=required and provide a bearer token via --token / MCP_PLUGIN_TOKEN. The server can compile and execute arbitrary C# (script-execute via Roslyn) and call any project method via reflection, so it grants the AI broad control over the Unity project and machine — run it only against trusted projects and clients.
Unity MCP (AI Game Developer) FAQ
Which AI agents / MCP clients are supported?
Claude Code (recommended), Claude Desktop, Cursor, Windsurf, GitHub Copilot, Gemini, Antigravity, Cline, Kilo Code, Codex, Rider, Visual Studio, and any other client that supports Skills or dynamic MCP tool updates.
What transports does the server support?
Both stdio and streamableHttp. Use stdio when the MCP client launches the server binary directly (the most common local setup); use streamableHttp when running the server standalone, in Docker, or in the cloud over HTTP.
How do I configure my AI agent?
Open Window/AI Game Developer in Unity and click Auto-generate Skills or Configure MCP, or paste the shown mcpServers JSON into your client manually, or use a CLI command like 'claude mcp add ai-game-developer <command>' / 'gemini mcp add ai-game-developer <command>'.
Can I add my own tools?
Yes. Decorate a class with [AiToolType] and a method with [AiTool] to expose any C# method as an MCP Tool; you can likewise define custom MCP Prompts with [AiPromptType]/[AiPrompt]. Custom tools work both in the Editor and at runtime.
Is it free?
Yes — the project is open source under Apache-2.0 and works with any AI provider with no vendor lock-in.
Alternatives to Unity MCP (AI Game Developer)
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
Code intelligence engine that indexes repos into a persistent knowledge graph for AI coding agents.
Compare Unity MCP (AI Game Developer) with: