Let an LLM
drive the Editor
With MCP, your AI assistant reads your real console, inspects your real scene, and edits your real scripts — instead of guessing from what you paste into a chat box.
mcpforunityserver 10.0.0 · 2026-08-10Two servers, one nickname
Most confusion about “Unity MCP” comes from there being two separate projects with the same name. Unity ships an official relay in the AI Assistant package from Unity 6.3, and a community server has existed for longer and supports older versions. Their install steps and config are not interchangeable.
Pick one deliberately
The comparison chapter puts both side by side, tested on the same machine, so you can choose before you spend an evening on the wrong one.
Then keep your project safe
An agent editing scenes is genuinely useful and genuinely risky. Safety and git hygiene covers what to commit, which tools to restrict, and how to recover.
Chapters
15What is Unity MCP
Letting an LLM drive the Editor
What the Model Context Protocol actually is, what an LLM can and cannot do inside Unity through it, and whether it is worth setting up.
Official vs Community Server
Unity AI Relay or MCP for Unity
A side-by-side comparison of Unity's built-in AI relay and the community MCP for Unity server, both installed and tested on the same machine.
Installing Unity MCP
Both servers, start to finish
Step-by-step install for the official Unity AI Relay and the community MCP for Unity server, with the verification step most guides skip.
Connect Claude Code
Config, transport, first run
How to connect Unity MCP to Claude Code and Claude Desktop, where the config files live, and how to confirm the tools are really working.
Connect Cursor
mcp.json, stdio, troubleshooting
Connecting Unity MCP to Cursor: where mcp.json lives, global versus project scope, and why Cursor sometimes shows a server as connected with no tools.
Connect VS Code Copilot
Agent mode and tool approval
Using Unity MCP from GitHub Copilot in VS Code: the mcp.json location, enabling agent mode, and managing which tools are allowed to run.
Prompt Recipes
Prompts that actually work
Concrete prompts for debugging, scene inspection, refactoring, and profiling with Unity MCP, plus the prompt patterns that reliably go wrong.
Safety & Git Hygiene
Never let an agent eat your scene
How to use Unity MCP without losing work: what to commit first, which tools to restrict, why Unity scenes are hard to review in git, and how to recover.
What The Tools Actually Do
A reference for the Unity MCP tool surface
Every family of tool the Unity MCP servers expose, what each one is good for, and which ones are safe to allow without review.
Debugging With MCP
One bug, start to finish
A complete worked debugging session using Unity MCP: reading the console, inspecting the scene, forming a hypothesis, and verifying the fix compiled.
LLMs Inside Your Game
When it works, and when it does not
The architecture of calling a language model from a shipped Unity game, what it genuinely improves, and the failure modes that sink most attempts.
Calling Claude From Unity
UnityWebRequest, JSON, and the reply
Real C# for calling the Claude Messages API from Unity: request shape, why JsonUtility fails on the response, and handling the cases that are not success.
API Key Security
Why your key cannot ship in the build
How API keys leak out of Unity builds, why every client-side hiding trick fails, and the proxy server pattern that actually solves it.
Streaming NPC Dialogue
Words appearing as they are written
How server-sent events work, why streaming makes a slow reply feel fast, and the C# for consuming a stream in Unity without blocking the game.
Cost, Latency & Caching
Making it affordable at player scale
Picking a model for a game, doing the cost arithmetic before you build, using prompt caching, and the fallbacks that keep the game playable when the network does not cooperate.