The Unity MCP Package enables seamless communication between Unity and Large Language Models (LLMs) like Claude Desktop via the Model Context Protocol (MCP). This server acts as a bridge, allowing Unity to send commands to and receive responses from MCP-compliant tools, empowering developers to automate workflows, manipulate assets, and control the Unity Editor programmatically.
The Unity MCP Server provides a bidirectional communication channel between Unity (via C#) and a Python server, enabling:
If you're on Mac, please install uv as
brew install uv
On Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
and then add to your PATH:
set Path=%USERPROFILE%\.local\bin;%Path%
On Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
Otherwise, installation instructions are on their website: Install uv
⚠️ Do not proceed before installing UV
Add the Unity Package
Set Up Python Environment
Library/PackageCache/com.justinpbarnett.unity-mcp/Python
Assets/unity-mcp/Python
uv venv
uv pip install -e .
Alternatively, manually configure your MCP client:
{
"mcpServers": {
"unityMCP": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/unity-mcp/Python",
"run",
"server.py"
]
}
}
}
Replace /path/to/your/unity-mcp/Python
with the actual path to the Unity MCP Python directory.
⚠️ Only run one instance of the MCP server (either on Cursor or Claude Desktop), not both
Once configured, you can use the MCP Client to interact with Unity directly through their chat interface.
Encountering issues? Here are some common fixes:
Unity Bridge Not Running
Python Server Not Connected
python server.py
in the Python directory).Configuration Issues with Claude Desktop or Cursor
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.