Unity MCP: Connect Claude, Cursor or VS Code to the Unity Editor

Illustration of an AI chip connected to a game editor window

AI coding assistants got good at writing C#, but for a long time they were blind to the Unity Editor itself. They couldn’t see your scene, read the Console, create a prefab or press Play. Unity MCP changes that. MCP (Model Context Protocol) is an open standard that lets an AI assistant such as Claude Code, Cursor, VS Code Copilot or Windsurf call tools inside another program. A Unity MCP server exposes the Editor as a set of tools, so the assistant can inspect the hierarchy, edit GameObjects, write scripts, read compiler errors and run tests. This guide explains how it works, how to set it up, what it is actually good at, and how to keep it from wrecking your project.

What Unity MCP Is (and Isn’t)

An MCP setup has three parts:

  • The client: the AI app you chat with (Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and others).
  • The MCP server: a small program that advertises a list of tools (“find GameObjects”, “create script”, “read console”) and their parameters.
  • The Unity bridge: a package inside your Unity project that receives those tool calls and runs them through the Editor API.

When you ask “add a point light above the player and make it orange”, the model decides to call a tool like manage_gameobject with the right arguments, the server forwards that to the Editor, and Unity does the work exactly as if you had clicked through the menus. The model then reads the result and continues.

What it isn’t: it’s not a game generator, and it doesn’t make the model understand your design. It gives a capable coding assistant hands and eyes inside the Editor. The quality of the result still depends on the model, your instructions and how well your project is organised.

Your Options: Official Unity AI vs. Community MCP Servers

Option Works with Good for
Unity AI (Unity’s own Assistant inside the Editor, Unity 6.x) Unity’s built-in chat window Staying entirely inside Unity, with Unity-managed models and points-based pricing
MCP for Unity (open source, by Coplay, on GitHub) Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and other MCP clients Using the assistant you already pay for, with a large tool set (scenes, GameObjects, scripts, materials, prefabs, tests, console)
Other community servers Varies Niche workflows. Check how recently they were updated before relying on one.

Unity’s AI features change quickly between Unity 6 point releases, so check the Unity AI documentation for the version you’re on. The rest of this guide uses MCP for Unity, because it works with the most clients and is the most widely used open-source option.

Setup: MCP for Unity with Claude Code, Cursor or VS Code

1. Requirements

  • Unity 2021.3 LTS or newer (Unity 6 recommended).
  • Python 3.10+ and uv, which the server uses to run. Install uv first. On Windows, winget install astral-sh.uv works; on macOS, brew install uv.
  • An MCP-capable client, such as Claude Code, Cursor or VS Code with Copilot agent mode.

2. Install the Unity package

Open Window > Package Manager, click + > Install package from git URL, and paste the URL from the project’s GitHub README (it points at the MCPForUnity folder of the CoplayDev/unity-mcp repository). Copy it from the README rather than from a blog post, because the path has changed between versions.

3. Connect your client

Open Window > MCP for Unity. The window shows whether the bridge is running and lists supported clients. Click Configure (or Auto-Setup) next to your client and it writes the MCP entry into that client’s config file for you. Restart the client afterwards.

To check it worked:

  • Claude Code: run claude mcp list in a terminal, or type /mcp inside a session. The Unity server should show as connected.
  • Cursor: Settings > MCP should show the server with a green dot and its tool list.
  • VS Code: open the Copilot chat in Agent mode and click the tools icon. The Unity tools should be listed.

4. Keep Unity open

The bridge lives inside the Editor, so Unity must be open with the project loaded. If you have more than one project open, the MCP window shows which instance is active, and most servers let you pick one.

Your First Prompts

Start with read-only questions so you can see what the assistant sees:

What's in the open scene? List the root GameObjects and their components.

Read the Unity console and explain any errors.

Which scripts reference the PlayerHealth component?

Then small, checkable edits:

Create a 20x20 plane called Ground at the origin and a capsule called Player
standing on it, with a Rigidbody (interpolation on, rotation frozen).

Write a PlayerMover script using the new Input System (WASD + gamepad left stick),
attach it to Player, then check the console for compile errors and fix them.

Make a prefab from Player in Assets/Prefabs.

Notice the last sentence of the second prompt. The single most useful habit is to ask the assistant to check the Console after every change. Because it can read compiler errors itself, it can fix its own mistakes in a loop instead of you copying errors back and forth.

What It’s Good At, and What It’s Bad At

Good at

  • Boilerplate scene setup: test levels, UI canvases, lighting rigs, spawning grids of objects.
  • Write-compile-fix loops: writing a script, reading the compile errors and fixing them without you in the middle.
  • Project-wide chores: renaming, finding every object missing a component, setting import settings on a folder of textures, auditing materials.
  • Explaining an unfamiliar project: “walk me through how the inventory works” when it can open both the scripts and the scene.
  • Running tests: running EditMode/PlayMode tests and fixing failures.

Bad at

  • Visual judgment. It can’t see the Game view the way you do (some setups can capture screenshots, which helps), so “make it look nicer” gives random results. Give numbers: colours, positions, sizes.
  • Large, vague requests. “Make a survival game” produces a pile of half-connected scripts. Ask for one system at a time.
  • Things only you know: feel, balance, your art direction.
  • Very large scenes. Dumping a 50,000-object hierarchy into the conversation wastes context. Ask it to search for specific objects instead.

💻 Unity, an IDE and an AI client all at once

Running the Editor, a language server and an AI tool side by side is heavy on RAM. If your machine is swapping, our free quiz matches you with a laptop that handles the whole stack for the kind of game you’re making.

Take the Laptop Recommendation Quiz →

Working Safely: Version Control and Review

An MCP assistant can change many files and scene objects quickly. Treat it like a fast junior developer with commit access:

  1. Use version control and commit before each AI session. If something goes wrong, you revert instead of untangling. (Our Git for Unity guide covers the setup and .gitignore.)
  2. Save the scene yourself before asking for big scene edits, and review the diff of the .unity file afterwards.
  3. Keep tool approvals on for destructive actions (deleting assets, running arbitrary code) until you trust the workflow. Most clients let you approve tools individually.
  4. Be careful with “execute code” tools. Some servers can run arbitrary C# in the Editor. It’s powerful and also the easiest way to do damage.
  5. Don’t paste untrusted text (random forum posts, downloaded asset readmes) into the conversation and ask the assistant to “do what it says”.

Troubleshooting

The client says the Unity server failed to start

Usually uv or Python isn’t on the PATH the client sees. Run uv --version in a fresh terminal. On Windows, restart the client (or the whole machine) after installing uv so it picks up the new PATH.

Connected, but every tool call times out

The bridge inside Unity isn’t running, or Unity is busy (importing assets, compiling, or sitting at a modal dialog). Bring the Editor to the front, wait for compilation to finish, and check the MCP window’s status.

Tools work, then stop after a script change

Every domain reload (after scripts compile) restarts the bridge. It reconnects automatically after a few seconds. Ask the assistant to wait for compilation to finish before its next call.

“Multiple Unity instances” errors

Close the projects you aren’t using, or tell the assistant which instance to target. The MCP window shows each instance’s name.

The assistant edits the wrong object

Duplicate names are the usual cause. Give objects unique names, or refer to them by path (Environment/Lights/Sun).

FAQ

What is Unity MCP?

It’s a Model Context Protocol server plus a Unity package that lets AI assistants like Claude Code or Cursor call Editor tools: read the scene, create and edit GameObjects, write scripts and read the Console.

Is Unity MCP free?

The open-source MCP for Unity package is free. You still pay for whichever AI client and model you use with it.

Which AI clients work with Unity MCP?

Any MCP client, including Claude Code, Claude Desktop, Cursor, VS Code (Copilot agent mode) and Windsurf.

Does it work with Unity 6?

Yes. MCP for Unity supports Unity 2021.3 LTS and newer, including Unity 6.

Can it break my project?

It can make large changes quickly, so commit to version control before each session and keep approvals on for destructive tools.

Do I still need to know C#?

Yes. You need to read and review what it writes, spot wrong assumptions and debug when it gets stuck. It speeds up developers. It doesn’t replace them.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *