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 分