|  | 
|  | 1 | +# MCP for Unity Server | 
|  | 2 | + | 
|  | 3 | +[](https://modelcontextprotocol.io/introduction) | 
|  | 4 | +[](https://www.python.org) | 
|  | 5 | +[](https://opensource.org/licenses/MIT) | 
|  | 6 | +[](https://discord.gg/y4p8KfzrN4) | 
|  | 7 | + | 
|  | 8 | +Model Context Protocol server for Unity Editor integration. Control Unity through natural language using AI assistants like Claude, Cursor, and more. | 
|  | 9 | + | 
|  | 10 | +**Maintained by [Coplay](https://www.coplay.dev/?ref=unity-mcp)** - This project is not affiliated with Unity Technologies. | 
|  | 11 | + | 
|  | 12 | +💬 **Join our community:** [Discord Server](https://discord.gg/y4p8KfzrN4) | 
|  | 13 | + | 
|  | 14 | +**Required:** Install the [Unity MCP Plugin](https://github.com/CoplayDev/unity-mcp?tab=readme-ov-file#-step-1-install-the-unity-package) to connect Unity Editor with this MCP server. | 
|  | 15 | + | 
|  | 16 | +--- | 
|  | 17 | + | 
|  | 18 | +## Installation | 
|  | 19 | + | 
|  | 20 | +### Option 1: Using uvx (Recommended) | 
|  | 21 | + | 
|  | 22 | +Run directly from GitHub without installation: | 
|  | 23 | + | 
|  | 24 | +```bash | 
|  | 25 | +uvx --from git+https://github.com/CoplayDev/unity-mcp@v6.3.0#subdirectory=Server mcp-for-unity | 
|  | 26 | +``` | 
|  | 27 | + | 
|  | 28 | +**MCP Client Configuration:** | 
|  | 29 | + | 
|  | 30 | +```json | 
|  | 31 | +{ | 
|  | 32 | +  "mcpServers": { | 
|  | 33 | +    "UnityMCP": { | 
|  | 34 | +      "command": "uvx", | 
|  | 35 | +      "args": [ | 
|  | 36 | +        "--from", | 
|  | 37 | +        "git+https://github.com/CoplayDev/unity-mcp@v6.3.0#subdirectory=Server", | 
|  | 38 | +        "mcp-for-unity" | 
|  | 39 | +      ] | 
|  | 40 | +    } | 
|  | 41 | +  } | 
|  | 42 | +} | 
|  | 43 | +``` | 
|  | 44 | + | 
|  | 45 | +### Option 2: Using uv (Local Installation) | 
|  | 46 | + | 
|  | 47 | +For local development or custom installations: | 
|  | 48 | + | 
|  | 49 | +```bash | 
|  | 50 | +# Clone the repository | 
|  | 51 | +git clone https://github.com/CoplayDev/unity-mcp.git | 
|  | 52 | +cd unity-mcp/Server | 
|  | 53 | + | 
|  | 54 | +# Run with uv | 
|  | 55 | +uv run server.py | 
|  | 56 | +``` | 
|  | 57 | + | 
|  | 58 | +**MCP Client Configuration:** | 
|  | 59 | + | 
|  | 60 | +**Windows:** | 
|  | 61 | +```json | 
|  | 62 | +{ | 
|  | 63 | +  "mcpServers": { | 
|  | 64 | +    "UnityMCP": { | 
|  | 65 | +      "command": "uv", | 
|  | 66 | +      "args": [ | 
|  | 67 | +        "run", | 
|  | 68 | +        "--directory", | 
|  | 69 | +        "C:\\path\\to\\unity-mcp\\Server", | 
|  | 70 | +        "server.py" | 
|  | 71 | +      ] | 
|  | 72 | +    } | 
|  | 73 | +  } | 
|  | 74 | +} | 
|  | 75 | +``` | 
|  | 76 | + | 
|  | 77 | +**macOS/Linux:** | 
|  | 78 | +```json | 
|  | 79 | +{ | 
|  | 80 | +  "mcpServers": { | 
|  | 81 | +    "UnityMCP": { | 
|  | 82 | +      "command": "uv", | 
|  | 83 | +      "args": [ | 
|  | 84 | +        "run", | 
|  | 85 | +        "--directory", | 
|  | 86 | +        "/path/to/unity-mcp/Server", | 
|  | 87 | +        "server.py" | 
|  | 88 | +      ] | 
|  | 89 | +    } | 
|  | 90 | +  } | 
|  | 91 | +} | 
|  | 92 | +``` | 
|  | 93 | + | 
|  | 94 | +### Option 3: Using Docker | 
|  | 95 | + | 
|  | 96 | +```bash | 
|  | 97 | +docker build -t unity-mcp-server . | 
|  | 98 | +docker run unity-mcp-server | 
|  | 99 | +``` | 
|  | 100 | + | 
|  | 101 | +**MCP Client Configuration:** | 
|  | 102 | + | 
|  | 103 | +```json | 
|  | 104 | +{ | 
|  | 105 | +  "mcpServers": { | 
|  | 106 | +    "UnityMCP": { | 
|  | 107 | +      "command": "docker", | 
|  | 108 | +      "args": ["run", "-i", "unity-mcp-server"] | 
|  | 109 | +    } | 
|  | 110 | +  } | 
|  | 111 | +} | 
|  | 112 | +``` | 
|  | 113 | + | 
|  | 114 | +--- | 
|  | 115 | + | 
|  | 116 | +## Configuration | 
|  | 117 | + | 
|  | 118 | +The server connects to Unity Editor automatically when both are running. No additional configuration needed. | 
|  | 119 | + | 
|  | 120 | +**Environment Variables:** | 
|  | 121 | + | 
|  | 122 | +- `DISABLE_TELEMETRY=true` - Opt out of anonymous usage analytics | 
|  | 123 | +- `LOG_LEVEL=DEBUG` - Enable detailed logging (default: INFO) | 
|  | 124 | + | 
|  | 125 | +--- | 
|  | 126 | + | 
|  | 127 | +## Example Prompts | 
|  | 128 | + | 
|  | 129 | +Once connected, try these commands in your AI assistant: | 
|  | 130 | + | 
|  | 131 | +- "Create a 3D player controller with WASD movement" | 
|  | 132 | +- "Add a rotating cube to the scene with a red material" | 
|  | 133 | +- "Create a simple platformer level with obstacles" | 
|  | 134 | +- "Generate a shader that creates a holographic effect" | 
|  | 135 | +- "List all GameObjects in the current scene" | 
|  | 136 | + | 
|  | 137 | +--- | 
|  | 138 | + | 
|  | 139 | +## Documentation | 
|  | 140 | + | 
|  | 141 | +For complete documentation, troubleshooting, and advanced usage: | 
|  | 142 | + | 
|  | 143 | +📖 **[Full Documentation](https://github.com/CoplayDev/unity-mcp#readme)** | 
|  | 144 | + | 
|  | 145 | +--- | 
|  | 146 | + | 
|  | 147 | +## Requirements | 
|  | 148 | + | 
|  | 149 | +- **Python:** 3.11 or newer | 
|  | 150 | +- **Unity Editor:** 2021.3 LTS or newer | 
|  | 151 | +- **uv:** Python package manager ([Installation Guide](https://docs.astral.sh/uv/getting-started/installation/)) | 
|  | 152 | + | 
|  | 153 | +--- | 
|  | 154 | + | 
|  | 155 | +## License | 
|  | 156 | + | 
|  | 157 | +MIT License - See [LICENSE](https://github.com/CoplayDev/unity-mcp/blob/main/LICENSE) | 
0 commit comments