Godot MCP Loop
v0.9.0Drive a live Godot 4 editor: edit scenes and scripts, run and test the game, record GIFs.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
godot_status Godot status
Check the connection to the Godot editor and get basic state: Godot version, project name, currently edited scene and whether the game is running. Call this first.
project_list List Godot projects
List the Godot projects this server may switch to: folders with project.godot below the --projects-root folders (up to 3 levels down, hidden folders skipped), each with its name, whether the MCP Loop addon is installed, whether an editor is running for it, and which one is current. Use project_connect to switch.
project_connect Switch project
Point this running server at another Godot project, so the following tool calls work on it — one MCP registration for many games. Only projects below the folders given with --projects-root are allowed (without it the server stays on its --project). Returns the new project's status like godot_status, or, when no editor is open for it, how to open one. The previous project's editor and game keep running. Don't switch while another tool call runs.
| Parameter | Type | Description |
|---|---|---|
path * | string | Project folder (the one with project.godot): absolute, ~/..., or relative to a projects root, e.g. 'games/shooter'. |
editor_launch Open the Godot editor
Open the Godot editor on the current project and wait until the MCP Loop bridge answers, then return the same fields as godot_status. Does nothing when an editor already runs for the project. Godot is found from the server's --godot / GODOT_BIN, else PATH and the usual install folders (4.5+ required). The project needs the MCP Loop addon installed and enabled. headless: true opens it without a window (no screenshots; for servers and CI). The editor keeps running after the server stops; editor_quit closes editors opened here.
| Parameter | Type | Description |
|---|---|---|
headless | boolean | Start the editor without a window (default false). |
timeout_ms | integer | How long to wait for the bridge (default 120000; the first open of a project imports every asset). |
editor_quit Close the Godot editor
Close the Godot editor of the current project — only one this server opened with editor_launch (an editor the user opened is refused with EDITOR_NOT_LAUNCHED). Stops a running game, saves the open scenes unless save: false, quits, and waits for the process to end (stopped with SIGTERM after timeout_ms).
| Parameter | Type | Description |
|---|---|---|
save | boolean | Save all open scenes first (default true). |
timeout_ms | integer | How long to wait for the editor to exit (default 20000). |
project_export Export the project
Export the project with one of its export_presets.cfg presets (Godot's `--export-release`, headless, fixed argument list, no shell). The output always goes under res://build/ — pass `path` to choose the name, or omit it for res://build/<preset>/ (index.html for Web). Returns the files written with their sizes, plus the tail of Godot's log. Fails with TEMPLATES_MISSING when Godot has no export templates installed. `dry_run` shows the command and the target without exporting.
| Parameter | Type | Description |
|---|---|---|
preset * | string | Preset name from export_presets.cfg (project_info can list them). |
dry_run | boolean | Validate the preset and the path, show the command, export nothing. |
path | string | Output under res://build/... — a folder or .html for Web, a file for the other platforms. |
timeout_ms | integer | Limit for the export process (default 600000). |
project_info Project info
Project overview: name, main scene, autoloads, input actions and their events (Godot's built-in ui_* actions are hidden unless include_builtin_actions), and (optionally) a file list filtered by a glob.
| Parameter | Type | Description |
|---|---|---|
glob | string | If set, list res:// files matching this glob, e.g. '*.tscn' or 'scripts/**/*.gd'. |
include_builtin_actions | boolean | Also list Godot's built-in ui_* actions (about 90). |
max_files | integer | Cap on listed files (default 200). |
scene_open Open scene
Open a scene in the editor and make it the edited scene. Subsequent node_* tools operate on it.
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path of a .tscn/.scn file. |
scene_create Create scene
Create a new scene file with a single root node and open it. Fails if the file already exists.
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path ending in .tscn, e.g. 'res://levels/level_1.tscn'. Folders are created. |
root_type * | string | Root node class, e.g. 'Node2D', 'Node3D', 'Control', 'CharacterBody2D'. |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
root_name | string | Root node name (default: file name in PascalCase). |
scene_save Save scene
Save the currently edited scene to disk.
scene_tree Scene tree
Node hierarchy of the edited scene: name, class, relative path, attached script and instanced scene for each node.
| Parameter | Type | Description |
|---|---|---|
depth | integer | Max depth below the subtree root (default 10). |
path | string | Subtree root. Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). Default '.'. |
node_add Add node
Add a node to the edited scene (undoable). Provide either 'type' (a class like 'Sprite2D') or 'scene' (a res:// .tscn to instance). Initial properties are validated before anything is changed. Value formats: Vector2/3 as [x, y(, z)] or {x, y}; Color as '#rrggbb', '#rrggbbaa', a name like 'red', or [r, g, b, a] in 0..1; NodePath/StringName as strings; Rect2 as [x, y, w, h]; resources as {"res": "res://path"} for a file, or {"new": "RectangleShape2D", "properties": {"size": [32, 48]}} to create an embedded one (shapes, materials, styles; not scripts); null clears. Nested fields can be set with G…
| Parameter | Type | Description |
|---|---|---|
dry_run | boolean | Preview only: validate and describe the change without applying it. |
name | string | Node name (made unique among siblings if taken). |
parent | string | Parent node. Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). Default '.'. |
properties | object | Initial property values. |
scene | string | res:// path of a scene to instance instead of 'type'. |
type | string | Node class to create. |
node_delete Delete node
Delete a node and its children from the edited scene (undoable with edit_undo). The scene root cannot be deleted.
| Parameter | Type | Description |
|---|---|---|
path * | string | Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
node_get Get node properties
Read properties of a node in the edited scene. By default returns only properties that differ from the class default plus script variables.
| Parameter | Type | Description |
|---|---|---|
path * | string | Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). |
changed_only | boolean | When no list is given: only non-default values (default true). |
properties | array | Only these properties (supports 'position:x'). |
node_set Set node properties
Set one or more properties on a node as a single undoable action. All values are validated first; nothing changes if any is invalid. Returns before/after values. Value formats: Vector2/3 as [x, y(, z)] or {x, y}; Color as '#rrggbb', '#rrggbbaa', a name like 'red', or [r, g, b, a] in 0..1; NodePath/StringName as strings; Rect2 as [x, y, w, h]; resources as {"res": "res://path"} for a file, or {"new": "RectangleShape2D", "properties": {"size": [32, 48]}} to create an embedded one (shapes, materials, styles; not scripts); null clears. Nested fields can be set with Godot's indexed syntax, e.g. "po…
| Parameter | Type | Description |
|---|---|---|
path * | string | Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). |
properties * | object | Property name -> new value. |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
script_read Read script
Read a text resource inside the project (GDScript, shader, .tscn, .cfg ...).
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path. |
script_write Write script
Create or overwrite a GDScript (.gd) file. The code is compiled first; on errors nothing is written and the errors (with line numbers) are returned. Returns a unified diff for changed files and a one-line summary for new ones. Undoable with edit_undo. For small changes to an existing file prefer script_edit.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full new file content. |
path * | string | res:// path ending in .gd. |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
script_edit Edit script
Change part of an existing GDScript file by exact text replacement, without resending the whole file. Each edit's 'old' must match exactly once (including indentation; GDScript uses tabs) unless replace_all is set; edits apply in order. The result is compiled first; on errors or a non-matching edit nothing is written. Returns a unified diff. Undoable with edit_undo.
| Parameter | Type | Description |
|---|---|---|
edits * | array | |
path * | string | res:// path of an existing .gd file. |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
script_attach Attach script
Attach an existing script to a node in the edited scene (undoable). Pass script=null to detach.
| Parameter | Type | Description |
|---|---|---|
node * | string | Node path relative to the edited scene's root; '.' is the root itself (e.g. 'Player/Sprite2D'). |
script * | string | null | res:// path of the script, or null to detach. |
dry_run | boolean | Preview only: validate and describe the change without applying it. |
edit_undo Undo AI edits
Undo the most recent edits made through this MCP server (node, property, script changes), newest first. Stops without touching anything if a human made a later edit in the same history.
| Parameter | Type | Description |
|---|---|---|
steps | integer | How many actions to undo (default 1). |
file_write Write text file
Create, overwrite or partially edit a text file in the project: .yaml/.yml (e.g. scenarios), .json, .md, .txt, .csv. Give 'content' for the whole file or 'edits' (exact replacements, like script_edit). YAML syntax is checked before writing and scenario files are validated (warnings); JSON must parse. Undoable with edit_undo. Use script_write for .gd files.
| Parameter | Type | Description |
|---|---|---|
path * | string | res:// path, e.g. 'res://tests/scenarios/jump.yaml'. |
content | string | Full file content (creates or overwrites). |
dry_run | boolean | Preview only: validate and return the diff without writing. |
edits | array | Exact text replacements applied in order to the existing file. |
image_write Write pixel-art PNG
Create a PNG sprite from text, NES-style: 'palette' maps single characters to colors and each string in 'rows' is one row of pixels ('.' and ' ' are transparent). 'frames' (a list of row lists) makes a horizontal sprite sheet for animation. Scaled with nearest neighbour, imported immediately, undoable with edit_undo. Use the result as {"res": path} for a Sprite2D texture.
| Parameter | Type | Description |
|---|---|---|
palette * | object | Character -> color ('#rrggbb', '#rrggbbaa', a name, or [r, g, b, a] in 0..1), e.g. {"k": "#000000", "r": "#d82800"}. null or 'transparent' = see-through ('.' and ' ' already are). |
path * | string | res:// path ending in .png. |
dry_run | boolean | Validate and report the size without writing. |
frames | array | Several same-sized frames, laid out left to right. Each frame is a list of row strings: [["..##..", ...], ["..##..", ...]]. |
mirror | string | Symmetric sprites: give only the left half ('x'), top half ('y') or top-left quarter ('xy'); the rest is mirrored. |
mirror_overlap | boolean | Share the middle column/row instead of repeating it (odd widths/heights). |
rows | array | One image: rows of palette characters, all the same length (max 256x256). |
scale | integer | Integer upscale factor (default 1). Prefer 1 and scale the node instead. |
input_action_set Set input action
Add or replace an input action in the project's input map (project.godot), or remove it with remove: true. Keys are matched by physical position (e.g. 'A', 'Space', 'Left', 'Shift'). Undoable with edit_undo. A running game picks up changes after game_run with restart: true.
| Parameter | Type | Description |
|---|---|---|
name * | string | Action name, e.g. 'shoot' or 'move_up'. |
deadzone | number | Default 0.2. |
dry_run | boolean | |
joypad_buttons | array | |
keys | array | |
mouse_buttons | array | |
remove | boolean | Remove the action instead. |
project_setting_set Set project setting
Change one project setting from a fixed list: the main scene, the viewport size, the window size override, the stretch mode/aspect, the project name and max_fps. Anything else (rendering, physics, autoloads, input map) is refused — use the editor. Values may be sent as strings. Undoable with edit_undo; the editor window and a running game pick most settings up when they start.
| Parameter | Type | Description |
|---|---|---|
key * | string | Setting key. |
value * | New value; converted to the setting's type. | |
dry_run | boolean | Return before/after without writing. |
game_run Run game
Launch the game from the editor and wait until the MCP runtime inside it is connected. Script errors in the game are logged and auto-continued unless pause_on_error=true.
| Parameter | Type | Description |
|---|---|---|
pause_on_error | boolean | Leave the game paused in the debugger on script errors (default false). |
restart | boolean | Stop a running game first instead of failing. |
scene | string | 'main' (default), 'current' (the edited scene), or a res:// scene path. |
timeout_ms | integer | How long to wait for the game to connect (default 20000). |
game_stop Stop game
Stop the running game. Its logs stay readable with logs_read(source='game').
game_query Query running game
Read live state from the running game. With 'properties' returns those values (supports 'position:x'); without, returns the node's class, children and common properties plus script variables. It only reads properties: to call a method use game_call.
| Parameter | Type | Description |
|---|---|---|
node | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). Default: the running scene root. |
properties | array |
game_input Send input to game
Play a sequence of input steps in the running game (actions, keys, mouse), in order and with real timing; hold_frames/wait_frames count physics frames for deterministic timing. Inline set/call/assert/wait_for steps run inside the game between inputs with no time passing, so one call can set up, act and check (a failing step aborts and releases held input). Returns when the whole sequence has finished. To observe something brief (e.g. the top of a jump), pass 'record': the properties are sampled every frame while the steps run, and min/max (with times) are returned. min/max are computed from ev…
game_ui_audit Audit UI layout
Walk the Control nodes of the running game and report layout problems: Controls with no size, Controls outside the viewport or beyond their parent panel, text that needs more room than its rect (clipped) and overlapping labels. Returns the tree (path, class, rect, size, anchors, text) plus the issues, so a HUD can be checked without reading a screenshot.
| Parameter | Type | Description |
|---|---|---|
include_hidden | boolean | Also list hidden Controls (default false). |
node | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). Default: the running scene root. |
game_in_view Is a node on screen
Check whether a Node3D is inside the camera's view (not behind it, projected inside the viewport) and where it lands on screen — the 3D judgement that otherwise needs a screenshot.
| Parameter | Type | Description |
|---|---|---|
camera | string | Camera3D to use; default the active 3D camera. |
node | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). Default: the running scene root (must be a Node3D). |
game_ray Cast a ray in the running game
Cast a ray between two world-space points and return the hit position, normal, distance and collider (or hit: false). World axes do not follow a body's rotation, unlike a child RayCast3D.
| Parameter | Type | Description |
|---|---|---|
from * | World start point [x, y, z]. | |
to * | World end point [x, y, z]. | |
collide_with_areas | boolean | Include Area3D (default false). |
collide_with_bodies | boolean | Include bodies (default true). |
collision_mask | integer | Physics layers to hit (default all). |
exclude | string | CollisionObject3D to ignore (e.g. the body casting the ray). |
game_contacts Contact points of a rigid body
List a RigidBody3D's contact points, normals and the bodies they touch (contact_monitor must be on), so grounding can be read instead of inferred from a picture.
| Parameter | Type | Description |
|---|---|---|
node * | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). A RigidBody3D. |
game_set Set values in running game
Change state in the running game, e.g. to set up a test: {"score": 300, "position:x": 40, "items:2": 5}. Paths may address members, array elements and dictionary keys. Values are converted to the existing type; all of them are validated first and nothing changes if one is invalid. Returns before/after per path.
| Parameter | Type | Description |
|---|---|---|
properties * | object | Property path -> new value. |
node | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). Default: the running scene root. |
game_pause Pause / resume running game
Pause (paused: true) or resume the running game. While paused, game nodes don't run but game_query, game_set, game_call and game_wait_for still work — inspect and set up a situation across several calls without time passing, then advance with game_step. Input sent with press: true stays held while stepping.
| Parameter | Type | Description |
|---|---|---|
paused * | boolean |
game_step Advance running game by N frames
Run exactly N physics frames, then leave the game paused (pauses it first if needed). Deterministic: every pausable node gets the same N _physics_process calls, independent of call latency. press/release/tap are sent just before the first stepped frame, like real input, so the game sees them in that frame as Input.is_action_just_pressed() and as input events (tap lasts one frame) — input sent with game_input while paused can't do that.
| Parameter | Type | Description |
|---|---|---|
frames * | integer | Physics frames to run (60 per second by default). |
press | array | Actions to press before the first frame and keep held. |
release | array | Held actions to release before the first frame. |
tap | array | Actions to press for exactly the first frame. |
game_call Call method in running game
Call a method on a node in the running game (e.g. a test hook such as restart() or spawn_wave(3)) and return its result. Arguments are converted to the declared parameter types; coroutines are awaited.
| Parameter | Type | Description |
|---|---|---|
method * | string | Method name. |
args | array | Positional arguments. |
node | string | Node in the running game: relative to the running scene (e.g. 'Player') or absolute (e.g. '/root/Main/Player'). Default: the running scene root. |
timeout_ms | integer | How long to wait for the result. Default 10000. |
game_wait_for Wait for game condition
Wait until a property of a node in the running game (or the return value of one of its methods, e.g. {method: 'summary', property: 'state'}) satisfies a condition, checked every frame. Fails with TIMEOUT and the last observed value. timeout_ms=0 checks once (an assertion). op changed/increased/decreased waits for a change from the value seen when waiting starts.
| Parameter | Type | Description |
|---|---|---|
node * | string | Node in the running game, relative to the running scene (e.g. 'Player') or absolute. |
op * | string | Comparison; changed/increased/decreased compare with the value when waiting starts. |
args | array | Arguments for 'method'. |
message | string | Explains a failure in the test's words; prefixed to the error. |
method | string | Check this method's return value instead of a property, e.g. a summary() test hook. Called on every check, so it should only read state. |
property | string | Property path, e.g. 'position:x', 'items:2', or a script variable. With 'method': a path inside its return value (e.g. 'message'). |
timeout_ms | integer | Default 5000. |
tolerance | number | Allowed difference for numbers with ==, !=, >=, <= (default 0.0001). |
value | Expected value: a number, boolean, string, null or array (vectors as [x, y]). Not used by changed/increased/decreased. |
logs_read Read logs
Read captured output: prints, errors and warnings (with file/line and stack when available). source='game' (default; kept after the game stops) or 'editor'. Pass the returned 'next' as 'since' to read only new entries.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Default 200. |
min_level | string | Default 'info'. |
since | integer | Cursor from a previous call's 'next'. |
source | string |
screenshot Screenshot
Capture an image of the running game (target='game', default) or of the editor's 2D/3D viewport (target='editor'). Game captures are scaled to the project's viewport size (normalize='viewport') so repeated screenshots compare like for like; pass normalize='none' to keep the window size. The text says the size and, when it differed, the window size. Not available when running headless.
| Parameter | Type | Description |
|---|---|---|
max_width | integer | Downscale to at most this width (default 1280). |
normalize | string | Game only: scale to the project's viewport size (default) or keep the window size (editor captures are unchanged). |
target | string |
scenario_run Run scenario test
Run a scripted play-test: (re)start the game, then execute steps in order — wait_for, assert, input, query, screenshot, wait_ms, assert_no_errors, set, call, repeat — stopping at the first failure. Returns a summary with per-step result, what was checked and the observed value, game errors, and screenshots; report='full' adds the JSON report. Pass a YAML/JSON file in the project (path), a folder or a list of files (paths) to run several and get one summary, or an inline scenario. save_to keeps the screenshots and a report as files in the project. movie records every frame with Godot's Movi…
| Parameter | Type | Description |
|---|---|---|
include_screenshots | boolean | Attach screenshots as images (default true; for a folder or paths, default is failure screenshots only). |
movie | object | Record the run with Movie Maker (one scenario; needs save_to and a game window — not with --headless in Main Run Args). Waits in the scenario are game time, so prefer frame-based steps for exact tim… |
path | string | Scenario file, e.g. 'res://tests/scenarios/move.yaml', or a folder to run every .yaml/.yml/.json file in it (natural name order, so 2_ runs before 10_). |
paths | array | Several scenario files, run in the given order. |
report | string | 'summary' (default) or 'full' to also return the JSON report. |
save_to | string | Folder in the project for evidence, e.g. 'res://qa/evidence/move': every screenshot as NN-label.png, report.md and report.json (a folder run: one subfolder per scenario plus summary.md). Re-runs repla… |
scenario | Inline scenario as YAML text or an object: {name, scene?, steps: [...]}. | |
stop_on_failure | boolean | With a folder or paths: stop after the first scenario that does not pass. |
test_run Run unit tests
Run the project's unit tests with GUT or GdUnit4 (whichever is installed in addons/) in a separate headless Godot process started by the editor, and return pass/fail counts, every failing test with its message, and errors from the log. Use it for game logic; use scenario_run for play. Failing tests are a normal result (not a tool error).
| Parameter | Type | Description |
|---|---|---|
framework | string | Default 'auto': the one installed. |
path | string | Test folder or one test script, e.g. 'res://test/unit' or 'res://test/unit/test_player.gd'. Default: res://test or res://tests (GUT: the folders in res://.gutconfig.json when it exists). |
report | string | 'full' adds the JSON result with every test's status. |
test | string | GUT only: run the tests whose name contains this, e.g. 'test_jump'. |
timeout_ms | integer | Stop the run after this long (default 120000). |