Unity MCP with Claude Code and Cursor: Operate the Editor Without Hand-Writing Every Change
Connect Claude Code, Cursor, and Codex to Unity via Model Context Protocol—install a local bridge, preview changes, and debug scenes beyond file-only AI edits.
- unity-mcp
- mcp-for-unity
- claude-unity-mcp
- unity-claude-code
- unity-ai
- claude-code
- cursor
- vberai
The Limit of “AI Writes C# Into a Folder”
Chat-based coding tools are good at generating scripts. AI that only edits files still misses live editor state—open scenes, selected GameObjects, prefab variants, play-mode behavior, and Console errors.
If the model only sees files on disk, it guesses hierarchy and cannot click Play, rename a node in the Hierarchy, or inspect a missing reference. Teams need the assistant inside the engine loop, not only in the repo.
Model Context Protocol (MCP) is a standard way for AI clients to call tools. A Unity MCP server exposes editor actions over a local bridge so clients such as Claude Code, Cursor, and Codex-style workflows can read and change the project while Unity is running.
VberAI provides a Unity MCP plugin for that bridge. This guide is a practical setup and usage path—not a feature dump.
What Unity MCP Changes in Daily Work
| Without MCP | With Unity MCP |
|---|---|
| Paste generated scripts, then fix compile errors yourself | Ask the client to create a script and attach it to a named GameObject |
| Manually duplicate UI panels | Prompt: “Clone Panel_Shop under Canvas and rename children” |
| Describe Console errors in chat | Let the client read recent logs / selection context (where the plugin exposes it) |
| Guess scene layout from YAML | Query hierarchy, then edit with confirmation |
You still review diffs and play-mode results. You stop typing every editor click that an agent can do safely.
Prerequisites
- Unity project open (LTS recommended for team work)
- An MCP-capable client: Claude Code, Cursor, Windsurf, or similar
- Local network access to
127.0.0.1(the bridge typically stays on loopback) - The VberAI Unity MCP package for your Unity version (download / docs)
Optional but useful: a small sample scene (empty Canvas + two buttons) so first prompts are easy to verify.
Setup Checklist
1. Install the Unity MCP plugin
- Import the package into your project (or install via your team’s package workflow)
- Enable the extension / menu entry (names vary slightly by build—look for MCP or AI Bridge)
- Reload the editor if Unity asks
2. Start the local MCP bridge
Open the plugin panel and start the server. Confirm:
- Status shows running
- Host is localhost (do not expose the port publicly)
- Project path matches the Unity project you intend to edit
3. Register the server in your AI client
In Cursor or Claude Code, add an MCP server entry pointing at the local Unity bridge (stdio or HTTP/SSE—follow the plugin’s current docs).
Restart the client if tools do not appear. You should see Unity-related tools listed (scene read, node ops, etc.).
4. Run a read-only smoke test
Ask:
List the root GameObjects in the active scene.
If the reply matches Hierarchy, the bridge works. Only then try write actions.
5. Run a small write test
Ask:
Create an empty GameObject named
MCP_SmokeTestunder the scene root.
Find it in Hierarchy, then delete it. Prefer reversible tests before large refactors.
Prompt Patterns That Work Well
Structure first
Show children of
Canvas/HUDand summarize which are LayoutGroups.
Focused writes
Under
Canvas/Menu, renameButtontoBtn_Startand set the TMP label text toStart.
Debug loop
After I press Play, summarize Console errors related to
PlayerControllerand suggest the smallest fix.
Pair with generated UI
If you imported a screen from AI Studio, use MCP to wire onClick listeners or align naming with your C# conventions—without rebuilding the prefab by hand.
Safety Habits
- Keep the bridge on localhost only
- Prefer read → plan → write over one giant “rebuild the game” prompt
- Commit before large agent edits
- Do not paste secrets into prompts; MCP does not replace access control
- Treat play-mode and asset database refresh as human checkpoints
MCP reduces manual engine clicking. It does not remove code review.
How This Relates to Built-in Unity AI Assistants
Bundled Unity assistants and third-party Unity MCP plugins solve overlapping jobs. Evaluate them the same way:
- Can the tool see live Hierarchy / selection?
- Can it make reversible edits you can audit?
- Does it work with the AI client your team already uses (Claude Code, Cursor, …)?
Unity MCP is strongest when your team already lives in those clients and wants one protocol across engines (many studios also run Godot or Cocos MCP with the same habit).
FAQ
Do I still write C#?
Yes. MCP is best at editor operations and scaffolding. Gameplay systems, networking, and performance work still need engineers.
Claude Code vs Cursor?
Both work if they support MCP and you point them at the same local Unity server. Pick the client your repo already uses; the bridge is the shared piece.
Is this only for UI?
No. Hierarchy, components, and scene ops apply to gameplay objects too. UI is simply an easy first demo.
Where is the video walkthrough?
See Unity Game Engine MCP Plugin (video guide) on the VberAI channel path for a recorded setup pass.
Next Steps
- Install Unity MCP in a throwaway scene
- Connect Claude Code or Cursor and pass the read-only smoke test
- Automate one chore you hate (batch rename, duplicate panel, attach script)
When design-to-prefab is the bottleneck instead of editor ops, pair this with the Figma → Unity AI Studio workflow.
Keep reading
More guides you might like
Figma to Unity UI: From Design Frames to Prefabs with VberAI AI Studio
Turn Figma layouts into Unity UI hierarchy—import, natural-language edits, and prefab export in VberAI AI Studio, plus how Figma MCP and Unity MCP fit after handoff.
- figma-to-unity
- figma-to-code
- figma-ai
- figma-design
Build a 2D Platformer with Godot MCP: Movement, Levels, and Enemies
Ship a Godot 4 platformer prototype via MCP: CharacterBody2D feel, TileMap levels, simple enemies; bring in VberAI AI Studio when you need real HUD/title UI.
- Godot MCP
- 2D platformer
- Godot 4
- GDScript
How We Built a Real-Time MCP Server for Godot
Inside VberAI's Godot MCP architecture: how a real-time Model Context Protocol server bridges Godot's editor to AI clients without freezing the scene tree.
- vberai
- godot
- mcp
- architecture