golem-mcp

v3.0.0
golem-mcp Checked 18 hours ago Published 9 months ago

MCP bridge — connects AI coding agents to Godot 4.x via TCP

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

godot_get_scene_tree

Get the full node hierarchy of the currently edited scene. Use this to understand scene structure, verify nodes after add/delete operations, or plan modifications. For detailed properties of a single node, use godot_inspect_node instead. For a broad project overview (settings, autoloads, file lists), use godot_project_context instead. Returns the tree with indentation showing parent-child relationships. Safe to call while a game is running (reads the editor scene, not the running game). Args: detail_level: "full" (default) includes script paths on each node.…

ParameterTypeDescription
detail_levelstring

godot_inspect_node

Get all properties, signals, and groups of a specific node in the edited scene. Use this when you need to read or verify property values on a known node. Use godot_get_scene_tree first if you don't know the node path. Args: path: Node path relative to scene root. Use "." for the root node, "Player" for a direct child, "Player/Sprite" for nested nodes. detail_level: "full" (default) shows all editor-visible properties, signals with connections, and groups. "summary" shows only type, path, script, and transform properties (position, rotation, scale, size, visible).…

ParameterTypeDescription
path *string
detail_levelstring

godot_get_editor_screenshot

Capture a screenshot of the Godot editor's 2D/3D viewport (not the running game). Use this to see the current scene layout, verify visual changes after node operations, or audit the design. For screenshots of the running game, use godot_get_game_screenshot instead (requires the game to be playing).

godot_get_game_screenshot

Capture a screenshot of the currently running game window. REQUIREMENTS: The game must be playing (call godot_play_scene first) and the GolemCapture autoload must be active in the project (added automatically by the Golem installer). Uses a file-based protocol — GolemCapture in the game process captures and writes the screenshot, then the editor plugin reads it. This may take 1-2 seconds. WARNING: May fail right after play_scene due to TCP reconnect timing. Built-in retry handles this. For editor viewport screenshots (no game running), use godot_get_editor_screensho…

godot_play_scene

Start playing a scene in the Godot editor (equivalent to pressing F5/F6). Only one scene can run at a time. Call godot_stop_scene first if a scene is already running. After starting, use godot_get_logs and godot_get_game_screenshot to observe the game. Save your scene (godot_save_scene) before playing to ensure changes are included. Args: path: Scene file path (e.g. "res://scenes/main.tscn"). Empty string plays the current scene. If no main scene is set and path is empty, plays the currently edited scene.

ParameterTypeDescription
pathstring

godot_stop_scene

Stop the currently running game scene. Waits until Godot has fully torn down the game process before returning (deferred). This means you can safely call godot_play_scene immediately after without getting "A scene is already running" errors. Typical workflow: stop_scene → modify scene/scripts → save_scene → play_scene.

godot_get_errors

Get GDScript compilation errors and runtime errors captured by the editor. Returns errors accumulated since the last clear_logs call. Includes both parse/compile errors (from script saves) and runtime errors (from the running game). Reliable even right after play_scene (unlike screenshots, this rarely fails).

godot_clear_logs

Clear all error records, game log files, and engine log cursors. Resets: the error buffer (get_errors), the game log file (GolemCapture logs), the engine log read position, and input simulation files. Call this before a test run to get a clean slate. Note: play_scene also resets game logs automatically.

godot_execute_script

Execute GDScript code in the EDITOR context (not the running game) and return the result. The code is wrapped in a function body and compiled at runtime. Use 'return <value>' to get a result back. Best for: assigning Resources (load()), setting SpriteFrames, enabling unique_name_in_owner, reading data. CRITICAL LIMITATIONS: - NO await allowed (editor @tool context). Use godot_write_script for async code. - Runs in EDITOR, not the game. Cannot access game autoloads (GameState, etc.). - Keep scripts simple — complex arrays + loops + string concat may fail (error code…

ParameterTypeDescription
code *string

godot_view_script

Read the content of a GDScript (.gd) or shader (.gdshader) file from the Godot project. Resolves res:// paths through Godot, so it works even if the project is in a non-standard location. For writing scripts, use godot_write_script instead. Args: path: Script file path (e.g. "res://scripts/player.gd", "res://shaders/outline.gdshader").

ParameterTypeDescription
path *string

godot_write_script

Write or overwrite a GDScript file in the project. Creates directories if needed. Godot auto-reloads scripts on save, so changes take effect immediately in the editor. After writing, attach the script to a node with godot_attach_script if it's a new file. Args: path: File path (e.g. "res://scripts/player.gd"). Auto-prefixed with res:// if missing. content: Full GDScript source code to write. Must include the complete file content (not a diff).

ParameterTypeDescription
content *string
path *string

godot_attach_script

Attach an existing GDScript file to a node in the currently edited scene. The script must already exist on disk (use godot_write_script first). Call godot_save_scene after to persist the attachment. Args: node: Node path relative to scene root (e.g. "Player", "UI/HUD"). Use "." for the root node. script: Script file path (e.g. "res://scripts/player.gd"). Must be a valid res:// path.

ParameterTypeDescription
node *string
script *string

godot_get_logs

Get logs from the running game or the Godot engine. INCREMENTAL: each call returns only NEW lines since the last call. Game logs require GolemCapture.game_log("msg") in your scripts — standard print() goes to stdout and is NOT captured. Engine logs come from Godot's godot.log file. Use godot_clear_logs to reset read positions. godot_play_scene also resets game logs. Args: max_lines: Maximum number of log lines to return. Default 100. source: "game" for GolemCapture output, "engine" for Godot engine logs, "all" for both. Default "game".

ParameterTypeDescription
max_linesinteger
sourcestring

godot_simulate_input

Simulate input actions in the running game via GolemCapture (file-based protocol). The game must be playing (call godot_play_scene first). Sends a sequence of input steps that GolemCapture executes in order. Only works with named Input Map actions — does NOT simulate raw mouse/keyboard events. Step types: - {"action": "move_right", "duration": 2.0} — press, hold N sec, release - {"wait": 0.5} — pause N seconds between steps - {"action": "jump", "pressed": true} — toggle on (no auto-release) - {"action": "jump", "pressed": false} — toggle off…

ParameterTypeDescription
sequence *array
loopinteger
timeoutnumber

godot_add_node

Add a single new node to the currently edited scene. For creating multiple nodes at once (with hierarchy and properties), use godot_add_nodes instead. This tool creates a bare node with no properties set — use godot_update_property after. IMPORTANT: call godot_save_scene after adding nodes to persist changes to disk. Args: type: Godot node class name (e.g. "Sprite2D", "CharacterBody2D", "Label", "Area2D"). name: Name for the new node. Auto-generated from type if empty. parent: Path to parent node relative to scene root (e.g. "Player", "UI/HUD"). Empt…

ParameterTypeDescription
namestring
parentstring
typestring
unique_nameboolean

godot_delete_node

Delete a node and all its children from the currently edited scene. Cannot delete the scene root node. Call godot_save_scene after to persist the change. Args: path: Node path relative to scene root (e.g. "Player", "UI/OldButton"). Cannot be ".".

ParameterTypeDescription
path *string

godot_update_property

Set a property value on a node in the currently edited scene. Supports automatic type conversion: arrays → Vector2/Vector3/Rect2/Color, strings → Color ("#ff0000"), res:// strings → loaded Resources, dicts with "type" → new Resource instances. If type conversion fails (e.g. complex Resources like SpriteFrames), use godot_execute_script with load() instead. IMPORTANT: call godot_save_scene after to persist changes. Args: path: Node path relative to scene root. Use "." for the root node. property: Property name (e.g. "position", "modulate", "text", "…

ParameterTypeDescription
path *string
property *string
value *string

godot_move_node

Reparent a node (and its children) to a different parent in the scene tree. Call godot_save_scene after to persist. Args: path: Current node path relative to scene root. new_parent: Path to the new parent node relative to scene root.

ParameterTypeDescription
new_parent *string
path *string

godot_duplicate_node

Duplicate a node and all its children as a sibling in the scene tree. The duplicate gets an auto-incremented name (e.g. "Sprite2" if "Sprite" is duplicated). Call godot_save_scene after to persist. Args: path: Node path to duplicate relative to scene root.

ParameterTypeDescription
path *string

godot_add_nodes

Create an entire node hierarchy in one call (batch). Preferred over multiple add_node calls. Supports nested children and property assignment with automatic type conversion (Vector2, Color, etc.). IMPORTANT: Resource properties (Texture, SpriteFrames, Material, Theme) passed as res:// strings will return an error if the resource file doesn't exist. For complex Resources, use godot_execute_script with load() after creating nodes. IMPORTANT: call godot_save_scene after to persist the new nodes. Args: nodes: Array of node specs. Each spec is a dict with:…

ParameterTypeDescription
nodes *array

godot_create_scene

Create a new .tscn scene file, save it to disk, and open it in the editor. Creates parent directories if they don't exist. After creation, the scene is the active edited scene and you can immediately add nodes to it. Args: path: Scene file path (e.g. "res://scenes/main.tscn"). Auto-adds res:// prefix and .tscn extension if missing. root_type: Root node class (e.g. "Node2D", "Node3D", "Control", "CharacterBody2D"). Default "Node2D". root_name: Name for root node. Default = derived from filename.

ParameterTypeDescription
path *string
root_namestring
root_typestring

godot_open_scene

Open an existing .tscn scene file in the editor, making it the active edited scene. If a game is currently running, it will NOT be stopped — but the edited scene context changes. Call godot_stop_scene first if you need to stop the game before switching scenes. After opening, use godot_get_scene_tree to see the scene's node hierarchy. Args: path: Scene file path (e.g. "res://scenes/main.tscn"). Auto-prefixed with res:// if missing.

ParameterTypeDescription
path *string

godot_find_nodes

Search the edited scene tree for nodes matching one or more filters. At least one filter required. Useful to find nodes by type ("all Area2D nodes"), by group, by name pattern, or by attached script. Returns node paths, types, script paths, and groups for each match. Args: type: Godot class name (e.g. "Label", "Area2D"). Matches subclasses too (e.g. "Control" matches Button, Label, etc.). group: Group name (e.g. "enemies", "saveable"). name: Name pattern with optional * wildcards (e.g. "Score*", "*Button", "*Health*"). Case-insensitive. script: Scr…

ParameterTypeDescription
groupstring
max_resultsinteger
namestring
scriptstring
typestring

godot_create_sprite_frames

Create a SpriteFrames resource with animations and optionally assign it to an AnimatedSprite2D node. Replaces the common 10+ line execute_script pattern for setting up SpriteFrames. If node_path is provided, the resource is assigned to that node's sprite_frames property. IMPORTANT: call godot_save_scene after to persist changes. Args: animations: Array of animation specs. Each spec is a dict with: - name: Animation name (e.g. "idle", "run", "attack"). Required. - fps: Playback speed in frames per second. Default 5. - loop: Whether t…

ParameterTypeDescription
animations *array
node_pathstring

godot_get_input_map

Get all custom input actions defined in the project and their key/button bindings. Returns only actions defined in Project Settings > Input Map (not built-in Godot actions). NOTE: this reads from the editor's Input Map, which may not include actions added at runtime. For the raw [input] section, read project.godot directly.

godot_project_settings

Read or modify Godot project settings (project.godot). Changes are persisted by Godot automatically. IMPORTANT: always use the full path format for keys: "display/window/size/viewport_width" (not the .ini section format "window/size/viewport_width" under [display]). Verify changes with action="get" after setting. Args: action: "list" to show common settings, "get" to read a specific setting, "set" to modify one. key: Full setting key path (e.g. "application/config/name", "display/window/size/viewport_width"). Required for get/set. value: New value (onl…

ParameterTypeDescription
actionstring
keystring
valuestring

godot_save_scene

Save the currently edited scene to its .tscn file on disk. REQUIRED after any scene modification: add_node(s), delete_node, update_property, move_node, duplicate_node, attach_script, or execute_script that modifies the scene tree. Without saving, changes exist only in editor memory and will be lost.

godot_project_context

Get a comprehensive project overview in one call — ideal as a first tool call to understand the project. Returns: project name, viewport size, renderer, autoloads, custom input actions, and lists of all .gd/.tscn/.tres files (excluding addons/). Use this instead of multiple project_settings + get_input_map calls. For the scene tree of the currently open scene, use godot_get_scene_tree instead.

godot_list_resources

List project files filtered by type/extension and directory. Scans the project (excluding addons/ and hidden directories) and returns file paths sorted by directory. Use this to discover assets, scripts, scenes, or resources in the project. For a full project overview (settings + autoloads + files), use godot_project_context instead. Args: type: File extension filter (e.g. "gd", "tscn", "tres", "png", "wav", "gdshader"). Empty = all common types. path: Directory to scan (e.g. "res://scenes/", "res://assets/"). Default "res://" (whole project). max_resu…

ParameterTypeDescription
max_resultsinteger
pathstring
typestring

godot_get_signals

List all signals of a node and their current connections in the edited scene. Shows signal signatures (name + argument types) and connected targets (node path, method, flags). Use this to understand signal wiring before connecting or debugging signal flow. For general node inspection (properties, groups), use godot_inspect_node instead. Args: path: Node path relative to scene root. Use "." for root, "Player" for direct child, "Player/Sprite" for nested.

ParameterTypeDescription
path *string

godot_connect_signal

Connect a signal between two nodes in the edited scene. The connection is persisted when you call godot_save_scene (serialized in the .tscn file). Validates that the signal exists and isn't already connected. Use godot_get_signals first to see available signals and existing connections. Args: source: Path to the node emitting the signal (e.g. "Player", "UI/Button"). signal_name: Signal name (e.g. "pressed", "body_entered", "health_changed"). target: Path to the node receiving the signal (e.g. ".", "Player/HealthBar"). method: Method name on the…

ParameterTypeDescription
method *string
signal_name *string
source *string
target *string

godot_set_anchor

Set anchor preset on a Control node, properly resetting offsets (fixes the common anchors_preset pitfall). By default uses set_anchors_and_offsets_preset() which resets both anchors AND offsets — the correct way to apply layout presets. Set keep_offsets=True to only change anchors (preserving current offsets). IMPORTANT: call godot_save_scene after to persist changes. Args: path: Node path relative to scene root (e.g. "UI/Panel", "HUD/HealthBar"). preset: Layout preset name. Options: "full_rect", "center", "center_top", "center_bottom", "center_l…

ParameterTypeDescription
path *string
keep_offsetsboolean
presetstring

godot_add_resource

Create a standalone .tres resource file and save it to disk. Creates any Resource subclass (StyleBoxFlat, GradientTexture2D, Theme, AudioBusLayout, etc.), sets properties using the same conversion rules as godot_update_property, and saves to a .tres file. After creation, the resource can be loaded with load("res://path.tres") or assigned via godot_update_property. Args: type: Godot Resource class name (e.g. "StyleBoxFlat", "GradientTexture2D", "Theme", "RectangleShape2D"). path: Save path (e.g. "res://resources/my_style.tres"). Auto-prefixed with res:// and .t…

ParameterTypeDescription
path *string
type *string
properties

godot_create_theme

Create a complete Godot Theme resource in one call. Replaces the verbose 100+ line execute_script pattern. Generates a .tres file with colors, fonts, font sizes, styleboxes, and constants, all properly typed. Much more reliable than execute_script for theme creation — no string escaping issues, no code 36 errors. Args: path: Save path for the theme file (e.g. "res://theme.tres"). Default "res://theme.tres". colors: Color overrides. Format: {"color_name": {"Component": "#hex_or_rgba"}}. Example: {"font_color": {"Label": "#e8e8e8", "Button": "#ffffff"}…

ParameterTypeDescription
apply_globalboolean
colors
constants
font_sizes
fonts
pathstring
styleboxes

godot_edit_script

Find-and-replace text in a GDScript file without rewriting the entire file. Preferred over godot_write_script when making small, targeted changes (renaming a variable, changing a value, modifying a function signature). Godot auto-reloads the script after the edit. If old_text appears multiple times and replace_all is False, the tool returns an error asking you to either provide more context or set replace_all=True. Args: path: Script file path (e.g. "res://scripts/player.gd"). Auto-prefixed with res:// if missing. old_text: Exact text to find in the file.…

ParameterTypeDescription
new_text *string
old_text *string
path *string
replace_allboolean