godot-mcp-bridge

v1.3.0
io.github.TomasLucasUTN/godot-mcp-bridge Checked 1 day ago Published 1 month ago

MCP 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".

ParameterTypeDescription
slugstringGuide 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.

ParameterTypeDescription
query *stringWhat you are trying to do in English or Spanish (e.g. "bake a navmesh", "read the player position while the game runs").
include_schemabooleanAlso return each match's full inputSchema. Default false — the names and summaries are usually enough to pick one.
limitnumberHow 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.

ParameterTypeDescription
include_toolsbooleanAlso 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.

ParameterTypeDescription
name *stringToolset 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.

ParameterTypeDescription
name *stringToolset 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.

ParameterTypeDescription
root *stringStarting path like res://addons/ai_assistant or res://
include_hiddenbooleanInclude 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.

ParameterTypeDescription
path *stringres:// path to the file (e.g., res://scripts/player.gd)
end_linenumberInclusive end line; 0 or missing means to end of file (optional)
max_bytesnumberStop 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_linenumber1-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.

ParameterTypeDescription
query *stringCase-insensitive substring to find
case_sensitivebooleanMatch case exactly. Default false.
globstringOptional glob filter like **/*.gd to search only GDScript files
include_addonsbooleanSearch res://addons/ too. Default false: third-party addon source answers almost every common identifier and crowds out the project own code.
max_resultsnumberStop 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.

ParameterTypeDescription
max_depthnumberMax 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.

ParameterTypeDescription
scene_path *stringPath to the scene file (res://path/to/scene.tscn)
child_offsetintegerSkip 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.
formatstringcompact 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_propertiesbooleanInclude 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_depthnumberMax 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_nodesintegerMaximum nodes returned (default 500). Response reports truncation explicitly. Read node_path branches to inspect a larger scene without flooding context.
node_pathstringRead 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…
propertiesarrayReturn 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.

ParameterTypeDescription
class_name *stringGodot class name to query (e.g., "CharacterBody2D", "Sprite2D", "Control")
filterstringCase-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_virtualbooleanInclude well-known virtual methods like _ready, _process, _input (default: true). Set to false to see only public non-virtual methods.
querystringWhat 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.

ParameterTypeDescription
include_physicsbooleanInclude physics settings
include_renderbooleanInclude render settings

create_scene

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

ParameterTypeDescription
root_node_type *stringType of root node (e.g., Node2D, CharacterBody2D, Control, Node3D). REQUIRED.
scene_path *stringScene file path (e.g., res://Scenes/player.tscn)
attach_scriptstringOptional script path to attach to root node (res://path/to/script.gd)
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
nodesarrayChild 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_namestringName 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.

ParameterTypeDescription
node_name *stringName for the new node
node_type *stringType of node (e.g., Sprite2D, Camera2D, RigidBody2D, CollisionShape2D)
scene_path *stringPath to the scene file (res://path/to/scene.tscn)
childrenarraySub-tree to create in the same call. Each entry takes add_node's own args, minus parent_path.
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
groupsarrayOptional list of node groups this node should belong to. Persisted to the .tscn file.
parent_pathstringPath to parent node (. for root, or relative path like Sprite2D)
propertiesobjectOptional dictionary of properties to set on the node
scriptstringOptional script path to attach to the new node (res://path/to/script.gd)

remove_node

Remove a node from an existing scene file.

ParameterTypeDescription
node_path *stringPath to the node to remove (cannot be root, use relative path)
scene_path *stringPath to the scene file
dry_runbooleanPreview 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.

ParameterTypeDescription
properties *objectMap of property_name -> value. Each value follows the same form as modify_node_property.value (primitives, arrays, or {type:"Vector3",...} discriminated objects).
scene_path *stringPath to the .tscn scene file
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
node_pathstringPath 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.

ParameterTypeDescription
node_path *stringNode that HOLDS the property (. for root, or a relative path)
property *stringName of the exported property to set, e.g. "initial_state" or "health"
scene_path *stringPath to the .tscn scene file
target_path *stringNode it should point AT, relative to the scene root, e.g. "StateMachine/Idle"
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.

rename_node

Rename a node in a scene.

ParameterTypeDescription
new_name *stringNew name for the node
node_path *stringPath to the node to rename
scene_path *stringPath to the scene file
dry_runbooleanPreview 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.

ParameterTypeDescription
new_parent_path *stringPath to the new parent node (. for root)
node_path *stringPath to the node to move
scene_path *stringPath to the scene file
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
sibling_indexnumberOptional 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.

ParameterTypeDescription
node_path *stringPath to the node to duplicate (cannot be root)
scene_path *stringPath to the scene file
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
new_namestringOptional 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.

ParameterTypeDescription
instance_path *stringPath to the .tscn scene to instance (the child/prefab scene)
scene_path *stringPath to the scene file being edited (the parent scene)
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
node_namestringOptional name for the instance. If omitted, uses the instanced scene's root node name.
parent_pathstringPath to parent node within the scene (. for root, or relative path like Level/Enemies)
propertiesobjectOptional 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.

ParameterTypeDescription
scene_path *stringPath to the scene file
script_path *stringPath to the script file (res://path/to/script.gd)
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
node_pathstringPath 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.

ParameterTypeDescription
from_node *stringPath to the emitting node
method *stringMethod name on the receiving node's script
scene_path *string
signal *stringSignal name on the emitting node
to_node *stringPath to the receiving node
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
flagsnumberConnection 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…

ParameterTypeDescription
operations *arrayOrdered edits. Each is an object with an "op" field and that op's args.
scene_path *stringPath to the .tscn file
dry_runbooleanPreview only: do the work, report it, write nothing. Default false.
stop_on_errorbooleanDiscard 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.

ParameterTypeDescription
content *stringFull GDScript content to write to the file
path *stringScript file path (res://scripts/player.gd) - must not exist yet
dry_runbooleanPreview 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.

ParameterTypeDescription
edit *objectEdit 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_runbooleanPreview 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.

ParameterTypeDescription
include_addonsbooleanInclude res://addons/ in a whole-project sweep. Default false: plugin code is usually most of the files and is not yours to fix.
pathsarrayres:// .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…

ParameterTypeDescription
confirm *booleanMust be true — the safety gate described above.
path *stringPath to the file to delete (e.g. res://scenes/old.tscn)
create_backupbooleanIf 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_runbooleanPreview without deleting. Default false. Needs no confirm — it changes nothing.
forcebooleanBypass 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").

ParameterTypeDescription
attach_debuggerbooleanDefault 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_startedbooleanWait until the editor reports playing=true before returning (default: true). Up to startup_timeout_ms.
debug_collisionsbooleanDraw 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.
scenestringScene to run: omit for main scene, "current" for the currently open scene, or a res:// path for a specific scene
startup_timeout_msnumberA 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_runtimebooleanWait 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.

ParameterTypeDescription
levelstringOnly return entries of this level (e.g. "error", "warning", "info"). Omit for all.
limitnumberMaximum entries to return (default: 200, max 500)
since_msnumberOnly 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/.

ParameterTypeDescription
return_base64booleanAlso include the PNG bytes inline as base64 (default: false). Useful when the agent has no filesystem access.
save_tostringOptional 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.

ParameterTypeDescription
include_warningsbooleanInclude warnings in addition to errors (default: true)
max_errorsnumberMaximum 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.

ParameterTypeDescription
filterstringCase-insensitive substring: only matching log lines are returned.
max_linesnumberMaximum 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).

ParameterTypeDescription
savebooleanSave 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.

ParameterTypeDescription
scene_path *stringScene to render (res://path/to/scene.tscn)
heightnumberOutput height in pixels. Default 648.
save_tostringWhere to write the PNG. Defaults to res://addons/godot_mcp/cache/previews/<scene>.png
show_collisionbooleanDraw CollisionShape2D/CollisionPolygon2D outlines (same visual as Godot's Debug > Visible Collision Shapes), so hitboxes can be checked from the PNG directly. Default false.
transparentbooleanTransparent background instead of the scene's own. Default false.
widthnumberOutput 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.

ParameterTypeDescription
operations *arrayOrdered list of {tool, args} to run. Max 100. e.g. [{"tool":"add_node","args":{...}}, {"tool":"set_node_properties","args":{...}}]
stop_on_errorbooleanIf 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.

ParameterTypeDescription
node_type *stringClass name to match, e.g. "CharacterBody2D"
scene_path *stringPath to the scene file
exact_matchbooleanIf 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.

ParameterTypeDescription
scene_path *stringPath to the scene file