
rachitkumarrastogi/unity-mcp-server
Developer toolsunity MCP Server
Overview
— Gives AI assistants structured access to your Unity project (Unity 6 ready) from any MCP-capable IDE or app. No Unity Editor required. Your IDE talks to this server; the server reads your Unity project folder and answers with project info, build scenes, scripts, prefabs, and more — so the AI can help without opening the Editor. - — Reads only from the project filesystem. - — Set UNITY_PROJECT_PATH per project in your MCP config. - — Works with any client that supports the Model Context Protocol (tools over stdio). This server uses the standard and exposes . Any IDE or app that can run an MCP server and pass environment variables will work. Commonly used clients include: Configuration is the same everywhere: = node, = path to dist/index.js, = UNITY_PROJECT_PATH = your Unity project root. See Configuration below for a Cursor example; other clients use the same structure in their own config format. Expand a category below to see the tools it includes.
README
Unity MCP Server
Unity3D MCP Server for Cursor, Claude Desktop, Claude Code, VS Code, Windsurf, and any MCP client — Gives AI assistants structured access to your Unity project (Unity 6 ready) from any MCP-capable IDE or app. No Unity Editor required.
Your IDE talks to this server; the server reads your Unity project folder and answers with project info, build scenes, scripts, prefabs, and more — so the AI can help without opening the Editor.
Overview
- Editor-free — Reads only from the project filesystem.
- One server, many projects — Set
UNITY_PROJECT_PATHper project in your MCP config. - MCP-native — Works with any client that supports the Model Context Protocol (tools over stdio).
Supported IDEs and clients
This server uses the standard MCP protocol over stdio and exposes tools. Any IDE or app that can run an MCP server and pass environment variables will work. Commonly used clients include:
| Client | Notes |
|---|---|
| Cursor | Add server to MCP settings; set UNITY_PROJECT_PATH in env. |
| Claude Desktop | Add to claude_desktop_config.json; same command + env pattern. |
| Claude Code | MCP support including tools. |
| VS Code | Use an MCP extension (e.g. GenAI / Copilot MCP); configure server and UNITY_PROJECT_PATH. |
| Windsurf | Add MCP server with command and env. |
| Continue | Configure MCP server in Continue settings. |
| Cline | MCP tools and resources. |
| Other | Any client that supports MCP tools over stdio (e.g. Zed, Roo Code, LibreChat, custom agents). |
Configuration is the same everywhere: command = node, args = path to dist/index.js, env = UNITY_PROJECT_PATH = your Unity project root. See Configuration below for a Cursor example; other clients use the same structure in their own config format.
Tools
Expand a category below to see the tools it includes.
All tools read from the project filesystem only.
Real-life examples
Copy-paste these into Claude, Cursor, or any MCP client (with this server configured and UNITY_PROJECT_PATH set). The AI will pick the right tools.
| Role | Example prompt |
|---|---|
| Developer | “Which assembly contains Assets/Scripts/Player.cs?” · “List scripts in MyGame.Runtime” · “Who depends on MyGame.Core?” · “Are there assembly dependency cycles?” · “Run release readiness check” |
| Tester | “Which scenes are in the build?” · “List assemblies that have test in the name” · “Is the project release ready?” · “What’s the build size and largest assets?” |
| Game developer | “Which prefabs have an Animator?” · “Summarize Hero.prefab” · “Show animator transitions in Player.controller” · “List input action assets” |
| Game designer | “Which materials use Standard shader?” · “List all ScriptableObject assets” · “Summarize Main.unity” · “What lighting does Main.unity use?” · “List all objects in Main.unity with their layers” |
What to type in Claude / Cursor or any other MCP Client
In Claude, Cursor, or any MCP client, ask in natural language; the AI picks the right tool. Use the Example prompt to type column in each tools table above — those are the phrases to type in chat to get that result.
Prerequisites
- Node.js 18+
- UNITY_PROJECT_PATH — Absolute path to your Unity project root (set in your MCP client)
Installation
npx -y unity-mcp-server
Or clone and build from source:
git clone https://github.com/rachitkumarrastogi/unity-mcp-server.git
cd unity-mcp-server
npm install
npm run build
The server uses stdio; your MCP client starts it automatically.
Configuration (Cursor, Claude Desktop, VS Code, Windsurf)
Point the client at the published package — no clone needed:
{
"mcpServers": {
"unity": {
"command": "npx",
"args": ["-y", "unity-mcp-server"],
"env": {
"UNITY_PROJECT_PATH": "/absolute/path/to/YourUnityProject"
}
}
}
}
Or, when running from source, use command: node with args: ["/absolute/path/to/unity-mcp-server/dist/index.js"] and the same env.
Replace the paths with your actual paths. For Claude Desktop, add an entry under mcpServers in claude_desktop_config.json with the same command, args, and env. For VS Code, use your MCP extension’s config to add the server and UNITY_PROJECT_PATH. Other clients follow the same pattern in their own config files.
Development
- Run built:
node dist/index.js - Run dev:
npm run devornpx tsx src/index.ts - Run tests:
npm test(builds, then runs Node’s built-in test runner overtests/)
Integration with Unity Editor
-
Current workflow: The AI runs inside your IDE (Cursor, VS Code with MCP, Claude Desktop, Windsurf, or another MCP-capable client). This server provides the AI with read-only access to your project (scenes, scripts, settings, and related assets). You run Unity Editor separately to open scenes, enter Play mode, and build. The AI uses the server to inspect the project and to suggest changes, answer questions, and assist with refactoring.
-
Future compatibility: This server implements the standard MCP protocol over stdio and requires a single environment variable (
UNITY_PROJECT_PATH). If Unity Editor gains built-in MCP client support, you could connect it to this server using the same configuration: commandnode, arguments pointing todist/index.js, andUNITY_PROJECT_PATHset in the environment. No changes to this codebase would be required.
Security
This repository does not include game code, assets, or secrets. The Unity project path is supplied at runtime by your MCP client. The server is suitable for public and private use.
Documentation
- MCP Registry — Discover and install this server from the official registry.
- Guides: Quick start · Publish · Tools by role
- Skills: Unity-domain agent skills
- Changelog: CHANGELOG.md
Install
npx -y unity-mcp-serverConfiguration
{
"mcpServers": {
"unity": {
"command": "npx",
"args": ["-y", "unity-mcp-server"],
"env": {
"UNITY_PROJECT_PATH": "/absolute/path/to/YourUnityProject"
}
}
}
}