Godot Mcp Bridge

io.github.TomasLucasUTN由 GitHub 帳號 TomasLucasUTN 發布v1.3.0更新於 Nov 1, 2026

MCP server for Godot game engine integration — control the Godot editor with AI

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

把 AI 助理連接到執行中的 Godot 4.5+ 編輯器,可讀取、編輯並測試場景、腳本與專案設定。

可以做什麼
  • 檢視專案:列出並讀取檔案、搜尋專案、匯出場景樹、查詢 ClassDB、讀取專案設定
  • 編輯場景:建立場景,新增、刪除、重新命名、移動、複製節點與實體化場景,設定屬性與節點參照,掛載腳本,連接訊號,批次編輯
  • 處理腳本:建立與小幅修改 GDScript,列出並驗證腳本
  • 執行與除錯:啟動或停止場景,讀取執行期日誌與主控台日誌,取得錯誤與警告,擷取視埠截圖
  • 管理連線與工具集:查看狀態、診斷連線問題、尋找工具、啟用或停用選用工具集、重新掃描檔案系統、重新啟動編輯器
適用情境
適合在開發或除錯 Godot 4.5+ 遊戲專案時使用,讓助理直接在編輯器裡檢視與修改場景和 GDScript、執行遊戲並讀取錯誤,而不必複製貼上程式碼。
執行需求
以本機 stdio 程序執行,通常透過 npx 啟動 npm 套件 godot-mcp-bridge。需要 Godot 4.5+,並在專案中安裝並啟用 godot_mcp 外掛(安裝指令會複製到 addons/godot_mcp)。編輯器必須在執行且已連線;一次僅支援一個 Godot 實例,僅限本機。未宣告任何 API 金鑰或環境變數。
安裝前請注意
助理可以寫入專案:建立與修改場景和腳本、變更節點屬性,並可永久刪除檔案(delete_file 需 confirm=true,預設會產生 .bak 備份)。它也能重新啟動編輯器、啟動或停止場景。對已開啟場景的修改會走即時樹與復原系統,但對已關閉檔案的修改會直接儲存。預設只載入 core 工具集,其他工具集需明確啟用。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Godot Mcp Bridge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

godot-mcp-bridge

Give your AI assistant full access to the Godot editor.

Build games faster with Claude, Cursor, or any MCP-compatible AI — no copy-pasting, no context switching. The AI reads, writes, and manipulates your scenes, scripts, nodes, and project settings directly inside the running Godot editor.

Godot 4.5+ · 225 tools (35 loaded by default) · Live-tree editing with undo · Interactive project visualizer · MIT license

See the project README for the full tool breakdown, architecture, and setup guide. This file is the condensed version shown on npm.


Quick Start

1. Install the Godot plugin

bash
npx godot-mcp-bridge install

Run from inside your Godot project folder — copies the addon into addons/godot_mcp/ and enables the plugin. Or copy addons/godot_mcp/ from the GitHub repo by hand and enable it under Project Settings → Plugins. (The "Godot AI Assistant tools MCP" AssetLib listing belongs to the upstream project this forked from, not this repo.)

2. Add the server to your AI client

Claude Desktop / Cursor — add to the client's MCP config:

json
{  "mcpServers": {    "godot": {      "command": "npx",      "args": ["-y", "godot-mcp-bridge"]    }  }}

Windows: use "command": "cmd", "args": ["/c", "npx", "-y", "godot-mcp-bridge"].

Works with any MCP-compatible client (Claude Code, Cline, Windsurf, etc.)

3. Connect

Restart your AI client, then restart your Godot project. Check the top-right corner of the editor for MCP Connected in green.


What Can It Do?

225 tools grouped by intent; only core (35 tools) loads by default so the agent stays focused. enable_toolset({ name: "..." }) pulls in more — runtime control, scene editing, project config, animation, physics, analysis, scaffolding, testing, and more. Edits to a scene that's open in the editor go through the live tree and Godot's undo system instead of silently overwriting the .tscn file on disk.

Interactive Visualizer

Run map_project and get a browser-based project explorer at localhost:6510:

  • Force-directed graph of all scripts and their relationships
  • Click any script to see variables, functions, signals, and connections
  • Edit code directly in the visualizer — changes sync to Godot in real time
  • Scene view with node property editing
  • Find usages before refactoring

Current Limitations

  • Local only — runs on localhost, no remote connections
  • Single connection — one Godot instance at a time
  • AI has limited Godot knowledge — it can help debug, write scripts, and build scenes, but can't create a complete game without guidance

Build From Source

bash
git clone https://github.com/TomasLucasUTN/godot-mcp-bridgecd godot-mcp-bridge/mcp-servernpm installnpm run build

Then point your AI client at mcp-server/dist/index.js instead of using npx.


License

MIT


GitHub · Report Issues

來源:mcp-server/README.md,提交 f1d6f26

工具

44

get_godot_status

Check if Godot editor is connected to the MCP server.

無需輸入參數。

diagnose_connection

Diagnose why the Godot editor is (or is not) connected — the #1 setup frustration. Works even when nothing is connected (runs entirely in the MCP server). Returns a pass/fail checklist plus, when disconnected, an ordered list of concrete remedies (enable the plugin, wrong port, Godot version, the _console.exe stub, etc.). Call this first when tools report "Godot editor is not connected".

無需輸入參數。

get_guide

Read a short markdown guide from the server — the same content as the MCP resources, exposed as a tool for clients that do not support them. Call with no args to list them, or with a slug for the full markdown. Worth reading when a workflow is non-obvious: testing a running game, choosing between the scene-editing tools, "Runtime helper not connected".

輸入參數slug

find_tools

Find a tool by what you want to do, across all 231 — including the ones whose toolset is off. Ask "autotile a tilemap" or "record input" and get the matching names, a one-line summary each, and the toolset to enable. Use this when you know what you want to DO but not what it is called; list_toolsets is for browsing.

輸入參數limitquery必填include_schema

list_toolsets

List every toolset with what it is for, how many tools it holds, and whether it is enabled. Only "core" is on by default; if the tool you need is not in list_tools, find its toolset here and enable that one.

輸入參數include_tools

enable_toolset

Enable an optional toolset so its tools appear in the next list_tools call. "core" (look around, edit scenes/scripts, run the game, read errors) is always on; the rest are opt-in to keep the surface small. Use find_tools or list_toolsets to find which one holds the tool you want.

輸入參數name必填

disable_toolset

Disable a toolset so its tools stop appearing in list_tools. Does not affect tool names already known to the client.

輸入參數name必填

list_dir

List files and folders under a Godot project path (e.g., res://). Returns arrays of files and folders in the specified directory.

輸入參數root必填include_hidden

read_file

Read a text file from the Godot project, optionally a specific line range. Useful for reading GDScript files, scene files, or any text-based content.

輸入參數path必填end_linemax_bytesstart_line

search_project

Search the Godot project for a substring and return file hits with line numbers. At most max_results matches (default 50), each line cut at 200 chars, because the answer costs context. When it stops early it says `truncated: true` and reports `returned` rather than a total it never finished counting.

輸入參數globquery必填max_resultscase_sensitiveinclude_addons

scene_tree_dump

Dump the scene tree of the scene currently open in the Godot editor (node names, types, and attached scripts). Pass max_depth to keep the output small on large scenes — a depth-limited branch reports its descendant count instead of expanding. Start shallow (max_depth 1-2) for an overview, then drill in.

輸入參數max_depth

read_scene

Read and parse a scene file to get its node structure (and optionally properties). Use this to understand a scene before editing. On large scenes pass max_depth for a cheap shallow read — a depth-limited node reports children_truncated instead of expanding.

輸入參數formatmax_depthmax_nodesnode_pathpropertiesscene_path必填child_offsetinclude_properties

classdb_query

Query Godot's ClassDB for class information: properties, methods, signals, and inheritance. Use this to verify that a class, method, or property actually exists in the running Godot engine before writing code. Prevents using wrong method names, outdated Godot 3 API, or incorrect signatures.

輸入參數queryfilterclass_name必填include_virtual

get_project_settings

Concise project settings summary: main_scene, window size/stretch, physics tick rate, and render basics.

輸入參數include_renderinclude_physics

create_scene

Create a new Godot scene (.tscn) file with nodes. Use this to create player scenes, UI screens, game objects, etc.

輸入參數nodesdry_runscene_path必填attach_scriptroot_node_nameroot_node_type必填

add_node

Add a node to an existing scene file, optionally with a script, groups, and a whole sub-tree of children in the same call. Children take the same keys as add_node itself ({name|node_name, type|node_type, properties?, script?, groups?, children?}); an unknown key is an error.

輸入參數groupsscriptdry_runchildrennode_name必填node_type必填propertiesscene_path必填parent_path

remove_node

Remove a node from an existing scene file.

輸入參數dry_runnode_path必填scene_path必填

set_node_properties

Set properties on ONE node — one or many, in a single call and a single save. For the same property across many nodes use batch_set_property. Non-atomic: each property is applied independently and the response separates "applied" from "failed", so partial success is visible. Never edit a .tscn as text. To set a script use attach_script, NOT a "script" property here: that only rewrites the file, leaving the editor's in-memory node scriptless, which makes connect_signal fail. Resource-typed properties need set_resource_property / set_sprite_texture / etc.

輸入參數dry_runnode_pathproperties必填scene_path必填

set_node_reference

Point an exported property at another NODE in the same scene — the wiring you would otherwise do by dragging a node into an inspector slot. Use for any @export typed as a node (`@export var target: Area2D`, `@export var health: HealthComponent`) or as a NodePath. set_node_properties CANNOT do this: it takes a JSON value, and this needs a live object reference. Fails loudly if the property does not exist or is typed for a different node class, instead of silently doing nothing.

輸入參數dry_runproperty必填node_path必填scene_path必填target_path必填

rename_node

Rename a node in a scene.

輸入參數dry_runnew_name必填node_path必填scene_path必填

move_node

Move a node to a different parent in a scene and optionally control its position among siblings.

輸入參數dry_runnode_path必填scene_path必填sibling_indexnew_parent_path必填

duplicate_node

Duplicate a node and its children within the same scene, inserted right after the original as a sibling.

輸入參數dry_runnew_namenode_path必填scene_path必填

instance_scene

Add an instance of another scene (.tscn) as a child node. This is how you compose scenes from reusable parts (like prefabs). The instance maintains a live reference to the source scene. Use this instead of add_node when you want to reuse an existing scene.

輸入參數dry_runnode_namepropertiesscene_path必填parent_pathinstance_path必填

attach_script

Attach or change a script on a node in a scene.

輸入參數dry_runnode_pathscene_path必填script_path必填

connect_signal

Connect a signal between two nodes inside a .tscn scene file. The target script must define the method (will refuse otherwise). Equivalent to clicking the "+" in the editor's Node > Signals panel and persists the connection to the .tscn. NOTE: scripts must be attached via attach_script (NOT via modify_node_property), otherwise the editor's in-memory node will not see the script and this tool will reject the connection.

輸入參數flagsmethod必填signal必填dry_runto_node必填from_node必填scene_path必填

batch_scene_edit

Apply many structural/property edits to ONE scene with a single load and a single save — much faster than N separate add_node/set_node_properties/... calls on a closed scene (each of those re-loads and re-saves the whole .tscn). For an open scene the whole batch lands on the live editor tree and marks it dirty (no disk write). Ops run in order; stop_on_error (default true) discards the entire batch — nothing saved — on the first failure. Op types: add_node {node_name,node_type,parent_path,properties?,script?,groups?,children?}, set_properties {node_path,properties}, remove_node {node_path}, rename_node {node_path,new_name}, move_node {node_path,new_parent_path,sibling_index?}.

輸入參數dry_runoperations必填scene_path必填stop_on_error

create_script

Create a NEW GDScript file (.gd) that does not exist yet. Use this for creating new scripts, NOT for editing existing files (use edit_script for edits). Use classdb_query to verify unfamiliar Godot class methods. After creating a script, consider using run_scene to test and get_errors to check for issues.

輸入參數path必填content必填dry_run

edit_script

Apply a SMALL, SURGICAL code edit (1-10 lines) to GDScript files. Auto-applies changes. For large changes, call multiple times. ONLY for .gd files - NEVER for .tscn scene files. Use classdb_query to verify unfamiliar Godot class methods. After making changes, consider using run_scene to test and get_errors to check for issues.

輸入參數edit必填dry_run

list_scripts

List all GDScript files in the project with basic metadata.

無需輸入參數。

validate_scripts

Validate many GDScript files at once. Pass "paths" (array of res:// .gd paths) to check a specific set, or omit it to sweep the project (addons/ excluded unless include_addons). Returns only the invalid scripts, each with a message you can act on, plus elapsed_ms. PREFER an explicit paths list: validation runs on the editor's main thread at roughly 34ms per script, so a whole-project sweep on a large codebase is slow and can approach the bridge's 20s watchdog.

輸入參數pathsinclude_addons

delete_file

Permanently delete a file from the project. REQUIRES confirm=true as an explicit safety gate — omitting confirm returns an error. Creates a .bak backup alongside the original by default (disable with create_backup=false). REFUSES if the file is currently open in the editor (any scene tab or script editor tab); close the tab first, or pass force=true to bypass the check (not recommended — deleting the active scene out from under the editor can crash Godot). Use ONLY when deletion is explicitly requested; NEVER as a way to "edit" or "reset" a file (use edit_script instead). Does not delete directories.

輸入參數path必填forceconfirm必填dry_runcreate_backup

run_scene

Launch a scene in the Godot editor. Blocks until the editor is playing, so the next get_errors / take_screenshot call sees a real game. Use the returned runtime_root (e.g. "/root/Main") as the prefix for query_runtime_node paths — it comes from the root node name in the .tscn, NOT the file name. wait_for_runtime=true also waits for the in-game MCPRuntime helper, which take_screenshot and send_input need. Full loop: get_guide("testing-loop").

輸入參數sceneattach_debuggerdebug_collisionswait_for_runtimestartup_timeout_msblock_until_started

stop_scene

Stop the currently running scene in the Godot editor. Always stop the scene before editing code to avoid errors repeating every frame.

無需輸入參數。

is_playing

Compatibility shim: returns {playing, scene}. For richer info (uptime, runtime helper connectivity, last-launched target) prefer get_runtime_status.

無需輸入參數。

get_runtime_log

Return entries from the MCPRuntime in-game ring buffer. The buffer holds the last ~500 lines pushed via MCPRuntime.push_runtime_log(level, text) from your scripts plus internal connection events. For full engine stdout (script prints, errors, warnings) use get_console_log — the editor already captures the running game's stdout. Returns entries with ts_ms, level, and text plus started_at_ms (when the helper started) and now_ms.

輸入參數levellimitsince_ms

take_screenshot

Capture the current viewport of the running game and save it as a PNG. REQUIRES the game to be running with the MCPRuntime autoload connected (run_scene with wait_for_runtime=true first). Returns resource_path, absolute_path, width, height, and (optionally) base64_png. Default save location is res://addons/godot_mcp/cache/screenshots/.

輸入參數save_toreturn_base64

get_errors

Get errors and warnings from both the Godot Output panel and the Debugger > Errors tab. Returns file paths, line numbers, severity, stack traces, and which source each error came from. If errors mention a missing method or property, use classdb_query to verify the correct API before fixing.

輸入參數max_errorsinclude_warnings

get_console_log

Return the latest lines from the Godot editor output log (as a single "content" string). Pass filter to keep only lines containing a substring — cheaper than pulling the whole log to find one message.

輸入參數filtermax_lines

rescan_filesystem

Trigger a full filesystem rescan in the Godot editor. Use after creating, deleting, or modifying files externally (e.g. from the terminal or another tool). The scan is asynchronous and returns immediately. NOT enough for a new autoload or a new class_name — those need restart_editor.

無需輸入參數。

restart_editor

Restart the Godot editor. Needed for two things a rescan cannot fix: an AUTOLOAD added this session, and a brand-new class_name. Until the editor restarts, every script referencing them fails to compile — and a node whose script failed to compile loses its exported properties, so create_scene/add_node write defaults and still report ok. Symptom: you set a property, the call succeeds, and the value is wrong when you read it back. The bridge disconnects with the editor; poll get_godot_status until it reconnects (usually 20-40s).

輸入參數save

render_scene_preview

Render a 2D scene to a PNG WITHOUT running the game — the cheap way to actually look at a scene. take_screenshot needs a live game (launch, runtime connection, remembering to stop it); this renders offscreen in the editor, auto-framing the scene's content, and leaves no editor state changed. Use it to check layout, sprite placement, and whether a level looks like you think it does. 2D only.

輸入參數widthheightsave_toscene_path必填transparentshow_collision

batch_execute

Run a sequence of {tool, args} calls in ONE request instead of N round-trips — the way to build several scenes at once (batch_scene_edit covers only one). Dispatches inside the EDITOR, so it cannot reach tools that live in the running game (take_screenshot, send_input, query_runtime_node, game_eval, ...); call those directly. NOT a transaction: each scene tool still does its own load/save. stop_on_error halts at the first failure. Cannot be nested.

輸入參數operations必填stop_on_error

find_nodes_by_type

Recursively find all nodes of a given class (or subclass, unless exact_match) in a scene. Returns node_path/node_name/node_type for each match.

輸入參數node_type必填scene_path必填exact_match

get_scene_dependencies

List a scene's resource dependencies (instanced sub-scenes, scripts, external resources) via ResourceLoader.get_dependencies — reads the file's dependency table directly, no need to load the scene.

輸入參數scene_path必填

版本歷史

2
  1. v1.3.0最新Nov 1, 2026
  2. v1.2.1Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分