Connect your Unity Editor to LLMs using the Model Context Protocol.
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_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:
Flow: [Your LLM via MCP Client] <-> [Unity MCP Server (Python)] <-> [Unity MCP Bridge (Unity Editor)]
Note: The setup is constantly improving as we update the package. Check back if you randomly start to run into issues.
pip install uv
# Or see: https://docs.astral.sh/uv/getting-started/installation/
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.
Option A: Auto-Configure (Recommended for Claude/Cursor)
Window > Unity MCP
.Auto Configure Claude
or Auto Configure Cursor
.Option B: Manual Configuration
If Auto-Configure fails or you use a different client:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
mcpServers
section, using the exact paths from Step 1.Windows:
{
"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 \)
macOS:
{
"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)
Linux:
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/home/YOUR_USERNAME/bin/UnityMCP/UnityMcpServer/src",
"server.py"
]
}
// ... other servers might be here ...
}
}
(Replace YOUR_USERNAME)
Open your Unity Project. The Unity MCP Bridge (package) should connect automatically. Check status via Window > Unity MCP.
Start your MCP Client (Claude, Cursor, etc.). It should automatically launch the Unity MCP Server (Python) using the configuration from Installation Step 3.
Interact! Unity tools should now be available in your MCP Client.
Example Prompt: Create a 3D player controller.
Help make Unity MCP better!
Fork the main repository.
Create a branch (feature/your-idea
or bugfix/your-fix
).
Make changes.
Commit (feat: Add cool new feature).
Push your branch.
Open a Pull Request against the master branch.
Unity Bridge Not Running/Connecting:
Ensure Unity Editor is open.
Check the status window: Window > Unity MCP.
Restart Unity.
MCP Client Not Connecting / Server Not Starting:
Verify 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).
Verify uv: Make sure uv is installed and working (pip show uv).
Run 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
Permissions (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.
Auto-Configure Failed:
Still stuck? Open an Issue.
MIT License. See LICENSE file.
Thanks to the contributors and the Unity team.
{
"mcpServers": {
"UnityMCP": {
"env": {},
"args": [
"run",
"--directory",
"C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Programs\\UnityMCP\\UnityMcpServer\\src",
"server.py"
],
"command": "uv"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.