Unity MCP Server

  • Linux
  • Apple

Integrations

  • Supports containerized deployment of the MCP server, allowing the Unity tools to be run in an isolated environment with proper project mounting.

  • Offers integration through the repository hosting, with the server code available at a GitHub repository (unity-smithery-mcp).

  • Built on Node.js as a runtime environment, requiring Node.js 16+ to operate.

Unity MCP サーバー

Unity ゲーム開発用のモデルコンテキストプロトコル (MCP) サーバー。AI アシスタントが一連の専用ツールを通じて Unity プロジェクトと対話できるようになります。

概要

Unity MCPサーバーは、AIアシスタント(Cursor AIやClaudeなど)とUnityプロジェクト間の橋渡し機能を提供します。以下のツールを提供します。

  • Unity プロジェクトでのファイルの読み取りと検索
  • Unityシーンとプレハブの解析
  • C#コードの解析とエラーの検出
  • バッチモードでの自動テストの実行
  • テンプレートからスクリプトを生成する
  • シェーダーの検証
  • さらに…

サーバーは Unity でバッチ モードで実行するように設計されており、エディター GUI を必要とせずに Unity エンジンを必要とする操作を可能にします。

インストール

前提条件

  • Node.js 16以上
  • Unity 2022.3 LTS 以降(推奨)

設定

  1. このリポジトリをクローンします:
    git clone https://github.com/GrandMasterK414/unity-smithery-mcp.git cd unity-smithery-mcp
  2. 依存関係をインストールします:
    npm install
  3. プロジェクトをビルドします。
    npm run build

構成

サーバーは設定にconfigパッケージを使用します。設定を調整するには、 config/default.jsonを編集してください。

{ "server": { "port": 3000, "host": "0.0.0.0" }, "unity": { "unityPath": "/path/to/Unity/Editor/Unity", "projectPath": "/path/to/your/unity/project", "timeoutMs": 60000, "batchMode": true }, "logging": { "level": "info", "file": "logs/mcp-server.log", "maxSize": 5242880, "maxFiles": 5 }, "security": { "allowedPaths": ["Assets", "ProjectSettings", "Packages"], "disallowedCommands": ["rm", "del", "format", "shutdown"] } }

使用法

サーバーの起動

npm start

Smithery モードで実行するには:

npm run smithery:start

AIアシスタントと併用する

このサーバーは、MCP仕様で定義されたツールを介してAIアシスタントと連携するために主に設計されています。CursorまたはSmithery.aiとの統合については、それぞれのドキュメントに従ってこのMCPサーバーに接続してください。

利用可能なツール

ツール名説明
open_fileUnityプロジェクト内のファイルの内容を読み取ります
search_filesプロジェクトファイル内のテキストパターンを検索します
list_assets特定のタイプまたはフォルダ内のプロジェクトアセットを一覧表示します
get_project_infoUnityプロジェクトに関する高レベルの情報を取得します
parse_sceneUnityシーンファイルを解析してゲームオブジェクトの階層を抽出します
parse_prefabUnityプレハブファイルを解析してコンポーネントを抽出します
find_in_scenes特定のゲームオブジェクトまたはコンポーネントを含むシーンを検索します
analyze_cs_codeC# コードをコンパイルしてコンパイラエラーを検出します
find_referencesC#クラスまたはメソッドへの参照を検索します
generate_scriptテンプレートから新しい C# スクリプト ファイルを作成します
validate_shaderシェーダをコンパイルし、エラーを報告します
inspect_yamlYAMLアセットファイルを検査する
run_testsUnityの自動テストをバッチモードで実行します
simulate_playmode実験的 - 短時間、再生モードでシーンを実行します

Docker サポート

コンテナ化されたデプロイメント用のDockerfileが含まれています。Dockerイメージをビルドします。

docker build -t unity-mcp-server .

コンテナを実行します。

docker run -p 3000:3000 -v /path/to/unity/project:/project unity-mcp-server

Smithery.ai 統合

このサーバーは、提供されているsmithery.yaml構成を使用して Smithery.ai にデプロイできます。

ライセンス

マサチューセッツ工科大学

貢献

貢献を歓迎します!問題を報告したり、プルリクエストを送信してください。

-
security - not tested
F
license - not found
-
quality - not tested

AI アシスタントと Unity プロジェクトを橋渡しするプロトコル サーバー。専用のツールを使用してコードの分析、シーンの解析、スクリプトの生成、その他の Unity 操作を実行できます。

  1. Overview
    1. Installation
      1. Prerequisites
      2. Setup
    2. Configuration
      1. Usage
        1. Starting the Server
        2. Using with AI Assistants
      2. Available Tools
        1. Docker Support
          1. Smithery.ai Integration
            1. License
              1. Contributing

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server that connects Claude and other AI assistants to your Notion workspace, allowing AIs to interact with databases, pages, and blocks.
                  Last updated -
                  12
                  64
                  7
                  JavaScript
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
                  Last updated -
                  1
                  Python
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Unity Master Control Protocol implementation that allows AI agents to control and interact with Unity, enabling them to execute code, query editor state, modify GameObjects, and capture screenshots through a WebSocket-based communication system.
                  Last updated -
                  7
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A server that enables AI assistants to understand and interact with Unity projects in real-time, providing access to scene hierarchy, project settings, and the ability to execute code directly in the Unity Editor.
                  Last updated -
                  40
                  MIT License
                  • Linux
                  • Apple

                View all related MCP servers

                ID: hy8ma6m3wa