* Update github-repo-stats.yml * Server: refine shutdown logic per bot feedback\n- Parameterize _force_exit(code) and use timers with args\n- Consistent behavior on BrokenPipeError (no immediate exit)\n- Exit code 1 on unexpected exceptions\n\nTests: restore telemetry module after disabling to avoid bleed-over * Revert "Server: refine shutdown logic per bot feedback\n- Parameterize _force_exit(code) and use timers with args\n- Consistent behavior on BrokenPipeError (no immediate exit)\n- Exit code 1 on unexpected exceptions\n\nTests: restore telemetry module after disabling to avoid bleed-over" This reverts commit 74d35d371a28b2d86cb7722e28017b29be053efd. * Add fork-only Unity tests workflow and guard upstream run * Move fork Unity tests workflow to root * Fix MCP server install step in NL suite workflow * Harden NL suite prompts for deterministic anchors * update claude haiku version for NL/T tests * Fix CI: share unity-mcp status dir * update yaml * Add Unity bridge debug step in CI * Fail fast when Unity MCP status file missing * Allow Unity local share writable for MCP status * Mount Unity cache rw and dump Editor log for MCP debug * Allow Unity config dir writable for MCP heartbeat/logs * Write Unity logs to file and list config dir in debug * Use available Anthropic models for T pass * Use latest claude sonnet/haiku models in workflow * Fix YAML indentation for MCP preflight step * Point MCP server to src/server.py and fix preflight * another try * Add MCP preflight workflow and update NL suite * Fixes to improve CI testing * Cleanup * fixes * diag * fix yaml * fix status dir * Fix YAML / printing to stdout --> stderr * find in file fixes. * fixes to find_in_file and CI report format error * Only run the stats on the CoPlay main repo, not forks. * Coderabbit fixes. |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Dockerfile | ||
| README.md | ||
| __init__.py | ||
| pyproject.toml | ||
| pyrightconfig.json | ||
| uv.lock | ||
README.md
MCP for Unity Server
Model Context Protocol server for Unity Editor integration. Control Unity through natural language using AI assistants like Claude, Cursor, and more.
Maintained by Coplay - This project is not affiliated with Unity Technologies.
💬 Join our community: Discord Server
Required: Install the Unity MCP Plugin to connect Unity Editor with this MCP server.
Installation
Option 1: Using uvx (Recommended)
Run directly from GitHub without installation:
# HTTP (default)
uvx --from git+https://github.com/CoplayDev/unity-mcp@v8.2.1#subdirectory=Server \
mcp-for-unity --transport http --http-url http://localhost:8080
# Stdio
uvx --from git+https://github.com/CoplayDev/unity-mcp@v8.2.1#subdirectory=Server \
mcp-for-unity --transport stdio
MCP Client Configuration (HTTP):
{
"mcpServers": {
"UnityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}
MCP Client Configuration (stdio):
{
"mcpServers": {
"UnityMCP": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/CoplayDev/unity-mcp@v8.2.1#subdirectory=Server",
"mcp-for-unity",
"--transport",
"stdio"
],
"type": "stdio"
}
}
}
Option 2: Using uv (Local Installation)
For local development or custom installations:
# Clone the repository
git clone https://github.com/CoplayDev/unity-mcp.git
cd unity-mcp/Server
# Run with uv (HTTP)
uv run server.py --transport http --http-url http://localhost:8080
# Run with uv (stdio)
uv run server.py --transport stdio
MCP Client Configuration (HTTP):
{
"mcpServers": {
"UnityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}
MCP Client Configuration (stdio – Windows):
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\path\\to\\unity-mcp\\Server",
"server.py",
"--transport",
"stdio"
]
}
}
}
MCP Client Configuration (stdio – macOS/Linux):
{
"mcpServers": {
"UnityMCP": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/unity-mcp/Server",
"server.py",
"--transport",
"stdio"
]
}
}
}
Option 3: Using Docker
docker build -t unity-mcp-server .
docker run -p 8080:8080 unity-mcp-server --transport http --http-url http://0.0.0.0:8080
Configure your MCP client with "url": "http://localhost:8080/mcp". For stdio-in-docker (rare), run the container with --transport stdio and use the same command/args pattern as the uv examples, wrapping it in docker run -i ... if needed.
Configuration
The server connects to Unity Editor automatically when both are running. No additional configuration needed.
Environment Variables:
DISABLE_TELEMETRY=true- Opt out of anonymous usage analyticsLOG_LEVEL=DEBUG- Enable detailed logging (default: INFO)
Example Prompts
Once connected, try these commands in your AI assistant:
- "Create a 3D player controller with WASD movement"
- "Add a rotating cube to the scene with a red material"
- "Create a simple platformer level with obstacles"
- "Generate a shader that creates a holographic effect"
- "List all GameObjects in the current scene"
Documentation
For complete documentation, troubleshooting, and advanced usage:
Requirements
- Python: 3.10 or newer
- Unity Editor: 2021.3 LTS or newer
- uv: Python package manager (Installation Guide)
License
MIT License - See LICENSE