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

mcp-unity

автор CoderGamester · CoderGamester/mcp-unity

A focused Unity MCP for scene editing, tests, and prefab work — simpler surface than the bigger alternatives.

CoderGamester/mcp-unity is a Node-based MCP plugin for Unity 6+ with ~30 well-scoped tools: scene management, GameObject manipulation, components, prefabs, materials, tests, console. Designed for Cursor, Claude Code, Codex, Windsurf.

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

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

Живое демо

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

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

Установка

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

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

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

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

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

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

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

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "unity-3": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/CoderGamester/mcp-unity"
      ],
      "_inferred": true
    }
  }
}

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

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "unity-3",
      "command": "TODO",
      "args": [
        "See README: https://github.com/CoderGamester/mcp-unity"
      ]
    }
  ]
}

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

~/.config/zed/settings.json
{
  "context_servers": {
    "unity-3": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/CoderGamester/mcp-unity"
        ]
      }
    }
  }
}

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

claude mcp add unity-3 -- TODO 'See README: https://github.com/CoderGamester/mcp-unity'

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

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

Реальные сценарии: mcp-unity

How to build a simple scene from chat with minimal ceremony

👤 Indie Unity devs ⏱ ~15 min beginner

Когда использовать: You want a Unity MCP without 100+ tools cluttering your context.

Предварительные требования
  • Unity 6 or later — unity.com/download
  • Node 18+ — nodejs.org or nvm
  • Install package from git URL — Package Manager > + > Add from git URL: https://github.com/CoderGamester/mcp-unity.git
Поток
  1. Compose a scene
    Create a new scene 'Playground'. Add a Plane, a Directional Light, and 3 cubes at positions (-2,0,0), (0,0,0), (2,0,0).✓ Скопировано
    → Scene appears, objects visible
  2. Wire up interactions
    Add a Rigidbody and BoxCollider to each cube. Make cube at origin kinematic.✓ Скопировано
    → Components visible on inspect
  3. Run tests
    run_tests mode=EditMode. Show failures.✓ Скопировано
    → Test output

Итог: A working scene + passing tests, all in chat.

Подводные камни
  • batch_execute rollback behavior varies — not a real transaction — Assume partial success on error; verify after batch
Сочетать с: github

How to author and instantiate prefabs from chat

👤 Unity devs building reusable assets ⏱ ~15 min intermediate

Когда использовать: You want the agent to maintain a prefab library.

Поток
  1. Create a prefab
    Build a GameObject 'Enemy' with Rigidbody + EnemyAI component, then create_prefab from it at Assets/Prefabs/Enemy.prefab.✓ Скопировано
    → Prefab file created
  2. Instantiate
    add_asset_to_scene Assets/Prefabs/Enemy.prefab at 5 random positions within 50 units of origin.✓ Скопировано
    → 5 enemies placed

Итог: A reusable Enemy prefab + 5 placed instances.

How to iterate on a fix with run_tests in a tight loop

👤 Unity devs with test coverage ⏱ ~15 min intermediate

Когда использовать: Bug + test exists; want fast red-green-refactor.

Поток
  1. See the failure
    run_tests mode=EditMode filter='EnemyAI_ShouldPatrol'. Show the stack.✓ Скопировано
    → Failing assertion with line
  2. Edit and retest
    Apply the minimal fix, save, and rerun the test.✓ Скопировано
    → Green test

Итог: Green test, confidence in fix.

Сочетать с: github

Комбинации

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

unity-3 + github

Run tests, then commit + PR the fix

Fix EnemyAI test failure, commit on branch fix/enemy-patrol, open a PR.✓ Скопировано

Инструменты

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

ИнструментВходные данныеКогда вызыватьСтоимость
create_scene name: str Start a new scene free
load_scene path: str Open existing scene free
get_gameobject name_or_id: str Look up one object free
update_gameobject id, props Rename, re-parent, toggle active free
update_component target, component, values Tweak component fields free
create_prefab source_id, path Capture an object as prefab free
add_asset_to_scene path, position?, rotation? Instantiate an asset/prefab free
run_tests mode: 'EditMode'|'PlayMode', filter? Unit tests free
get_console_logs since_ms? Check errors free
batch_execute calls: Call[] Compose several tool calls free

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

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

Квота API
None — local only
Токенов на вызов
Small; this MCP has a tight tool list
Деньги
Free (open source)
Совет
Batch related ops via batch_execute to reduce round trips.

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

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

Минимальные скоупы: Local project access only
Хранение учётных данных: None
Исходящий трафик: Localhost; LLM sees whatever your tool returns
Никогда не давайте: Expose the Node bridge to non-loopback

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

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

Unity 'package could not be resolved'

Requires Unity 6 or later. Check version; git URL install fails on older editors.

Node bridge crashes on startup

Requires Node 18 + npm 9. Check 'node -v' and upgrade.

Проверить: node -v
Tests don't appear

Test assemblies must be defined in Assembly Definition files referencing TestRunner.

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

mcp-unity в сравнении

АльтернативаКогда использоватьКомпромисс
MCP for Unity (CoplayDev)You want the largest Unity tool surface with physics/VFX coverageMore tools = more context cost
Unity-MCP (IvanMurzak)You need Roslyn-backed one-shot C# executionMore power, more risk

Ещё

Ресурсы

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

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

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