A Unity MCP server that allows MCP clients like Claude Desktop or Cursor to perform Unity Editor actions.
undefinedCreate your Unity apps with LLMs!undefined
Unity MCP acts as a bridge, allowing AI assistants (like Claude, Cursor) to interact directly with your Unity Editor via a local MCP (Model Context Protocol) Client. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
Your LLM can use functions like:
read_console: Gets messages from or clears the console.manage_script: Manages C# scripts (create, read, update, delete).manage_editor: Controls and queries the editor’s state and settings.manage_scene: Manages scenes (load, save, create, get hierarchy, etc.).manage_asset: Performs asset operations (import, create, modify, delete, etc.).manage_shader: Performs shader CRUD operations (create, read, modify, delete).manage_gameobject: Manages GameObjects: create, modify, delete, find, and component operations.execute_menu_item: Executes a menu item via its path (e.g., “File/Save Project”).Unity MCP connects your tools using two components:
undefinedFlow: [Your LLM via MCP Client] <-> [Unity MCP Server (Python)] <-> [Unity MCP Bridge (Unity Editor)]
undefinedNote: The setup is constantly improving as we update the package. Check back if you randomly start to run into issues.
undefinedGit CLI: For cloning the server code. Download Git
undefinedPython: Version 3.12 or newer. Download Python
undefinedUnity Hub & Editor: Version 2020.3 LTS or newer. Download Unity
undefineduv (Python package manager):undefined
pip install uv
# Or see: https://docs.astral.sh/uv/getting-started/installation/
undefinedAn MCP Client:undefined
For Strict validation level that catches undefined namespaces, types, and methods:
undefinedMethod 1: NuGet for Unity (Recommended)undefined
Window > NuGet Package ManagerMicrosoft.CodeAnalysis.CSharp and install the packagePlayer Settings > Scripting Define SymbolsUSE_ROSLYNundefinedMethod 2: Manual DLL Installationundefined
Assets/Plugins/ folderUSE_ROSLYN to Scripting Define SymbolsundefinedNote: Without Roslyn, script validation falls back to basic structural checks. Roslyn enables full C# compiler diagnostics with precise error reporting.
Window > Package Manager.+ -> Add package from git URL....https://github.com/justinpbarnett/unity-mcp.git?path=/UnityMcpBridge
Add.Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installed in Step 1.
undefinedOption A: Auto-Configure (Recommended for Claude/Cursor/VSC Copilot)undefined
Window > Unity MCP.Auto Configure on the IDE you uses.undefinedOption B: Manual Configurationundefined
If Auto-Configure fails or you use a different client:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonmcpServers section, using the exact paths from Step 1.undefinedWindows:undefined
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\UnityMCP\\UnityMcpServer\\src",
"server.py"
]
}
// ... other servers might be here ...
}
}
(Remember to replace YOUR_USERNAME and use double backslashes \)
undefinedmacOS:undefined
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/usr/local/bin/UnityMCP/UnityMcpServer/src",
"server.py"
]
}
// ... other servers might be here ...
}
}
(Replace YOUR_USERNAME if using ~/bin)
undefinedLinux:undefined
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/home/YOUR_USERNAME/bin/UnityMCP/UnityMcpServer/src",
"server.py"
]
}
// ... other servers might be here ...
}
}
(Replace YOUR_USERNAME)
undefinedOption C: Claude Code Registrationundefined
If you’re using Claude Code, you can register the MCP server using these commands:
undefinedmacOS:undefined
claude mcp add UnityMCP -- uv --directory /[PATH_TO]/UnityMCP/UnityMcpServer/src run server.py
undefinedWindows:undefined
claude mcp add UnityMCP -- "C:/Users/USERNAME/AppData/Roaming/Python/Python313/Scripts/uv.exe" --directory "C:/Users/USERNAME/AppData/Local/Programs/UnityMCP/UnityMcpServer/src" run server.py
undefinedOpen your Unity Project. The Unity MCP Bridge (package) should connect automatically. Check status via Window > Unity MCP.
undefinedStart your MCP Client (Claude, Cursor, etc.). It should automatically launch the Unity MCP Server (Python) using the configuration from Installation Step 3.
undefinedInteract! Unity tools should now be available in your MCP Client.
Example Prompt: Create a 3D player controller, Create a yellow and bridge sun, Create a cool shader and apply it on a cube.
Help make Unity MCP better!
undefinedFork the main repository.
undefinedCreate a branch (feature/your-idea or bugfix/your-fix).
undefinedMake changes.undefined
undefinedCommit (feat: Add cool new feature).
undefinedPush your branch.
undefinedOpen a Pull Request against the master branch.
undefinedUnity Bridge Not Running/Connecting:undefined
Ensure Unity Editor is open.
Check the status window: Window > Unity MCP.
Restart Unity.
undefinedMCP Client Not Connecting / Server Not Starting:undefined
undefinedVerify Server Path: Double-check the --directory path in your MCP Client’s JSON config. It must exactly match the location where you cloned the UnityMCP repository in Installation Step 1 (e.g., …/Programs/UnityMCP/UnityMcpServer/src).
undefinedVerify uv: Make sure uv is installed and working (pip show uv).
undefinedRun Manually: Try running the server directly from the terminal to see errors: # Navigate to the src directory first! cd /path/to/your/UnityMCP/UnityMcpServer/src uv run server.py
undefinedPermissions (macOS/Linux): If you installed the server in a system location like /usr/local/bin, ensure the user running the MCP client has permission to execute uv and access files there. Installing in ~/bin might be easier.
undefinedAuto-Configure Failed:undefined
Still stuck? Open an Issue or Join the Discord!
MIT License. See LICENSE file.
Thanks to the contributors and the Unity team.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.