/ Каталог / Песочница / Unity-MCP
● Сообщество IvanMurzak ⚡ Сразу

Unity-MCP

автор 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.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

unity-2.replay ▶ готово
0/0

Установка

Выберите клиент

~/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
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

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

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

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

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

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

Continue использует массив объектов серверов, а не map.

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

Добавьте в context_servers. Zed перезагружается автоматически.

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

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: Unity-MCP

How to batch-process imported assets with a single prompt

👤 Unity technical artists ⏱ ~25 min intermediate

Когда использовать: You have 200 new textures and want consistent import settings, mip maps, and atlas placement.

Предварительные требования
  • 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
Поток
  1. Audit current settings
    List every texture in Assets/Textures/UI. Show current TextureImporter settings grouped by the values used.✓ Скопировано
    → Groups by settings — mostly consistent with outliers flagged
  2. Apply a policy
    For all of them set compression=HighQuality, filter=Bilinear, mipmaps=false. Reimport.✓ Скопировано
    → Progress log + final consistent state
  3. Verify visually
    Take a screenshot of Scene MainMenu from the default camera — confirm nothing looks broken.✓ Скопировано
    → Screenshot returned, sanity-check passes

Итог: Uniform import settings across a folder + a screenshot trail.

Подводные камни
  • Reimport blocks the editor domain reload — Save scene first; don't issue unrelated commands until reimport is done
Сочетать с: filesystem

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

👤 Unity devs doing throwaway cleanup ⏱ ~15 min advanced

Когда использовать: You want to iterate through every prefab and fix a broken reference — once.

Поток
  1. Describe the snippet
    Execute C# via Roslyn: iterate every prefab under Assets/Prefabs, find MissingScript components, list the prefab + missing script guid.✓ Скопировано
    → Report of bad prefabs
  2. Apply the fix
    Now remove those MissingScript components and save each prefab.✓ Скопировано
    → Updated prefab count

Итог: A project free of missing-script warnings.

Подводные камни
  • Roslyn exec has full editor power — a bad snippet can corrupt the project — Commit to git before running; review the code snippet before executing
Сочетать с: github

How to triage a visual regression via screenshots

👤 QA, solo devs ⏱ ~10 min beginner

Когда использовать: A tester says 'the menu looks wrong' and you want a ground-truth image fast.

Поток
  1. Open the suspect scene
    Open scene MainMenu and take a screenshot from the UI camera at 1920x1080.✓ Скопировано
    → Screenshot file path returned
  2. Compare with a reference
    Here is the golden image [attach]. Describe the differences.✓ Скопировано
    → Specific callouts (offsets, colors, missing elements)

Итог: A bug report with image evidence attached.

Сочетать с: github

Комбинации

Сочетайте с другими MCP — эффект x10

unity-2 + github

Automate refactors + commit + PR from chat

Rename the PlayerController.Speed field to MoveSpeed everywhere, run tests, commit and open a PR.✓ Скопировано
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.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
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

Стоимость и лимиты

Во что обходится

Квота API
No remote API — all local
Токенов на вызов
Scene listings can grow large; cap with filters
Деньги
Free, open source
Совет
Prefer narrow queries (gameobject_find 'Enemy*') over full-hierarchy dumps.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: Local filesystem write to the project
Хранение учётных данных: None — localhost only
Исходящий трафик: Localhost. Your LLM provider receives whatever scene/script content the tool returns.
Никогда не давайте: Do not expose the MCP HTTP port to non-loopback interfaces

Устранение неполадок

Частые ошибки и исправления

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.

Проверить: $UNITY_EDITOR_PATH -version
csharp_execute throws 'type not found'

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

Альтернативы

Unity-MCP в сравнении

АльтернативаКогда использоватьКомпромисс
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

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills