* feat: add TestPyPI toggle for pre-release server package testing - Add UseTestPyPI editor preference key - Add TestPyPI toggle to Advanced settings UI with tooltip - Configure uvx to use test.pypi.org when TestPyPI mode enabled - Skip version pinning in TestPyPI mode to get latest pre-release - Update ConfigJsonBuilder to handle TestPyPI index URL * Update .meta file * fix: Use PyPI pre-release versions instead of TestPyPI for beta server TestPyPI has polluted packages (broken httpx, mcp, fastapi) that cause server startup failures. Switch to publishing beta versions directly to PyPI as pre-releases (e.g., 9.3.0b20260127). Key changes: - beta-release.yml: Publish to PyPI instead of TestPyPI, use beta suffix - Use --prerelease explicit with version specifier (>=0.0.0a0) to only get prereleases of our package, not broken dependency prereleases - Default "Use Beta Server" toggle to true on beta branch - Rename UI label from "Use TestPyPI" to "Use Beta Server" - Add UseTestPyPI to EditorPrefsWindow known prefs - Add search field and refresh button to EditorPrefsWindow Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: Add beta mode indicator to UI badge and server version logging - Show "β" suffix on version badge when beta server mode is enabled - Badge updates dynamically when toggle changes - Add server version to startup log: "MCP for Unity Server v9.2.0 starting up" - Add version field to /health endpoint response Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: Rename UseTestPyPI to UseBetaServer and fix EditorPrefs margin - Rename EditorPref key from UseTestPyPI to UseBetaServer for clarity - Rename all related variables and UXML element names - Increase bottom margin on EditorPrefs search bar to prevent clipping first entry Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * refactor: Address code review feedback - Centralize beta server uvx args in AssetPathUtility.GetBetaServerFromArgs() to avoid duplication between HTTP and stdio transports - Cache server version at startup instead of calling get_package_version() on every /health request - Add robustness to beta version parsing in workflow: strip existing pre-release suffix and validate X.Y.Z format before parsing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Prioritize explicit fromUrl override and optimize search filter - GetBetaServerFromArgs/GetBetaServerFromArgsList now check for explicit GitUrlOverride before applying beta server mode, ensuring local dev paths and custom URLs are honored - EditorPrefsWindow search filter uses IndexOf with OrdinalIgnoreCase instead of ToLowerInvariant().Contains() for fewer allocations Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Marcus Sanatan <msanatan@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github | ||
| CustomTools/RoslynRuntimeCompilation | ||
| MCPForUnity | ||
| Server | ||
| TestProjects | ||
| docs | ||
| scripts | ||
| tools | ||
| .dockerignore | ||
| .gitignore | ||
| .mcpbignore | ||
| LICENSE | ||
| README.md | ||
| claude_skill_unity.zip | ||
| deploy-dev.bat | ||
| docker-compose.yml | ||
| manifest.json | ||
| mcp.json | ||
| mcp_source.py | ||
| prune_tool_results.py | ||
| restore-dev.bat | ||
| test_unity_socket_framing.py | ||
README.md
| English | 简体中文 |
|---|
Proudly sponsored and maintained by Coplay -- the best AI assistant for Unity.
Create your Unity apps with LLMs! MCP for Unity bridges AI assistants (Claude, Cursor, VS Code, etc.) with your Unity Editor via the Model Context Protocol. Give your LLM the tools to manage assets, control scenes, edit scripts, and automate tasks.
Quick Start
Prerequisites
- Unity 2021.3 LTS+ — Download Unity
- Python 3.10+ and uv — Install uv
- An MCP Client — Claude Desktop | Cursor | VS Code Copilot | Windsurf
1. Install the Unity Package
In Unity: Window > Package Manager > + > Add package from git URL...
[!TIP]
https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity
Want the latest beta? Use the beta branch:
https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#beta
Other install options (Asset Store, OpenUPM)
Unity Asset Store:
- Visit MCP for Unity on the Asset Store
- Click
Add to My Assets, then import viaWindow > Package Manager
OpenUPM:
openupm add com.coplaydev.unity-mcp
2. Start the Server & Connect
- In Unity:
Window > MCP for Unity - Click Start Server (launches HTTP server on
localhost:8080) - Select your MCP Client from the dropdown and click Configure
- Look for 🟢 "Connected ✓"
- Connect your client: Some clients (Cursor, Windsurf, Antigravity) require enabling an MCP toggle in settings, while others (Claude Desktop, Claude Code) auto-connect after configuration.
That's it! Try a prompt like: "Create a red, blue and yellow cube" or "Build a simple player controller"
Features & Tools
Key Features
- Natural Language Control — Instruct your LLM to perform Unity tasks
- Powerful Tools — Manage assets, scenes, materials, scripts, and editor functions
- Automation — Automate repetitive Unity workflows
- Extensible — Works with various MCP Clients
Available Tools
manage_asset • manage_editor • manage_gameobject • manage_components • manage_material • manage_prefabs • manage_scene • manage_script • manage_scriptable_object • manage_shader • manage_vfx • manage_texture • batch_execute • find_gameobjects • find_in_file • read_console • refresh_unity • run_tests • get_test_job • execute_menu_item • apply_text_edits • script_apply_edits • validate_script • create_script • delete_script • get_sha
Available Resources
custom_tools • unity_instances • menu_items • get_tests • gameobject • gameobject_components • prefab_api • prefab_info • prefab_hierarchy • editor_state • editor_selection • editor_prefab_stage • project_info • project_tags • project_layers
Performance Tip: Use batch_execute for multiple operations — it's 10-100x faster than individual calls!
Manual Configuration
If auto-setup doesn't work, add this to your MCP client's config file:
HTTP (default — works with Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"unityMCP": {
"url": "http://localhost:8080/mcp"
}
}
}
VS Code:
{
"servers": {
"unityMCP": {
"type": "http",
"url": "http://localhost:8080/mcp"
}
}
}
Stdio configuration (uvx)
macOS/Linux:
{
"mcpServers": {
"unityMCP": {
"command": "uvx",
"args": ["--from", "mcpforunityserver", "mcp-for-unity", "--transport", "stdio"]
}
}
}
Windows:
{
"mcpServers": {
"unityMCP": {
"command": "C:/Users/YOUR_USERNAME/AppData/Local/Microsoft/WinGet/Links/uvx.exe",
"args": ["--from", "mcpforunityserver", "mcp-for-unity", "--transport", "stdio"]
}
}
}
Multiple Unity Instances
MCP for Unity supports multiple Unity Editor instances. To target a specific one:
- Ask your LLM to check the
unity_instancesresource - Use
set_active_instancewith theName@hash(e.g.,MyProject@abc123) - All subsequent tools route to that instance
Roslyn Script Validation (Advanced)
For Strict validation that catches undefined namespaces, types, and methods:
- Install NuGetForUnity
Window > NuGet Package Manager→ InstallMicrosoft.CodeAnalysisv5.0- Also install
SQLitePCLRaw.coreandSQLitePCLRaw.bundle_e_sqlite3v3.0.2 - Add
USE_ROSLYNtoPlayer Settings > Scripting Define Symbols - Restart Unity
Manual DLL installation (if NuGetForUnity isn't available)
- Download
Microsoft.CodeAnalysis.CSharp.dlland dependencies from NuGet - Place DLLs in
Assets/Plugins/folder - Ensure .NET compatibility settings are correct
- Add
USE_ROSLYNto Scripting Define Symbols - Restart Unity
Troubleshooting
- Unity Bridge Not Connecting: Check
Window > MCP for Unitystatus, restart Unity - Server Not Starting: Verify
uv --versionworks, check the terminal for errors - Client Not Connecting: Ensure the HTTP server is running and the URL matches your config
Detailed setup guides:
- Fix Unity MCP and Cursor, VSCode & Windsurf — uv/Python installation, PATH issues
- Fix Unity MCP and Claude Code — Claude CLI installation
- Common Setup Problems — macOS dyld errors, FAQ
Still stuck? Open an Issue or Join Discord
Contributing
See README-DEV.md for development setup. For custom tools, see CUSTOM_TOOLS.md.
- Fork → Create issue → Branch (
feature/your-idea) → Make changes → PR
Telemetry & Privacy
Anonymous, privacy-focused telemetry (no code, no project names, no personal data). Opt out with DISABLE_TELEMETRY=true. See TELEMETRY.md.
License: MIT — See LICENSE | Need help? Discord | Issues
Star History
Citation for Research
If you are working on research that is related to Unity-MCP, please cite us!@inproceedings{10.1145/3757376.3771417,
author = {Wu, Shutong and Barnett, Justin P.},
title = {MCP-Unity: Protocol-Driven Framework for Interactive 3D Authoring},
year = {2025},
isbn = {9798400721366},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3757376.3771417},
doi = {10.1145/3757376.3771417},
series = {SA Technical Communications '25}
}
Unity AI Tools by Coplay
Coplay offers 3 AI tools for Unity:
- MCP for Unity is available freely under the MIT license.
- Coplay is a premium Unity AI assistant that sits within Unity and is more than the MCP for Unity.
- Coplay MCP a free-for-now MCP for Coplay tools.
(These tools have different tech stacks. See this blog post comparing Coplay to MCP for Unity.)
Disclaimer
This project is a free and open-source tool for the Unity Editor, and is not affiliated with Unity Technologies.