godot-mcp-bridge
v1.3.0MCP server for Godot game engine integration — control the Godot editor with AI
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
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".
| Parameter | Type | Description |
|---|---|---|
slug | string | Guide to read. Omit to list them. |
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.
| Parameter | Type | Description |
|---|---|---|
query * | string | What you are trying to do in English or Spanish (e.g. "bake a navmesh", "read the player position while the game runs"). |
include_schema | boolean | Also return each match's full inputSchema. Default false — the names and summaries are usually enough to pick one. |
limit | number | How many matches to return (1-40, default 8). |
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.
| Parameter | Type | Description |
|---|---|---|
include_tools | boolean | Also list every tool name in each toolset. Off by default: that is ~2,000 tokens, and find_tools answers "what is this called" for a quarter of it. |
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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Toolset to enable, or "all". |
disable_toolset
Disable a toolset so its tools stop appearing in list_tools. Does not affect tool names already known to the client.
| Parameter | Type | Description |
|---|---|---|
name * | string | Toolset to disable, or "all". |
list_dir
List files and folders under a Godot project path (e.g., res://). Returns arrays of files and folders in the specified directory.
| Parameter | Type | Description |
|---|---|---|
root * | string | Starting path like res://addons/ai_assistant or res:// |
include_hidden | boolean | Include dot-entries. Default false. Supported by the handler all along; it was missing from this schema, so the unknown-argument guard rejected anyone who passed it. |
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.
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path to the file (e.g., res://scripts/player.gd) |
end_line | number | Inclusive end line; 0 or missing means to end of file (optional) |
max_bytes | number | Stop after this many bytes. Use it on a large file rather than pulling the whole thing into context. Supported by the handler all along; it was missing from this schema. |
start_line | number | 1-based inclusive start line (optional) |
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.
| Parameter | Type | Description |
|---|---|---|
query * | string | Case-insensitive substring to find |
case_sensitive | boolean | Match case exactly. Default false. |
glob | string | Optional glob filter like **/*.gd to search only GDScript files |
include_addons | boolean | Search res://addons/ too. Default false: third-party addon source answers almost every common identifier and crowds out the project own code. |
max_results | number | Stop after this many matches (default 50). The handler has always supported it; it was missing from this schema, so the unknown-argument guard rejected anyone who tried. |
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.
| Parameter | Type | Description |
|---|---|---|
max_depth | number | Max tree depth to expand (root is 0). Omit or -1 for the full tree. Use 1-2 for a cheap overview of a big scene. |
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.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the scene file (res://path/to/scene.tscn) |
child_offset | integer | Skip direct children of the requested node_path. Use next_child_offset from a budget-limited response to page wide branches; inspect nested children_truncated branches separately. |
format | string | compact returns root_name, columns and rows instead of nested dictionaries. Same node paths, types, properties, instance/script links and truncation markers with less repeated JSON. Default tree is un… |
include_properties | boolean | Include a fixed set of common properties (position, rotation, scale, size, visible, modulate, z_index, text, collision layers, mass) on every node. All-or-nothing and expensive on a big tree — prefe… |
max_depth | number | Max tree depth to expand (root is 0). Omit or -1 for the full tree. Use 1-2 for a cheap overview of a big scene. |
max_nodes | integer | Maximum nodes returned (default 500). Response reports truncation explicitly. Read node_path branches to inspect a larger scene without flooding context. |
node_path | string | Read this branch instead of the whole scene, e.g. "Player" or "UI/HUD". Default "." (the scene root). max_depth cuts a big scene off at the top; this starts lower, which is usually the actual question… |
properties | array | Return exactly these properties on every node, e.g. ["position"] to get the whole layout of a 2D scene in one call. Overrides include_properties. A name the node does not have is reported under missin… |
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.
| Parameter | Type | Description |
|---|---|---|
class_name * | string | Godot class name to query (e.g., "CharacterBody2D", "Sprite2D", "Control") |
filter | string | Case-insensitive substring: only members whose name contains it are returned. Use when checking for a specific method/property (e.g. "velocity") on a big class — cuts the output massively. |
include_virtual | boolean | Include well-known virtual methods like _ready, _process, _input (default: true). Set to false to see only public non-virtual methods. |
query | string | What to return: "all" (default), "properties", "methods", or "signals" |
get_project_settings
Concise project settings summary: main_scene, window size/stretch, physics tick rate, and render basics.
| Parameter | Type | Description |
|---|---|---|
include_physics | boolean | Include physics settings |
include_render | boolean | Include render settings |
create_scene
Create a new Godot scene (.tscn) file with nodes. Use this to create player scenes, UI screens, game objects, etc.
| Parameter | Type | Description |
|---|---|---|
root_node_type * | string | Type of root node (e.g., Node2D, CharacterBody2D, Control, Node3D). REQUIRED. |
scene_path * | string | Scene file path (e.g., res://Scenes/player.tscn) |
attach_script | string | Optional script path to attach to root node (res://path/to/script.gd) |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
nodes | array | Child nodes to add: {name|node_name, type|node_type, properties?, script?, groups?, children?}. Both key styles work; an unknown key is an error, not a generic Node. |
root_node_name | string | Name of root node (default: derived from filename) |
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.
| Parameter | Type | Description |
|---|---|---|
node_name * | string | Name for the new node |
node_type * | string | Type of node (e.g., Sprite2D, Camera2D, RigidBody2D, CollisionShape2D) |
scene_path * | string | Path to the scene file (res://path/to/scene.tscn) |
children | array | Sub-tree to create in the same call. Each entry takes add_node's own args, minus parent_path. |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
groups | array | Optional list of node groups this node should belong to. Persisted to the .tscn file. |
parent_path | string | Path to parent node (. for root, or relative path like Sprite2D) |
properties | object | Optional dictionary of properties to set on the node |
script | string | Optional script path to attach to the new node (res://path/to/script.gd) |
remove_node
Remove a node from an existing scene file.
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Path to the node to remove (cannot be root, use relative path) |
scene_path * | string | Path to the scene file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
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.
| Parameter | Type | Description |
|---|---|---|
properties * | object | Map of property_name -> value. Each value follows the same form as modify_node_property.value (primitives, arrays, or {type:"Vector3",...} discriminated objects). |
scene_path * | string | Path to the .tscn scene file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
node_path | string | Path to the node (. for root, or relative 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.
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Node that HOLDS the property (. for root, or a relative path) |
property * | string | Name of the exported property to set, e.g. "initial_state" or "health" |
scene_path * | string | Path to the .tscn scene file |
target_path * | string | Node it should point AT, relative to the scene root, e.g. "StateMachine/Idle" |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
rename_node
Rename a node in a scene.
| Parameter | Type | Description |
|---|---|---|
new_name * | string | New name for the node |
node_path * | string | Path to the node to rename |
scene_path * | string | Path to the scene file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
move_node
Move a node to a different parent in a scene and optionally control its position among siblings.
| Parameter | Type | Description |
|---|---|---|
new_parent_path * | string | Path to the new parent node (. for root) |
node_path * | string | Path to the node to move |
scene_path * | string | Path to the scene file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
sibling_index | number | Optional position among siblings (0 = first child). Omit or -1 to append. |
duplicate_node
Duplicate a node and its children within the same scene, inserted right after the original as a sibling.
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Path to the node to duplicate (cannot be root) |
scene_path * | string | Path to the scene file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
new_name | string | Optional name for the duplicate. Defaults to the original name with an incrementing number suffix. |
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.
| Parameter | Type | Description |
|---|---|---|
instance_path * | string | Path to the .tscn scene to instance (the child/prefab scene) |
scene_path * | string | Path to the scene file being edited (the parent scene) |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
node_name | string | Optional name for the instance. If omitted, uses the instanced scene's root node name. |
parent_path | string | Path to parent node within the scene (. for root, or relative path like Level/Enemies) |
properties | object | Optional property overrides on the instance root (e.g., {position: {type: "Vector3", x: 5, y: 0, z: 10}}) |
attach_script
Attach or change a script on a node in a scene.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the scene file |
script_path * | string | Path to the script file (res://path/to/script.gd) |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
node_path | string | Path to the node (. for root, or relative 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.
| Parameter | Type | Description |
|---|---|---|
from_node * | string | Path to the emitting node |
method * | string | Method name on the receiving node's script |
scene_path * | string | |
signal * | string | Signal name on the emitting node |
to_node * | string | Path to the receiving node |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
flags | number | Connection flags (CONNECT_DEFERRED=1, CONNECT_PERSIST=2, CONNECT_ONE_SHOT=4). Default 0. |
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_pat…
| Parameter | Type | Description |
|---|---|---|
operations * | array | Ordered edits. Each is an object with an "op" field and that op's args. |
scene_path * | string | Path to the .tscn file |
dry_run | boolean | Preview only: do the work, report it, write nothing. Default false. |
stop_on_error | boolean | Discard the whole batch (save nothing) on the first failing op. Default true. |
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.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full GDScript content to write to the file |
path * | string | Script file path (res://scripts/player.gd) - must not exist yet |
dry_run | boolean | Preview only: checks the path and whether the file exists, writes nothing. Default false. |
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.
| Parameter | Type | Description |
|---|---|---|
edit * | object | Edit spec: {type: "snippet_replace", file: "res://path.gd", old_snippet: "old code", new_snippet: "new code", context_before: "line above", context_after: "line below"}. Keep old_snippet SMALL (1-10 l… |
dry_run | boolean | Preview only: reports whether the snippet matched and what it would produce, writes nothing. Default false. |
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.
| Parameter | Type | Description |
|---|---|---|
include_addons | boolean | Include res://addons/ in a whole-project sweep. Default false: plugin code is usually most of the files and is not yours to fix. |
paths | array | res:// .gd paths to validate. Omit to sweep the project — but pass the files you changed instead when you know them. |
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 d…
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean | Must be true — the safety gate described above. |
path * | string | Path to the file to delete (e.g. res://scenes/old.tscn) |
create_backup | boolean | If true (default), saves a .bak copy next to the original before deletion so the file can be recovered. Set false to delete without backup. |
dry_run | boolean | Preview without deleting. Default false. Needs no confirm — it changes nothing. |
force | boolean | Bypass the "open in editor" guard. Only when you know it is not the active scene. |
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").
| Parameter | Type | Description |
|---|---|---|
attach_debugger | boolean | Default true (the editor's Play). False runs the game as its own process with no debugger: a game_eval runtime error then answers as a result instead of halting the game, at the cost of debug_* steppi… |
block_until_started | boolean | Wait until the editor reports playing=true before returning (default: true). Up to startup_timeout_ms. |
debug_collisions | boolean | Draw CollisionShape2D/3D outlines for this run, so take_screenshot shows them. Only takes effect on the run it is passed to — flipping it mid-session is unreliable. Default: false. |
scene | string | Scene to run: omit for main scene, "current" for the currently open scene, or a res:// path for a specific scene |
startup_timeout_ms | number | A cap, not an expected wait — MCPRuntime connects in ~1.7s. Default 20000. If wait_for_runtime reports false, poll get_runtime_status; it is usually about to land. |
wait_for_runtime | boolean | Wait until the MCPRuntime in-game helper connects back (required for take_screenshot/send_input). Default: false. |
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.
| Parameter | Type | Description |
|---|---|---|
level | string | Only return entries of this level (e.g. "error", "warning", "info"). Omit for all. |
limit | number | Maximum entries to return (default: 200, max 500) |
since_ms | number | Only return entries with ts_ms >= since_ms. Use 0 (default) for all. |
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/.
| Parameter | Type | Description |
|---|---|---|
return_base64 | boolean | Also include the PNG bytes inline as base64 (default: false). Useful when the agent has no filesystem access. |
save_to | string | Optional res:// or user:// destination path. Defaults to res://addons/godot_mcp/cache/screenshots/screenshot_<ms>.png |
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.
| Parameter | Type | Description |
|---|---|---|
include_warnings | boolean | Include warnings in addition to errors (default: true) |
max_errors | number | Maximum number of errors to return (default: 50) |
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.
| Parameter | Type | Description |
|---|---|---|
filter | string | Case-insensitive substring: only matching log lines are returned. |
max_lines | number | Maximum number of lines to include (default: 50) |
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).
| Parameter | Type | Description |
|---|---|---|
save | boolean | Save all open scenes and project settings before restarting. Default true. Setting false discards unsaved editor work. |
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.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Scene to render (res://path/to/scene.tscn) |
height | number | Output height in pixels. Default 648. |
save_to | string | Where to write the PNG. Defaults to res://addons/godot_mcp/cache/previews/<scene>.png |
show_collision | boolean | Draw CollisionShape2D/CollisionPolygon2D outlines (same visual as Godot's Debug > Visible Collision Shapes), so hitboxes can be checked from the PNG directly. Default false. |
transparent | boolean | Transparent background instead of the scene's own. Default false. |
width | number | Output width in pixels. Default 1152. |
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.
| Parameter | Type | Description |
|---|---|---|
operations * | array | Ordered list of {tool, args} to run. Max 100. e.g. [{"tool":"add_node","args":{...}}, {"tool":"set_node_properties","args":{...}}] |
stop_on_error | boolean | If true, stop at the first operation that returns ok:false. Default: false (run all). |
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.
| Parameter | Type | Description |
|---|---|---|
node_type * | string | Class name to match, e.g. "CharacterBody2D" |
scene_path * | string | Path to the scene file |
exact_match | boolean | If true, match exact class only (not subclasses). Default: false |
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.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the scene file |