Unity MCP
Perform actions in the Unity Editor for game development using AI clients.
| 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 | GitHub Copilot CLI | 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#main
Want the latest beta? Use the beta branch:
https://github.com/CoplayDev/unity-mcp.git?path=/MCPForUnity#beta
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"
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
apply_text_edits • batch_execute • create_script • debug_request_context • delete_script • execute_custom_tool • execute_menu_item • find_gameobjects • find_in_file • get_sha • get_test_job • manage_animation • manage_asset • manage_components • manage_editor • manage_gameobject • manage_material • manage_prefabs • manage_scene • manage_script • manage_script_capabilities • manage_scriptable_object • manage_shader • manage_texture • manage_vfx • read_console • refresh_unity • run_tests • script_apply_edits • set_active_instance • validate_script
Available Resources
active_tool • custom_tools • editor_prefab_stage • editor_selection • editor_state • editor_windows • gameobject • gameobject_api • gameobject_component • gameobject_components • get_tests • menu_items • prefab_api • prefab_hierarchy • prefab_info • project_info • project_layers • project_tags • unity_instances
Performance Tip: Use batch_execute for multiple operations — it's 10-100x faster than individual calls!
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"
}
}
}
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"]
}
}
}
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
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
- 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
- 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
See README-DEV.md for development setup. For custom tools, see CUSTOM_TOOLS.md.
- Fork → Create issue → Branch (
feature/your-idea) → Make changes → PR
Anonymous, privacy-focused telemetry (no code, no project names, no personal data). Opt out with DISABLE_TELEMETRY=true. See TELEMETRY.md.
Network defaults are intentionally fail-closed:
- HTTP Local allows loopback-only hosts by default (
127.0.0.1,localhost,::1). - Bind-all interfaces (
0.0.0.0,::) require explicit opt-in in Advanced Settings via Allow LAN Bind (HTTP Local). - HTTP Remote requires
https://by default. - Plaintext
http://for remote endpoints requires explicit opt-in via Allow Insecure Remote HTTP.
License: MIT — See LICENSE | Need help? Discord | Issues
Star History
@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.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Laravel Forge MCP Server
Manage Laravel Forge servers and sites using the Forge API.
R.A.P.I.D.
A local MCP server providing powerful code analysis and search capabilities for software projects.
Custom MCP Server
A versatile MCP server built with Next.js, providing a range of tools and utilities with Redis state management.
Animated video MCP Server
Executes Manim Python animation scripts to generate and return videos.
Roblox Studio MCP Server
An AI-powered MCP server for Roblox Studio development, featuring advanced NLP, semantic analysis, and multi-turn conversation capabilities.
MCP POC
A proof-of-concept MCP server built with Node.js and TypeScript, compatible with Claude Desktop.
TemplateIO Image Generation
Generate images using the Templated.io API. Requires a Templated.io API key.
Shell Command MCP Server
Execute pre-configured and secure shell commands via a Go-based MCP server.
CODING DevOps
Interact with the CODING DevOps platform for managing projects and work items.
MCP Server Template
A starter template for building a Model Context Protocol (MCP) server using TypeScript and Node.js.