MCP for Unity connects AI assistants to the Unity Editor over the Model Context Protocol (MCP). From an MCP client, an assistant creates scenes and GameObjects, edits C# scripts, manages assets, prefabs, and materials, runs tests, profiles, and builds, all through natural-language prompts. It supports Unity 2021.3 LTS through 6.x and works with clients such as Claude Desktop and Claude Code, Codex, Cursor, VS Code, Windsurf, Cline, and Gemini CLI.
It has three layers. The MCP client talks to a Python server built on FastMCP, which routes each session to the right Unity instance. The server relays commands over a WebSocket hub to a C# Editor plugin, which runs them on the Unity main thread through Editor APIs and returns structured results. Clients connect over HTTP, for multi-agent, remote-hosted, and shared setups, or over stdio for a single client.
The server exposes about 50 tools in 10 groups plus 25 read-only resources. Groups such as animation, VFX, UI, testing, and ProBuilder activate per session only when needed, which keeps the prompt smaller. Several Editors can be open at once, with per-call routing for cross-project prompts and session isolation across clients. Custom tools register through a C# attribute, and the tool reference documentation is generated from the tool registry.
Features
- Editor control: scenes, GameObjects, C# scripts, assets, prefabs, and materials driven through natural language
- Tests and builds: run tests, profile, and automate builds from an MCP client
- Tool groups: animation, VFX, UI, testing, and ProBuilder tools activated per session
- Multi-instance routing: aim one MCP session at any of several open Unity Editors
- Transports: HTTP for remote and multi-agent setups, stdio for single-client setups, with automatic client configuration
- Custom tools: register a new domain with a C# attribute, scoped to a project or global
- Script validation: Roslyn validation of generated C# scripts
- Remote server auth: authentication for a remote-hosted server



