godot-mcp
v0.6.1MCP 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 the Godot editor is connected to the MCP server. Also reports the plugin, server and Godot versions, and warns when the plugin and server versions differ.
get_guide
Read a short markdown guide from the server. Same content as the MCP resources/read protocol, exposed as a tool so it works in MCP clients that do not support resources (e.g. Claude Desktop, Cursor chat). Call with no args to list available guides: testing-loop, scene-editing, asset-generation, troubleshooting, batching, selection-workflow, tool-index. Call with {slug: "..."} to get the full markdown. Useful when a workflow is non-obvious (testing a running game, setting resources and property values, troubleshooting "Runtime helper not connected", etc.).
| Parameter | Type | Description |
|---|---|---|
slug | string | Guide slug. Omit to list all available guides. Known slugs: testing-loop, scene-editing, asset-generation, troubleshooting, batching, selection-workflow, tool-index. |
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 |
|---|---|---|
include_hidden | boolean | Include hidden files and folders (names starting with "."). Default: false. |
path | string | Folder to list, like res:// (default) or res://scenes |
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 | Maximum bytes to return before truncating (default: 200000) |
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. Useful for finding usages of functions, variables, or any text pattern.
| 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 |
max_results | number | Maximum matches to return (default: 200) |
create_script
Create a NEW GDScript file (.gd) that does not exist yet. STRICTLY for .gd files — non-.gd extensions (.json, .gdignore, .md, etc.) are rejected with a pointer at write_file. A missing extension is auto-completed to .gd. Use edit_script for changes to an existing file. Use classdb_query to verify unfamiliar Godot class methods. After creating a script, consider run_scene and get_errors to verify it parses and behaves.
| 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 |
create_scene
Create a new Godot scene (.tscn) with a tree of nodes in one call, including their properties, textures, collision shapes, scripts and groups. Use this to create player scenes, UI screens, game objects, etc. **All-or-nothing:** the whole tree is built and checked in memory first. Unknown node types or property names (with suggestions), values of the wrong type, missing resource files and bad scripts are ALL reported together as path-pointed `validation_errors` (e.g. `nodes[1].children[0].properties.texture: no resource at res://hero.png`), and no file is written unless everything is valid.
| 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) |
nodes | array | Child nodes to create under the root. Each node spec: {name|node_name, type|node_type, properties?, script?, groups?, children?}. Unknown keys (e.g. "class", "parent") are errors. properties values: V… |
root_node_name | string | Name of the root node. Default: the file name in PascalCase (res://player_ship.tscn -> PlayerShip). |
read_scene
Read and parse a scene file to get its full node structure and properties. Use this to understand a scene before editing. NOTE: `include_properties: true` returns a hand-picked subset (position, rotation, scale, size, offset, visible, modulate, z_index, text, collision_layer, collision_mask, mass) optimized for quick scene overviews. To see ALL properties on a specific node — including @export'd script vars — use `get_scene_node_properties`.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the scene file (res://path/to/scene.tscn) |
include_properties | boolean | Include the curated property subset above on each node (default: false). For a full per-node property dump use get_scene_node_properties. |
get_scene_node_properties
Return the FULL property list of a single node in a .tscn file, including @export'd script vars and inherited properties — with current values, declared variant types, hint metadata, and a category grouping. Complements `read_scene` (which uses a curated subset of common properties for quick tree overviews) and `get_node_properties` (which returns class-level metadata, not a specific node's current values). Use this to verify a property was actually set after `add_node` / `set_node_properties` (especially for script @export vars), or to discover the exact name of a property you can't remembe…
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the scene file (res://path/to/scene.tscn) |
node_path | string | Path to the node within the scene (. for root, or relative path like "UI/HUD/Label"). Defaults to "." (scene root). |
add_node
Add a node (optionally with a script, groups, properties and a whole tree of children) to an existing scene file in one call. Children format: {name|node_name, type|node_type, properties?, script?, groups?, children?}; unknown child keys are errors. **All-or-nothing:** the node tree is built and checked in memory before the scene is touched. Every problem (unknown types or properties with suggestions, wrong value types, missing resource files, bad scripts) is reported together in `validation_errors` with path-pointed prefixes, and nothing is saved unless everything is valid. Returns the new n…
| 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 | Optional tree of children to create under the new node. Each entry has the same shape as add_node's args (minus parent_path). Use this to build sub-trees in one call. |
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 properties to set on the node. Values are read according to each property type: numbers/bools/strings; enums by name ("Nearest") or number; Vector2/3 as {x, y[, z]} or [x, y[, z]]; Color as {… |
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 |
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 |
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 |
sibling_index | number | Optional position among siblings (0 = first child). Omit or -1 to append. |
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) |
node_path | string | Path to the node (. for root, or relative path) |
detach_script
Remove a script from a node in a scene.
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Path to the node (. for root) |
scene_path * | string | Path to the scene file |
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) |
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": {"x": 5, "y": 0, "z": 10}}. Same value forms as set_node_properties; checked before the parent scene is touched. |
get_node_spatial_info
Query computed 3D spatial data for a Node3D in a scene file. Returns local/global positions, scales, rotation quaternions, and subtree bounding boxes (AABB) when available. Use this before making precise 3D placement decisions.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | Path to the .tscn scene file |
include_bounds | boolean | Include computed subtree AABBs when visual descendants exist (default: true) |
node_path | string | Path to the Node3D (. for root, or relative path like Level/Props/Crate) |
measure_node_distance
Measure the world-space distance between two Node3D nodes in a scene file. Returns both the full 3D delta and the horizontal XZ distance.
| Parameter | Type | Description |
|---|---|---|
from_node_path * | string | Path to the first Node3D |
scene_path * | string | Path to the .tscn scene file |
to_node_path * | string | Path to the second Node3D |
snap_node_to_grid
Snap a Node3D position to a grid in local or global space. Useful for modular level building and keeping 3D scenes aligned.
| Parameter | Type | Description |
|---|---|---|
grid_size * | Positive grid size. Use a number for uniform snapping or {x,y,z} for per-axis snapping. | |
scene_path * | string | Path to the .tscn scene file |
axes | array | Axes to snap. Any of: ["x"], ["x","z"], ["x","y","z"] (default: all axes) |
node_path | string | Path to the Node3D to snap |
space | string | Coordinate space: "local" or "global" (default: "global") |
set_node_properties
Set one or more properties on a node in a .tscn scene. This is THE tool for changing node properties, including resources. ALWAYS use it (or create_scene/add_node) to change scenes; never edit .tscn files as text. Values are read according to each property's type: • numbers, bools, strings; enums by name ("Nearest", "TEXTURE_FILTER_NEAREST") or number • Vector2/3: {x, y[, z]} or [x, y[, z]]; Color: {r, g, b, a?} (0..1), "#ff8800" or "red"; Rect2: {x, y, width, height} • resources (texture, shape, mesh, material, stream, font, ...): a file path "res://icon.png", or an inline resour…
| Parameter | Type | Description |
|---|---|---|
properties * | object | Map of property name (or colon path like "material:albedo_color") -> value. See the tool description for value forms. |
scene_path * | string | Path to the .tscn scene file, or to a .tres/.res resource file to edit that resource directly (node_path then omitted) |
node_path | string | Path to the node (. for root, or relative path) |
set_node_groups
Set, add, or remove a node's group memberships in a .tscn scene file. Groups persist to disk so the running game can call get_tree().get_nodes_in_group(name).
| Parameter | Type | Description |
|---|---|---|
groups * | array | List of group names to apply |
scene_path * | string | Path to the .tscn scene file |
mode | string | replace (default): node ends up in EXACTLY the listed groups. add: union with existing. remove: drop the listed groups. |
node_path | string | Path to the node (. for root) |
get_node_groups
Read the list of groups a node belongs to in a .tscn scene file.
| Parameter | Type | Description |
|---|---|---|
scene_path * | string | |
node_path | string |
find_nodes
Search a .tscn file for nodes matching one or more filters. Filters AND together; pass any subset. Scene-scoped — for project-wide text search use search_project instead. Returns one entry per match with path (relative to scene root, "." = root), name, type (Godot class), and groups. Filters: • name_pattern: case-insensitive. If it contains "*" or "?" it is treated as a glob (matchn); otherwise as a substring (findn). • type: Godot class name (e.g. "Node2D", "CharacterBody3D", "Button"). Matches the node's class AND any subclass (so "Node2D" matches "Sprite2D"). Also matches custom…
| Parameter | Type | Description |
|---|---|---|
in_group | string | Group name to filter by. |
name_pattern | string | Case-insensitive match against node names. Glob (contains "*"/"?") or substring otherwise. |
recursive | boolean | Traverse the whole subtree (default true). If false, only the scene root and its direct children are checked. |
scene_path | string | Path to the .tscn scene file (res://...). Optional; defaults to the editor's current edited scene. |
type | string | Godot class name or globally registered script class_name. Matches class AND subclasses (is_a check). |
save_resource_to_file
Save a Resource currently held by a node (or sub-resource) to a standalone .tres file so it can be referenced by other scenes / shared / committed. The node's property is then re-pointed to the saved file. To change the file later, call set_node_properties with scene_path set to the .tres (this affects every scene that uses it). Works for any Resource subclass: Material, Mesh, Shape, Curve, Gradient, etc.
| Parameter | Type | Description |
|---|---|---|
resource_path * | string | Path from node to the resource (e.g. "shape", "material") |
save_to * | string | Destination path (res://.../foo.tres) |
scene_path * | string | |
node_path | string |
get_resource_info
Inspect ANY Godot Resource. Two modes: • path mode: pass {path: "res://foo.png"} for a resource on disk (.tres / .res / image / .glb / .ogg / .tscn / etc.) • node mode: pass {scene_path, node_path, resource_property} to inspect a resource attached to a node WITHOUT having to save it as .tres first (e.g. the shape on a CollisionShape2D, the material on a MeshInstance3D, the stream on an AudioStreamPlayer). Returns class, file size (path mode), and type-specific info: width/height for textures, vertex/surface counts and AABB for meshes, length for AudioStream/Animation, node count for Pa…
| Parameter | Type | Description |
|---|---|---|
node_path | string | Node mode: path to the node within the scene. |
path | string | Path mode: resource path on disk (res://...). |
resource_property | string | Node mode: property name on the node holding the resource (e.g. "shape", "material", "stream", "texture"). |
scene_path | string | Node mode: path to the .tscn that owns the node. |
list_signal_connections
List signal connections involving a node. source="scene_file" (default) reads connections persisted to a .tscn. source="runtime" requires the game to be running and reads live connections from the SceneTree. Use the runtime mode to verify dynamically-connected signals (those connected from code in _ready, not in the editor).
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Path to the node. For source="runtime" use absolute (/root/Main/Player) or relative to current_scene. |
include_incoming | boolean | Include signals from other nodes whose handler is on this node (default: true). Only honored for scene_file source. |
include_outgoing | boolean | Include signals that this node emits (default: true) |
scene_path | string | For source="scene_file": path to the .tscn |
source | string | Where to read connections from. Default: scene_file |
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, otherwise the editor's in-memory node will not see the script and this tool will reject the connection.
| Parameter | Type | Description |
|---|---|---|
from_node_path * | string | Path to the emitting node (scene-relative, "." = root) |
method * | string | Method name on the receiving node's script |
scene_path * | string | |
signal * | string | Signal name on the emitting node |
to_node_path * | string | Path to the receiving node (scene-relative, "." = root) |
flags | number | Connection flags (CONNECT_DEFERRED=1, CONNECT_PERSIST=2, CONNECT_ONE_SHOT=4). Default 0. |
disconnect_signal
Remove a signal connection from a .tscn scene file. No-op if the connection doesn't exist.
| Parameter | Type | Description |
|---|---|---|
from_node_path * | string | Path to the emitting node |
method * | string | |
scene_path * | string | |
signal * | string | |
to_node_path * | string | Path to the receiving node |
call_method
Invoke any method on any node, in either the editor's on-disk scene or the running game. The write counterpart to query_runtime_node (which only reads). **Two modes** controlled by `runtime`: • `runtime: false` (default, editor mode) — Loads the .tscn from disk, finds the node, invokes the method, ALWAYS saves the scene back. Snapshot taken so `mcp_undo` reverts the file. Use for **engine/built-in methods that mutate persistent scene state**: `CollisionObject2D.set_collision_layer_value(layer, on)`, `Curve2D.add_point(pos)`, `Node.add_user_signal(name)`, `Node.add_to_group(name, true)`…
| Parameter | Type | Description |
|---|---|---|
method * | string | Method name on the target node. Validated against node.has_method(); on miss returns closest_matches and available_methods_sample. |
node_path * | string | Path to the target node. Editor mode: relative to scene root (e.g. "Player", "UI/HUD/Label", or "." for root). Runtime mode: absolute (/root/Main/Player) or relative to current_scene (Player). |
args | array | Positional arguments to pass. Default: []. Arity is pre-checked against the method signature (allowing for default arguments). |
confirm | boolean | Required for methods on the destructive denylist (queue_free, free, set_script, remove_child, replace_by, reparent) and, in runtime mode, for direct calls on /root/<name> (autoload/scene root territor… |
expect_return | boolean | Capture and serialize the return value (default: true). Set false for void / fire-and-forget calls to skip serialization in the response. |
runtime | boolean | When true, call on the live node in the running game via MCPRuntime. Requires the game to be running (run_scene first). When false (default), operates on the .tscn file in the editor. |
scene_path | string | Editor mode only: which .tscn to operate on. Defaults to the editor's currently edited scene (must be saved at least once). Ignored when runtime=true. |
edit_script
Edit an existing GDScript (.gd) file in place by replacing old_text with new_text, and save. The text can be any size — a single line, a function, or the whole file for a full rewrite. If old_text matches more than once, pass context_before/context_after to disambiguate; if it can't be found, read_file the relevant range and retry with an exact match. ONLY for .gd files; not for .tscn scene files (use the scene/node tools). After editing, consider validate_script and run_scene + get_errors.
| Parameter | Type | Description |
|---|---|---|
new_text * | string | Replacement text (empty string deletes old_text) |
old_text * | string | Exact text to replace, including whitespace and indentation |
path * | string | Script to edit (res://path/to/script.gd) |
context_after | string | Optional unique text right after old_text |
context_before | string | Optional unique text right before old_text, when old_text appears more than once |
validate_script
Validate a GDScript file for syntax errors using Godot's built-in parser. Good for ordinary project scripts after editing. For @tool/editor-plugin addon scripts this isolated parser path may return valid:false with diagnostics_available:false because dependencies and editor context are not fully loaded; in that case, use get_errors/get_console_log after enabling or reloading the addon for actionable details.
| Parameter | Type | Description |
|---|---|---|
path * | string | Path to the GDScript file to validate (e.g., res://scripts/player.gd) |
create_folder
Create a directory (with parent directories if needed).
| Parameter | Type | Description |
|---|---|---|
path * | string | Directory path (res://path/to/folder) |
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 | REQUIRED. Must be explicitly set to true — safety gate to prevent accidental deletes. Calls without confirm=true fail with an error. |
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. |
force | boolean | If true, bypass the "file is open in editor" guard. Use ONLY if you know the file is not the active scene. The guard exists because deleting the active scene tab from under the editor can crash Godot. |
delete_folder
Recursively delete a directory and ALL of its contents from the project. REQUIRES confirm=true. For a non-empty folder you must ALSO pass recursive=true — otherwise the call refuses and reports the file/sub-folder count. The whole deletion lands as a SINGLE undo entry: one mcp_undo restores every file (empty sub-directories are not restored — only files are tracked). Three safety guards each REFUSE rather than half-delete: (1) refuses if any file inside is open in an editor tab — close the tabs or pass force=true (deleting an open scene can crash Godot); (2) refuses if any external file…
| Parameter | Type | Description |
|---|---|---|
confirm * | boolean | REQUIRED. Must be explicitly true — safety gate against accidental deletes. Calls without confirm=true fail with an error. |
path * | string | Folder to delete (e.g. res://enemies/old). res:// is prepended if missing. |
allow_no_undo | boolean | If true, delete a folder too large to snapshot without recording an undo entry. The deletion then cannot be reverted with mcp_undo. Default false. |
force | boolean | If true, bypass the "file open in editor" guard. Deleting an open scene/script can crash the editor — prefer closing the tabs. Default false. |
force_orphan | boolean | If true, delete even when files inside are still referenced from outside the folder. This WILL leave broken references. Default false. |
recursive | boolean | REQUIRED for a non-empty folder. Must be true to delete a folder that contains any files or sub-folders. Default false. |
write_file
Write UTF-8 text content to any file in the project. Creates the file if missing; REFUSES to clobber an existing file unless overwrite=true. Parent directories are auto-created (override with create_dirs=false). Refuses to write to plugin source (anywhere under res://addons/godot_mcp/ except res://addons/godot_mcp/cache/) unless force=true. Refuses paths containing ".." or "." traversal segments (would escape the project tree). Use this for non-GDScript text: .gdignore, .gitignore, README.md, .json configs, .gdshader files, custom .tres data, fixture files for tests, any plain-text content. F…
| Parameter | Type | Description |
|---|---|---|
content * | string | Text content to write. Encoded as UTF-8. Pass an empty string to create a zero-byte file. |
path * | string | File path (res://... — res:// is prepended if missing). |
create_dirs | boolean | If true (default), missing parent directories are auto-created. If false, missing parent dirs return an error. |
force | boolean | Bypass the plugin-source-protection guard. Required to overwrite anything under res://addons/godot_mcp/ except res://addons/godot_mcp/cache/. Default false. |
overwrite | boolean | REQUIRED to replace an existing file. Default false — calls against an existing path without overwrite=true return file_exists:true and refuse. |
rename_file
Rename or move a project file. By default also rewrites every literal reference to the old path in other text-format project files (.tscn, .tres, .gd, .cs, .gdshader, project.godot) and updates any matching `autoload/*` entry in ProjectSettings, so scenes and preloads keep working. When Godot exposes a reliable scene-dirty API, clean open scene tabs that referenced the renamed file are reloaded (close + reopen), while dirty tabs are preserved and returned in scenes_skipped_dirty. On Godot versions without that API, open scene reload is skipped with scene_reload_warnings to avoid discarding uns…
| Parameter | Type | Description |
|---|---|---|
new_path * | string | New file path |
old_path * | string | Current file path |
update_references | boolean | Update references in other files (default: true) |
list_scripts
List all GDScript files in the project with basic metadata.
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 |
get_input_map
Return the full InputMap: built-in actions (ui_*, spatial_editor/*) plus all project-defined actions from project.godot. Each action maps to an object with "events" (array of key/mouse/gamepad bindings) and optionally "deadzone". Use this before configure_input_map to see current bindings and deadzones.
| Parameter | Type | Description |
|---|---|---|
include_deadzones | boolean | Include the per-action "deadzone" field in each action object (default: true). When true, each action is {"deadzone": 0.5, "events": [...]}. When false, each action is {"events": [...]}. |
get_collision_layers
Return named 2D/3D physics collision layers from ProjectSettings.
get_node_properties
Get available properties for a Godot node type. Use this to discover what properties exist on a node type (e.g., anchors_preset for Control, position for Node2D).
| Parameter | Type | Description |
|---|---|---|
node_type * | string | Node class name (e.g., "Sprite2D", "Control", "Label", "Button") |
get_console_log
Return the latest lines from the Godot editor Output panel (editor-side messages plus prints from the running game). NOTE: this does NOT include the Debugger > Errors tab — runtime push_error / script errors during play often surface only there. After run_scene, always call get_errors (not just this) to check for errors. When this tool finds error-prefixed lines it returns errors_detected=true and a hint pointing to get_errors. The tool also reads the Output panel's Info/Warning/Error filter buttons; if Info is OFF and prints appear missing, the response includes output_panel_filters and a h…
| Parameter | Type | Description |
|---|---|---|
debug | boolean | When true, include editor_log_rtl_path and editor_log_candidates (each EditorLog widget found, with text length and a 200-char tail sample). Use this to diagnose cases where running-game prints do not… |
max_lines | number | Maximum number of lines to include (default: 50) |
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. Debugger rows can appear a few frames after run_scene returns; pass wait_ms:300 when checking immediately after launch. 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) |
wait_ms | number | Optional short wait before reading Output/Debugger errors, capped at 1000ms. Use ~300ms immediately after run_scene to avoid false "0 errors" results while the Debugger > Errors tab catches up. |
clear_console_log
Mark the current position in the Godot editor log. Subsequent get_console_log and get_errors calls will only return output after this point.
open_in_godot
Open a file in the Godot editor at a specific line (side-effect only).
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path to open |
line | number | 1-based line number |
scene_tree_dump
Dump the scene tree of the scene currently open in the Godot editor (node names, types, and attached scripts) as an indented text block. Reflects unsaved edits (uses the live editor tree, not the .tscn on disk). All args are optional; with no args the entire tree is returned (existing behavior). Opt-in scoping / pagination (use these on large scenes to keep responses small): • subtree_root — start at a node path relative to the scene root (e.g. "UI/HUD"). Empty or "." means the scene root. Depth resets to 0 at this node. • max_depth — stop traversal at depth N from the (subtree_)…
| Parameter | Type | Description |
|---|---|---|
limit | number | Maximum number of nodes to render after offset. Omit for unlimited. |
max_depth | number | Stop traversal at depth N from the (subtree_)root. 0 = only that root node. Omit or pass a negative value for unlimited depth. |
offset | number | Skip the first N nodes in DFS preorder (used for pagination). Default 0. |
subtree_root | string | Scene-relative node path to start the dump at (e.g. "UI/HUD"). Empty or "." = scene root. Errors if the node is not found. |
get_editor_selection
Return the node path(s) the user has currently selected in the Godot editor (Scene dock). **Call this FIRST whenever the user refers to a node without naming a path** — phrases like "this node", "fix this", "change the color here", "delete that", "make this red", "the selected one", "what I have selected", etc. Returns an empty `selection` array if nothing is selected; that's informational, not an error. Selection is editor UI state (not stored in the .tscn) and is scoped to the currently edited scene tab — instances from a non-active tab will not appear. Response shape: `{ok, scene_path,…
set_editor_selection
Replace or extend the editor's Scene-dock selection. Two main uses: (1) after `add_node`, focus the user's gizmo on the freshly-created node so they can see/manipulate it immediately, and (2) draw the user's attention to a node the AI just modified or discovered ("here is the offending node — selected for you in the Scene dock"). Pre-validates every path against the live edited scene tree before mutating — if any path is unresolved, no selection change happens and `not_found` is returned. Args: `node_paths` (string OR array of strings; scene-relative, "." = scene root, "UI/HUD/Label" for…
| Parameter | Type | Description |
|---|---|---|
node_paths * | Scene-relative path(s) to select. "." = scene root, "UI/HUD/Label" for nested. Accepts a single string OR an array of strings; both forms behave identically. | |
mode | string | "replace" (default) clears the existing selection first; "add" appends to it. |
close_editor_tabs
Close open editor tabs (scenes and/or scripts). Files on disk are NOT touched — this only changes the editor UI state. Default behavior with no args closes EVERY open tab (both scenes and scripts). Primary use case: test automation — reset the editor to a known state between test runs without restarting Godot. Also useful before calling delete_file / delete_folder, which refuse by default when the target is open in an editor tab. Filter by kind ("scene", "script", "any") and/or by specific paths. Paths can be given with or without "res://". SCENES: built on EditorInterface.close_scene()…
| Parameter | Type | Description |
|---|---|---|
kind | string | Which tab kind to target. "any" (default) closes both scenes and scripts. "scene" or "script" restricts to that side. |
paths | array | Optional list of paths to close (with or without "res://"). Omit or pass an empty array to close ALL open tabs of the chosen kind. Paths not currently open are returned in `not_open` rather than causi… |
list_settings
Browse Godot project settings by category. Returns values from the editor's in-memory state — this matches project.godot after a normal Godot save, but direct edits to project.godot on disk are not reflected until the editor restarts (rescan_filesystem does not help). Call without a category to see all available categories. Call with a category to see all settings with their current values, types, and valid options.
| Parameter | Type | Description |
|---|---|---|
category | string | Settings category prefix (e.g., "display", "physics", "rendering", "application", "audio"). Omit to list all available categories. |
update_project_settings
Update one or more Godot project settings. Pass a dictionary of setting paths to their new values. Use list_settings first to discover available setting paths, current values, and valid options for a category. For input action bindings, prefer configure_input_map — if you do pass input/* keys here, partial updates are merged safely (existing events are preserved).
| Parameter | Type | Description |
|---|---|---|
settings * | object | Dictionary of setting paths to new values (e.g., {"display/window/size/viewport_width": 1920, "display/window/size/viewport_height": 1080}) |
configure_input_map
Add, remove, or replace input actions and their key/button bindings. Use get_input_map to see current actions before modifying.
| Parameter | Type | Description |
|---|---|---|
action * | string | Input action name (e.g., "move_left", "jump", "attack") |
operation * | string | "add" to create action and/or append events, "remove" to delete the action entirely, "set" to replace all events on an action (creates it if needed) |
deadzone | number | Action deadzone (default: 0.5) |
events | array | Input events to bind. Each object needs a "type" field: {"type":"key","key":"Space"} for keyboard, {"type":"mouse_button","button_index":1} for mouse (1=left,2=right,3=middle), {"type":"joypad_button"… |
run_scene
Launch a scene in the Godot editor. By default the call BLOCKS until the editor flips to playing state (so the next get_errors / take_screenshot / send_input call sees a real game). The response includes started, runtime_connected, wait_for_started_ms, wait_for_runtime_ms, scene_path, and runtime_root. Use runtime_root (e.g. "/root/Main") as the prefix for query_runtime_node node_path arguments — it is computed from the actual root node name in the .tscn, NOT from the file name. Set wait_for_runtime=true to additionally wait for the in-game MCPRuntime helper to connect (required before take_…
| Parameter | Type | Description |
|---|---|---|
block_until_started | boolean | Wait until the editor reports playing=true before returning (default: true). Up to startup_timeout_ms. |
clear_output | boolean | Watermark the Output panel and Debugger > Errors tab at launch so get_console_log / get_errors only return entries from THIS run, preventing stale output from a previous run being read as current erro… |
scene_path | string | Scene to run: omit for the main scene, "current" for the scene open in the editor, or a res:// path. |
startup_timeout_ms | number | Max time in ms to wait for the above signals. Default: 10000. Bump to 15000–20000 on slower machines or autoload-heavy projects. Values above 25000 are clamped (response would otherwise miss the tra… |
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_status
Combined editor + runtime status snapshot. Returns `playing`, `playing_scene`, `last_launched` ("current"|"main"|res-path), `uptime_ms` since the most recent run_scene, `runtime_helper_connected` (true once the in-game MCPRuntime autoload is talking to the MCP server), `godot_version` (e.g. "4.5.0.stable"), and `godot_version_info` (the full Engine.get_version_info() dict — `major`, `minor`, `patch`, `string`, `build`, `hex`, …). Useful for binding test reports to a specific Godot build without opening the About dialog.
wait
Sleep server-side. Useful between input events to let the game process them. Capped at 30000ms / 30s. Pass either ms or seconds (ms wins if both given).
| Parameter | Type | Description |
|---|---|---|
ms | number | Milliseconds to wait (1..30000). |
seconds | number | Seconds to wait (0.001..30). Convenient when the agent is thinking in seconds. |
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 |
send_input
Synthesize an InputEvent and dispatch it to the running game via Input.parse_input_event. REQUIRES the game to be running with the MCPRuntime autoload connected. Use this to drive automated tests: click buttons, press keys, fire input actions. For multi-step interactions, alternate send_input → wait → query_runtime_node / take_screenshot. Unknown key names, unknown actions and unknown event fields are errors (they used to be ignored), so a returned ok means the event really fired.
| Parameter | Type | Description |
|---|---|---|
event * | object | InputEvent descriptor: Key: {type:"key", key:"Space", pressed:true, shift?:bool, ctrl?:bool, alt?:bool, meta?:bool, echo?:bool} or {type:"key", keycode:32, pressed:true} Mouse button: {type:"mouse… |
query_runtime_node
Read a live node in the running game. REQUIRES the game to be running with the MCPRuntime autoload connected. Returns class, path, script, groups and property values. By default (no `properties`) it returns everything that describes the node's current state: all script variables (health, score, ...) plus every stored property that differs from the class default (a Label's text, a body's velocity, ...), plus global_position for 2D/3D/UI nodes. Pass `properties: ["text", "material:albedo_color"]` to read specific ones (colon paths read into resources); unknown names are errors with suggestions.…
| Parameter | Type | Description |
|---|---|---|
node_path * | string | Absolute path (e.g. /root/Main/Player) or relative to current_scene. |
include_children | boolean | List direct children {name, class}. Default: false. |
include_groups | boolean | Include the node's group memberships. Default: true. |
properties | array | Property names (or colon paths) to read. Omit to get every script variable and every property that differs from its default. |
get_performance_monitors
Snapshot of Godot's Performance singleton from inside the RUNNING game: fps, frame/physics step times, static memory (current + peak), renderer draw calls / objects / primitives, and engine-wide object/node/orphan counts. REQUIRES the game to be running with the MCPRuntime autoload connected (run_scene with wait_for_runtime=true first). Use when: 1. After run_scene — verify the scene actually hits its target fps before reporting "done". 2. The user reports lag/jank — localize the bottleneck (low fps vs high draw_calls vs growing memory vs orphan_nodes leak). 3. Before/after an optim…
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 script prints/stdout use get_console_log; for runtime push_error / script errors use get_errors (it reads the Debugger > Errors tab — runtime errors do NOT appear in get_console_log). Returns entries with ts_ms, level, and text plus started_at_ms (when the helper started) and now_ms.
| Parameter | Type | Description |
|---|---|---|
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. |
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") |
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" |
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. If a scan is already in progress (often happens right after a batch of mutations), the call returns ok:true with already_scanning:true — the in-flight scan will pick up your recent disk changes, no new scan is triggered. Response: {ok, already_scanning, message}.
setup_autoload
Register, unregister, or list autoload singletons. Autoloads are scripts/scenes loaded automatically at project start.
| Parameter | Type | Description |
|---|---|---|
operation * | string | "add" to register, "remove" to unregister, "list" to show all autoloads |
name | string | Autoload name (e.g., "GameManager", "AudioManager") |
path | string | res:// path to the script or scene file (required for "add") |
generate_2d_asset
Render an SVG to a PNG asset on disk via Image.load_svg_from_buffer. The SVG is rendered directly from bytes — no temp file is created, so concurrent calls are safe and project-rename quirks (user:// rebinding) cannot break it. Returns resource_path, absolute_path, dimensions {width,height}, and the render_scale used.
| Parameter | Type | Description |
|---|---|---|
filename * | string | Output filename. ".png" appended if missing. |
svg_code * | string | Complete SVG markup. Either single or double quotes are accepted in attributes. |
height | number | Optional desired output height in pixels. Same as width but matched on the height axis. If both width and height are provided, width takes precedence for scale derivation. |
save_path | string | Destination directory (default: res://assets/generated/). Created if it does not exist. |
scale | number | Optional explicit render scale (e.g. 2.0 = 2x). Overrides width/height-derived scaling. Default: 1.0. |
width | number | Optional desired output width in pixels. Combined with the SVG's intrinsic width to derive a uniform render_scale. |
map_project
Crawl the entire Godot project and build an interactive visual map of all scripts showing their structure (variables, functions, signals), connections (extends, preloads, signal connections), and descriptions. Opens an interactive browser-based visualization.
| Parameter | Type | Description |
|---|---|---|
include_addons | boolean | Whether to include scripts in the addons/ folder (default: false) |
path | string | Folder to start crawling from (default: res://) |
mcp_undo
Roll back the most recent MCP mutation(s). Use this proactively — not just when the user asks — any time you want to recover from a mistake, clean up after a partial failure, or try a different approach. Specifically: call this if a tool call produced an error or unexpected result and you want a clean slate before retrying; if a multi-step sequence failed midway and you need to undo the steps that did succeed; or if get_errors shows new problems immediately after a mutation. Also use when the user says "undo", "revert", "go back", "restore", "that was wrong", "put it back", or similar. Pre…
| Parameter | Type | Description |
|---|---|---|
count | number | Number of entries to undo from the top of the stack. Defaults to 1. Stops early if the stack runs out. |
preview | boolean | If true, return what *would* be undone without performing the undo. Use to verify before committing. |
mcp_redo
Re-apply the most recently undone MCP mutation(s). Use this proactively whenever you've over-undone — for example, you walked back several steps to inspect intermediate state, or you undid in error and want to recover the change without re-deriving its arguments. Also use when the user says "redo", "put it back", "never mind, do it again", or similar. Prefer this over re-issuing the original tool call — it restores the exact post-mutation state with no guessing. After mcp_undo, undone entries land on a redo stack that mcp_redo replays in order. The redo stack is cleared whenever a NEW muta…
| Parameter | Type | Description |
|---|---|---|
count | number | Number of entries to redo. Defaults to 1. |
preview | boolean | If true, return what *would* be redone without performing it. |
mcp_undo_history
List the undo and redo stacks: tool name, args summary, files affected, and age in seconds for each entry. Use to decide how far to undo (then call mcp_undo with the chosen count) or to confirm a specific change is still on the stack. Returns {undo: [...newest-first], redo: [...newest-first], cap: {entries, max_entries, bytes, max_bytes}}.
| Parameter | Type | Description |
|---|---|---|
limit | number | Max entries to return per stack. Defaults to 20. |
batch_execute
Run an ordered list of MCP tool calls as a single composite operation. Use this whenever you would otherwise issue multiple consecutive mutations on the same scene/script/project — e.g. "create a node, set 5 properties, attach a script, connect 2 signals" becomes one call instead of 9. Cuts round-trip latency, response tokens, and per-call error handling. The whole batch lands as ONE undo entry, so a single `mcp_undo` reverts everything. Modes: • atomic=true (default): on any failure, every earlier successful step is rolled back from snapshots before returning. The batch either fully ap…
| Parameter | Type | Description |
|---|---|---|
commands * | array | Ordered list of sub-commands to run. Each entry is {name: <tool-name>, args: <object>}. Sub-commands run sequentially; earlier results are NOT piped into later args (build the args before sending). Mu… |
atomic | boolean | Default true. When true, any sub-command failure rolls back every earlier successful step from snapshots and discards the entry. When false, successful steps stay in place and the partial entry is com… |
stop_on_error | boolean | Default true. Only meaningful when atomic=false. When true the batch stops at the first failure; when false it continues through errors, executing every command. Ignored when atomic=true (which always… |