* Test suite audit: remove placeholders, consolidate duplicates, fix stale tests Python tests: - Delete 3 vestigial placeholder files (test_script_editing.py, test_find_in_file_minimal.py, test_resources_api.py) - Remove empty skip-marked tests from test_transport_framing.py and test_logging_stdout.py - Consolidate DummyMCP/setup_tools() into test_helpers.py - Fix flaky timing in test_telemetry_queue_worker.py (200ms → 500ms) - Remove placeholder from test_instance_routing_comprehensive.py C# tests: - Consolidate MCPToolParameterTests.cs (755 → 361 lines, -52%) - Fix 3 tests with stale "future feature" comments - features ARE implemented: - AutoGrow arrays (Phase 1.2) - Path normalization (Phase 1.1) - Bulk array mapping (Phase 3.1) - Strengthen assertions in ManageGameObjectTests.cs and CommandRegistryTests.cs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Address code review feedback: remove dead code, fix silent test skips - Remove unused tools_struct setup in test_edit_normalization_and_noop.py - Create test texture in EndToEnd_PropertyHandling_AllScenarios so texture-dependent scenarios (4, 5, 10) actually run instead of silently skipping - Add texture cleanup in finally block Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| DOCKER_OVERVIEW.md | ||
| Dockerfile | ||
| LICENSE | ||
| 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. You also need uvx (requires uv) to run the server.
Installation
Option 1: PyPI
Install and run directly from PyPI using uvx.
Run Server (HTTP):
uvx --from mcpforunityserver mcp-for-unity --transport http --http-url http://localhost:8080
MCP Client Configuration (HTTP):
{
"mcpServers": {
"UnityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}
MCP Client Configuration (stdio):
{
"mcpServers": {
"UnityMCP": {
"command": "uvx",
"args": [
"--from",
"mcpforunityserver",
"mcp-for-unity",
"--transport",
"stdio"
]
}
}
}
Option 2: From GitHub Source
Use this to run the latest released version from the repository. Change the version to main to run the latest unreleased changes from the repository.
{
"mcpServers": {
"UnityMCP": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/CoplayDev/unity-mcp@v9.0.3#subdirectory=Server",
"mcp-for-unity",
"--transport",
"stdio"
]
}
}
}
Option 3: Docker
Use Pre-built Image:
docker run -p 8080:8080 msanatan/mcp-for-unity-server:latest --transport http --http-url http://0.0.0.0:8080
Build Locally:
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".
Option 4: Local Development
For contributing or modifying the server code:
# Clone the repository
git clone https://github.com/CoplayDev/unity-mcp.git
cd unity-mcp/Server
# Run with uv
uv run src/main.py --transport stdio
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