Godot MCP

by Coding-Solo
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows AI assistants to launch the Godot editor, run projects, capture debug output, control project execution, analyze project structure, manage scenes and nodes, work with sprites and textures, export 3D scenes as MeshLibrary resources, and handle UID management for Godot 4.4+.

  • Integrates with Node.js to run the MCP server, providing the execution environment for the Godot MCP functionality.

  • Uses TypeScript for developing the MCP server, enabling type-safe programming and better code organization for the Godot integration.

ゴドーMCP

((((((( ((((((( ((((((((((( ((((((((((( ((((((((((((( ((((((((((((( ((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((( ((((( ((((((((((((((((((((((((((((((((((((((((( ((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( (((((((((((@@@@@@@(((((((((((((((((((((((((((@@@@@@@((((((((((( (((((((((@@@@,,,,,@@@(((((((((((((((((((((@@@,,,,,@@@@((((((((( ((((((((@@@,,,,,,,,,@@(((((((@@@@@(((((((@@,,,,,,,,,@@@(((((((( ((((((((@@@,,,,,,,,,@@(((((((@@@@@(((((((@@,,,,,,,,,@@@(((((((( (((((((((@@@,,,,,,,@@((((((((@@@@@((((((((@@,,,,,,,@@@((((((((( ((((((((((((@@@@@@(((((((((((@@@@@(((((((((((@@@@@@(((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( @@@@@@@@@@@@@((((((((((((@@@@@@@@@@@@@((((((((((((@@@@@@@@@@@@@ ((((((((( @@@(((((((((((@@(((((((((((@@(((((((((((@@@ ((((((((( (((((((((( @@((((((((((@@@(((((((((((@@@((((((((((@@ (((((((((( (((((((((((@@@@@@@@@@@@@@(((((((((((@@@@@@@@@@@@@@((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((((((((((((((((( ((((((((((((((((((((((((((((((((( /$$ /$$ /$$$$$$ /$$$$$$$ | $$$ /$$$ /$$__ $$| $$__ $$ | $$$$ /$$$$| $$ \__/| $$ \ $$ | $$ $$/$$ $$| $$ | $$$$$$$/ | $$ $$$| $$| $$ | $$____/ | $$\ $ | $$| $$ $$| $$ | $$ \/ | $$| $$$$$$/| $$ |__/ |__/ \______/ |__/

Godot ゲーム エンジンと対話するためのモデル コンテキスト プロトコル (MCP) サーバー。

導入

Godot MCP を使用すると、AI アシスタントは標準化されたインターフェースを介して、Godot エディタを起動し、プロジェクトを実行し、デバッグ出力をキャプチャし、プロジェクト実行を制御できるようになります。

この直接的なフィードバック ループにより、Claude のような AI アシスタントは実際の Godot プロジェクトで何が機能し、何が機能しないかを理解できるようになり、コード生成とデバッグの支援が向上します。

特徴

  • Godotエディタを起動: 特定のプロジェクトのGodotエディタを開きます
  • Godot プロジェクトの実行: デバッグモードで Godot プロジェクトを実行する
  • デバッグ出力のキャプチャ: コンソール出力とエラーメッセージを取得します
  • 実行制御: Godot プロジェクトをプログラムで開始および停止する
  • Godotバージョンの取得: インストールされているGodotのバージョンを取得します
  • Godot プロジェクトの一覧表示: 指定したディレクトリ内の Godot プロジェクトを検索します
  • プロジェクト分析: プロジェクト構造に関する詳細情報を取得します
  • シーンマネジメント
    • 指定されたルートノードタイプで新しいシーンを作成する
    • カスタマイズ可能なプロパティを持つ既存のシーンにノードを追加する
    • スプライトとテクスチャをSprite2Dノードにロードする
    • 3DシーンをGridMapのMeshLibraryリソースとしてエクスポートする
    • バリエーションを作成するためのオプションを使用してシーンを保存する
  • UID 管理(Godot 4.4 以降):
    • 特定のファイルのUIDを取得する
    • リソースを再保存してUID参照を更新する

要件

  • Godot エンジンがシステムにインストールされています
  • Node.jsとnpm
  • MCP(Cline、Cursorなど)に対応したAIアシスタント

インストールと設定

ステップ1: インストールとビルド

まず、リポジトリのクローンを作成し、MCP サーバーを構築します。

git clone https://github.com/Coding-Solo/godot-mcp.git cd godot-mcp npm install npm run build

ステップ2: AIアシスタントを設定する

オプションA: Clineで構成する

Cline MCP 設定ファイル ( ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json ) に追加します。

{ "mcpServers": { "godot": { "command": "node", "args": ["/absolute/path/to/godot-mcp/build/index.js"], "env": { "DEBUG": "true" // Optional: Enable detailed logging }, "disabled": false, "autoApprove": [ "launch_editor", "run_project", "get_debug_output", "stop_project", "get_godot_version", "list_projects", "get_project_info", "create_scene", "add_node", "load_sprite", "export_mesh_library", "save_scene", "get_uid", "update_project_uids" ] } } }

オプションB: カーソルで設定する

カーソル UI の使用:

  1. カーソル設定>機能> MCPに移動します
  2. **「+新しいMCPサーバーを追加」**ボタンをクリックします。
  3. フォームに記入してください:
    • 名前: godot (または任意の名前)
    • タイプ: command
    • コマンド: node /absolute/path/to/godot-mcp/build/index.js
  4. 「追加」をクリック
  5. ツールリストを表示するには、MCPサーバーカードの右上隅にある更新ボタンを押す必要がある場合があります。

プロジェクト固有の構成の使用:

プロジェクト ディレクトリの.cursor/mcp.jsonに次の内容のファイルを作成します。

{ "mcpServers": { "godot": { "command": "node", "args": ["/absolute/path/to/godot-mcp/build/index.js"], "env": { "DEBUG": "true" // Enable detailed logging } } } }

ステップ3: オプションの環境変数

次の環境変数を使用してサーバーの動作をカスタマイズできます。

  • GODOT_PATH : Godot 実行ファイルへのパス (自動検出をオーバーライド)
  • DEBUG : 詳細なサーバー側デバッグログを有効にするには、「true」に設定します

プロンプトの例

設定が完了すると、AIアシスタントは必要に応じてMCPサーバーを自動的に実行します。次のようなプロンプトを使用できます。

"Launch the Godot editor for my project at /path/to/project" "Run my Godot project and show me any errors" "Get information about my Godot project structure" "Analyze my Godot project structure and suggest improvements" "Help me debug this error in my Godot project: [paste error]" "Write a GDScript for a character controller with double jump and wall sliding" "Create a new scene with a Player node in my Godot project" "Add a Sprite2D node to my player scene and load the character texture" "Export my 3D models as a MeshLibrary for use with GridMap" "Create a UI scene with buttons and labels for my game's main menu" "Get the UID for a specific script file in my Godot 4.4 project" "Update UID references in my Godot project after upgrading to 4.4"

実装の詳細

建築

Godot MCP サーバーは、複雑な操作のためにバンドルされた GDScript アプローチを使用します。

  1. 直接コマンド: エディターの起動やプロジェクト情報の取得などの単純な操作では、Godot の組み込み CLI コマンドを直接使用します。
  2. バンドルされた操作スクリプト: シーンの作成やノードの追加などの複雑な操作では、すべての操作を処理する単一の包括的な GDScript ファイル ( godot_operations.gd ) が使用されます。

このアーキテクチャにはいくつかの利点があります。

  • 一時ファイルなし: 一時スクリプトファイルが不要になり、システムをクリーンな状態に保ちます。
  • 簡素化されたコードベース: Godot のすべての操作を 1 つの (ある程度) 整理されたファイルに集約します。
  • 保守性の向上: 新しい操作の追加や既存の操作の変更が容易になります
  • エラー処理の改善: すべての操作で一貫したエラーレポートを提供します
  • オーバーヘッドの削減: ファイルI/O操作を最小限に抑えてパフォーマンスを向上

バンドルされたスクリプトは、操作タイプとパラメータを JSON として受け入れるため、操作ごとに一時ファイルを生成せずに柔軟かつ動的な操作実行が可能になります。

トラブルシューティング

  • Godotが見つかりません: GODOT_PATH環境変数をGodot実行可能ファイルに設定します
  • 接続の問題: サーバーが実行中であることを確認し、AIアシスタントを再起動してください
  • 無効なプロジェクトパス: パスが project.godot ファイルを含むディレクトリを指していることを確認してください
  • ビルドの問題: npm installを実行して、すべての依存関係がインストールされていることを確認してください。
  • カーソルの場合:
  • カーソル設定(設定 > MCP)でMCPサーバーが表示され、有効になっていることを確認します。
  • MCP ツールは、エージェント チャット プロファイル (Cursor Pro または Business サブスクリプション) を使用してのみ実行できます。
  • 「Yoloモード」を使用してMCPツールリクエストを自動的に実行する

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

-
security - not tested
A
license - permissive license
-
quality - not tested

AI アシスタントが Godot ゲーム エンジンと対話して、エディターを起動したり、プロジェクトを実行したり、デバッグ出力をキャプチャしたり、プロジェクトの実行を制御できるようにするモデル コンテキスト プロトコル サーバー。

  1. Introduction
    1. Features
      1. Requirements
        1. Installation and Configuration
          1. Step 1: Install and Build
          2. Step 2: Configure with Your AI Assistant
          3. Step 3: Optional Environment Variables
        2. Example Prompts
          1. Implementation Details
            1. Architecture
          2. Troubleshooting
            1. License
              ID: k4sr36xmq5