/ Directory / Playground / Unity-MCP
● Community IvanMurzak ⚡ Instant

Unity-MCP

by IvanMurzak · IvanMurzak/Unity-MCP

Full AI develop-and-test loop for Unity with 100+ tools, Roslyn-backed C# execution, and a CLI for quick setup.

IvanMurzak/Unity-MCP is a Unity plugin + MCP server that exposes a wide surface (scenes, GameObjects, components, prefabs, materials, packages, screenshots, tests, Roslyn C# execution) to any MCP client. Emphasizes token efficiency and an AI Skills layer on top of raw tools.

Why use it

Key features

Live Demo

What it looks like in practice

unity-2.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "unity-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/IvanMurzak/Unity-MCP"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "unity-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/IvanMurzak/Unity-MCP"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "unity-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/IvanMurzak/Unity-MCP"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "unity-2": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/IvanMurzak/Unity-MCP"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "unity-2",
      "command": "TODO",
      "args": [
        "See README: https://github.com/IvanMurzak/Unity-MCP"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "unity-2": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/IvanMurzak/Unity-MCP"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add unity-2 -- TODO 'See README: https://github.com/IvanMurzak/Unity-MCP'

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Unity-MCP

How to batch-process imported assets with a single prompt

👤 Unity technical artists ⏱ ~25 min intermediate

When to use: You have 200 new textures and want consistent import settings, mip maps, and atlas placement.

Prerequisites
  • Unity project open, plugin installed — unity-mcp-cli install-plugin ./MyUnityProject or import the .unitypackage
  • An MCP client configured — Point Claude Desktop or Cursor at the local MCP server printed by the CLI
Flow
  1. Audit current settings
    List every texture in Assets/Textures/UI. Show current TextureImporter settings grouped by the values used.✓ Copied
    → Groups by settings — mostly consistent with outliers flagged
  2. Apply a policy
    For all of them set compression=HighQuality, filter=Bilinear, mipmaps=false. Reimport.✓ Copied
    → Progress log + final consistent state
  3. Verify visually
    Take a screenshot of Scene MainMenu from the default camera — confirm nothing looks broken.✓ Copied
    → Screenshot returned, sanity-check passes

Outcome: Uniform import settings across a folder + a screenshot trail.

Pitfalls
  • Reimport blocks the editor domain reload — Save scene first; don't issue unrelated commands until reimport is done
Combine with: filesystem

How to run a one-off C# snippet in the Editor without writing a script

👤 Unity devs doing throwaway cleanup ⏱ ~15 min advanced

When to use: You want to iterate through every prefab and fix a broken reference — once.

Flow
  1. Describe the snippet
    Execute C# via Roslyn: iterate every prefab under Assets/Prefabs, find MissingScript components, list the prefab + missing script guid.✓ Copied
    → Report of bad prefabs
  2. Apply the fix
    Now remove those MissingScript components and save each prefab.✓ Copied
    → Updated prefab count

Outcome: A project free of missing-script warnings.

Pitfalls
  • Roslyn exec has full editor power — a bad snippet can corrupt the project — Commit to git before running; review the code snippet before executing
Combine with: github

How to triage a visual regression via screenshots

👤 QA, solo devs ⏱ ~10 min beginner

When to use: A tester says 'the menu looks wrong' and you want a ground-truth image fast.

Flow
  1. Open the suspect scene
    Open scene MainMenu and take a screenshot from the UI camera at 1920x1080.✓ Copied
    → Screenshot file path returned
  2. Compare with a reference
    Here is the golden image [attach]. Describe the differences.✓ Copied
    → Specific callouts (offsets, colors, missing elements)

Outcome: A bug report with image evidence attached.

Combine with: github

Combinations

Pair with other MCPs for X10 leverage

unity-2 + github

Automate refactors + commit + PR from chat

Rename the PlayerController.Speed field to MoveSpeed everywhere, run tests, commit and open a PR.✓ Copied
unity-2 + filesystem

Import external 3D models into the project

Move every .fbx from ~/Downloads/kenney/ into Assets/Models/ and set them to read/write disabled.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
scene_open path: str Load a scene before inspection or edits free
gameobject_find query: str Locate objects free
component_add target, type, values? Attach components free
script_create path, body New C# file free
csharp_execute code: str One-off editor automation free
test_run mode: 'Edit'|'Play', filter? Run unit/play tests free
screenshot camera?: str, resolution?: {w,h} Visual verification free
console_read since_ms? Check errors after changes free

Cost & Limits

What this costs to run

API quota
No remote API — all local
Tokens per call
Scene listings can grow large; cap with filters
Monetary
Free, open source
Tip
Prefer narrow queries (gameobject_find 'Enemy*') over full-hierarchy dumps.

Security

Permissions, secrets, blast radius

Minimum scopes: Local filesystem write to the project
Credential storage: None — localhost only
Data egress: Localhost. Your LLM provider receives whatever scene/script content the tool returns.
Never grant: Do not expose the MCP HTTP port to non-loopback interfaces

Troubleshooting

Common errors and fixes

Project path contains spaces: tools fail

Move the project to a path with no spaces. This is a documented limitation.

CLI cannot find Unity

Set UNITY_EDITOR_PATH env var to the editor binary.

Verify: $UNITY_EDITOR_PATH -version
csharp_execute throws 'type not found'

Unity must have compiled successfully before execution. Fix red console first and refresh.

Alternatives

Unity-MCP vs others

AlternativeWhen to use it insteadTradeoff
MCP for Unity (CoplayDev)You want the most popular option with a large tool surfaceNo Roslyn-based arbitrary C# execution
mcp-unity (CoderGamester)Simpler surface focused on scenes/testsFewer advanced tools

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills