Unity MCP Server — Claude Code MCP server: install and setup
Provides AI assistants with direct access to Unity project settings, scenes, and assemblies without running the editor. Useful for project audits from your IDE.
claude mcp add unity-mcp-server -e UNITY_PROJECT_PATH=<UNITY_PROJECT_PATH> -- npx -y unity-mcp-serverWhat Unity MCP Server does
The server inspects project folders directly over stdio, reading package manifests, project settings, and asset files. As a result, assistants in Claude Code or Cursor can inspect build scene lists, physics collision matrices, and assembly definitions. Running the Unity Editor is never required.
The toolset covers code inspection, asmdef dependency tracking, and package graph evaluation. It can check time step values, audio settings, or package samples straight from the project directory.
Every setup requires the UNITY_PROJECT_PATH environment variable pointing to the root folder, since the server cannot read files without a defined location.
What it helps with
- list build scenes in their configured order
- trace dependencies across asmdef definitions
- inspect physics collision layers and matrix settings
- check installed Unity packages and version configs
Example prompts for the agent
- What scenes are registered in the build settings?
- Show the collision layer matrix for this project
- Which assemblies depend on
MyGame.Core?
How to install Unity MCP Server
Platform CLI
claude mcp add unity-mcp-server -e UNITY_PROJECT_PATH=<UNITY_PROJECT_PATH> -- npx -y unity-mcp-serverReplace <…> with your own values
Platform CLI
codex mcp add unity-mcp-server --env UNITY_PROJECT_PATH=<UNITY_PROJECT_PATH> -- npx -y unity-mcp-serverReplace <…> with your own values
Config file
{
"mcpServers": {
"unity-mcp-server": {
"command": "npx",
"args": [
"-y",
"unity-mcp-server"
],
"env": {
"UNITY_PROJECT_PATH": "<UNITY_PROJECT_PATH>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"unity-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"unity-mcp-server"
],
"env": {
"UNITY_PROJECT_PATH": "<UNITY_PROJECT_PATH>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e UNITY_PROJECT_PATH=<UNITY_PROJECT_PATH> unity-mcp-server npx -y unity-mcp-serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Unity MCP Server
How do I install Unity MCP Server in Claude Code?
Run claude mcp add unity-mcp-server -e UNITY_PROJECT_PATH=<UNITY_PROJECT_PATH> -- npx -y unity-mcp-server, replacing <UNITY_PROJECT_PATH> with your actual project root path.
What does Unity MCP Server do?
It gives MCP-compatible coding assistants direct access to inspect Unity assets, project configurations, and code assemblies straight from disk.
Do I need the Unity Editor running to use this server?
No, the server reads files directly from the filesystem, so the editor does not need to be open.