/ Verzeichnis / Playground / Unity-MCP
● Community IvanMurzak ⚡ Sofort

Unity-MCP

von 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.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

unity-2.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren 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
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

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

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

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

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

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

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

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

Continue nutzt ein Array von Serverobjekten statt einer Map.

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

In context_servers hinzufügen. Zed lädt beim Speichern neu.

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

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: Unity-MCP

How to batch-process imported assets with a single prompt

👤 Unity technical artists ⏱ ~25 min intermediate

Wann einsetzen: You have 200 new textures and want consistent import settings, mip maps, and atlas placement.

Voraussetzungen
  • 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
Ablauf
  1. Audit current settings
    List every texture in Assets/Textures/UI. Show current TextureImporter settings grouped by the values used.✓ Kopiert
    → Groups by settings — mostly consistent with outliers flagged
  2. Apply a policy
    For all of them set compression=HighQuality, filter=Bilinear, mipmaps=false. Reimport.✓ Kopiert
    → Progress log + final consistent state
  3. Verify visually
    Take a screenshot of Scene MainMenu from the default camera — confirm nothing looks broken.✓ Kopiert
    → Screenshot returned, sanity-check passes

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

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

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

👤 Unity devs doing throwaway cleanup ⏱ ~15 min advanced

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

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

Ergebnis: A project free of missing-script warnings.

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

How to triage a visual regression via screenshots

👤 QA, solo devs ⏱ ~10 min beginner

Wann einsetzen: A tester says 'the menu looks wrong' and you want a ground-truth image fast.

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

Ergebnis: A bug report with image evidence attached.

Kombinieren mit: github

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

unity-2 + github

Automate refactors + commit + PR from chat

Rename the PlayerController.Speed field to MoveSpeed everywhere, run tests, commit and open a PR.✓ Kopiert
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.✓ Kopiert

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
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

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
No remote API — all local
Tokens pro Aufruf
Scene listings can grow large; cap with filters
Kosten in €
Free, open source
Tipp
Prefer narrow queries (gameobject_find 'Enemy*') over full-hierarchy dumps.

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: Local filesystem write to the project
Credential-Speicherung: None — localhost only
Datenabfluss: Localhost. Your LLM provider receives whatever scene/script content the tool returns.
Niemals gewähren: Do not expose the MCP HTTP port to non-loopback interfaces

Fehlerbehebung

Häufige Fehler und Lösungen

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.

Prüfen: $UNITY_EDITOR_PATH -version
csharp_execute throws 'type not found'

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

Alternativen

Unity-MCP vs. andere

AlternativeWann stattdessenKompromiss
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

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen