Unity MCP
An MCP bridge that gives AI agents real control of the Unity Editor — not just "spawn a cube".
Role · Solo — MCP server, Unity bridge package
Version
0.3.0
Tool groups
13
Escape hatch
exec_csharp
Unity MCP is a Model Context Protocol bridge that lets Claude Code, Cursor, or any MCP client drive a live Unity Editor: read scenes, manage multi-scene workflows, mutate GameObjects, drive Selection, set serialized fields, create materials and prefabs, render screenshots, and run tests.
AI agent ◀── MCP ──▶ unity-mcp server ◀── TCP ──▶ Unity Editor (Bridge package)
(Claude Code, ▲
Cursor, ...) │
Roslyn-compiled
C# (cached)
Why it exists
Existing Unity MCP integrations stop at spawning a cube. That's fine for a demo video and useless for real work. This one is built on two convictions.
A typed tool surface alone isn't enough. Unity exposes thousands of API surfaces
and no static tool list will ever cover them. So there is a deliberate escape hatch:
exec_csharp compiles and runs arbitrary C# inside the Editor through Roslyn, cached
between calls. When the typed tool doesn't exist, the agent writes the C# instead of
giving up.
The agent should pick the right tool, not be told which one. Tool descriptions are written for an LLM reader rather than a human one — they name failure modes and preconditions explicitly, because a description that only reads well to a person leads the model into the wrong call.
The tool surface
Thirteen groups covering project info and compile status, scene read and file operations, Selection, GameObject and Component mutation, assets, prefabs, play mode, editor menus, the test runner, screenshots, and the console.
Two pieces are more unusual. Actions are user-defined operations the agent can
list, read, create, edit, promote, and run — and every compatible action is published
as its own MCP tool via notifications/tools/list_changed, so the tool surface grows
at runtime. And ctx.CallAction(name, params) is available inside exec_csharp and
inside any action, so actions compose rather than sitting flat.
Deliberate omissions
Input synthesis and frame stepping are not included in play-mode control. They are the kind of capability that looks powerful in a tool list and produces unreproducible sessions in practice.