/godot-stagehand:stagehandfrom Godot Stagehand
Launches, connects, and interacts with Godot games via the godot-stagehand MCP server. Handles game launch, visual inspection, gameplay interaction, automated testing, and input recording/replay.
Ships in Godot Stagehand. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert at using the godot-stagehand MCP tools to launch, observe, and interact with Godot games. This skill teaches you how to automate any Godot game that has the Stagehand addon installed.
Claude --stdio--> godot-stagehand (Go MCP server) --WebSocket:26700--> Godot Game
└── StagehandServer autoload
└── JSON-RPC command router
The MCP server runs as a child process of your agent client. With the Claude Code plugin, the plugin starts it for you; in other clients it is an mcpServers entry you configure. It connects to the Godot game's WebSocket server on port 26700 (configurable). The Stagehand addon runs inside Godot as an autoload singleton.
addons/stagehand/ addon installed and enabled--stagehand CLI flag OR STAGEHAND_ENABLED=1 environment variablegodot-stagehand MCP server must be connected: the Claude Code plugin provides it, other clients configure it in their MCP settingsIf the project has no addons/stagehand/ directory yet, install the addon from the Godot project's root:
godot-stagehand setup .
With the Claude Code plugin, godot-stagehand is already on the Bash tool's PATH (the plugin's launcher is ${CLAUDE_PLUGIN_ROOT}/bin/godot-stagehand); it downloads the matching release binary on first use. setup copies the addon, enables the plugin, registers the StagehandServer autoload, and prints an MCP configuration snippet. Under the plugin, ignore that snippet: the plugin already connects the server, and adding a second entry makes every tool appear twice. Use godot-stagehand setup --force . to replace an older addon after an upgrade.
godot_launchLaunch a Godot game with stagehand enabled and connect to it.
| Parameter | Required | Default | Description |
|---|---|---|---|
project_path | yes | — | Path to the Godot project directory (contains project.godot) |
godot_bin | no | auto-detect | Path to the Godot binary |
host | no | 127.0.0.1 | WebSocket host |
port | no | 0 | TCP port for the WebSocket server (0 auto-assigns a free port, keeping the instance private to you) |
headless | no | true | Launch Godot in headless mode |
expect_screenshots | no | false | Reject headless=true for screenshot/baseline/diff workflows |
allow_unsafe | no | false | Enable godot_evaluate and unrestricted godot_call_method (blocked-method list lifted) for this launched session. Off by default — without it those requests are refused |
share_user_data | no | false | Use the project's real user:// directory instead of a private throwaway one. Default: each launch gets an isolated user://, so concurrent instances cannot corrupt each other's saves, but nothing written survives the instance. Set true only when you need persistent save data and run a single instance |
extra_args | no | [] | Extra command-line arguments for the Godot binary |
timeout_ms | no | 30000 | Maximum time to wait for Godot to start (min: 1000) |
godot_launch(project_path="/path/to/project", headless=false, timeout_ms=45000)
godot_connectConnect to an already-running Godot game with stagehand enabled.
Prefer
godot_launch. The addon accepts many clients into one SceneTree and 26700 is its default port, so connecting with defaults can attach you to a game another agent started — you would then both mutate the same tree. Launching your own instance (port=0, auto-assigned) is the paved road; usegodot_connectonly for a game you know is yours, and pass its explicitport. When the MCP server runs withSTAGEHAND_MULTI=1,portis mandatory here.
| Parameter | Required | Default | Description |
|---|---|---|---|
host | no | 127.0.0.1 | WebSocket host |
port | no | 26700 | WebSocket port — the shared default; pass the port your own instance printed |
godot_connect(host="127.0.0.1", port=26700)
Host selection: use
127.0.0.1when Godot andgodot-stagehandrun in the same OS/network namespace, including Linux Godot inside WSL. If Godot runs as a Windows binary and the MCP client runs in WSL, uselocalhostonly under WSL mirrored networking (networkingMode=mirrored). On a NAT/default WSL network, dial the default-gateway IP instead (it is the Windows host and changes across reboots):ip route show default | awk '/default/ {print $3}' # -> host for godot_connect
godot_statusShow all active Godot connections (instance ID, connection state) and process information. Read-only; no parameters. Call it first when unsure whether you are already connected.
godot_status()
godot_list_instancesList every Godot connection this MCP server manages: id, host, port, pid, connected for each. Read-only; no parameters.
godot_list_instances()
godot_disconnectDisconnect and remove a named instance.
| Parameter | Required | Default | Description |
|---|---|---|---|
instance_id | yes | — | ID of the instance to disconnect (see godot_list_instances) |
godot_disconnect(instance_id="default")
godot_get_game_stateGet current game state: scene name, FPS, physics state, window size. No parameters.
godot_get_game_state()
godot_change_sceneChange to a different scene in the running game.
| Parameter | Required | Default | Description |
|---|---|---|---|
scene_path | yes | — | Resource path (e.g. res://scenes/main_menu.tscn) |
godot_change_scene(scene_path="res://scenes/main_menu.tscn")
godot_get_treeGet a snapshot of the Godot scene tree.
| Parameter | Required | Default | Description |
|---|---|---|---|
root_path | no | /root | Subtree root path |
max_depth | no | 10 | Maximum recursion depth (1-50) |
include_properties | no | [] | Property names to include per node |
godot_get_tree(max_depth=3)
godot_get_tree(root_path="/root/Main/UI", include_properties=["visible", "modulate"])
godot_find_nodesFind nodes matching a selector expression.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Selector expression (see Selector Syntax below) |
properties | no | [] | Property names to return per matched node |
limit | no | 50 | Maximum results (1-500) |
godot_find_nodes(selector="class:Button", properties=["text", "visible"])
godot_find_nodes(selector="name:*Player*")
godot_find_nodes(selector="class:Panel >> text:Submit")
godot_get_accessibility_treeSemantic view of the UI: roles (button, check_box, text_field, ...), accessible names, values, and states. Derived from the Control hierarchy plus author-set accessibility properties (responses carry source="derived", not Godot's real AccessKit tree). Requires Godot 4.5+. Prefer it over godot_get_tree when you want to know what a UI means rather than how it is built.
| Parameter | Required | Default | Description |
|---|---|---|---|
root_path | no | scene root | Subtree to start from |
max_depth | no | see tool | Maximum depth to walk |
instance_id | no | default | Instance to target |
godot_get_accessibility_tree(max_depth=4)
godot_get_propertyRead a property from a node (supports dot notation like position.x).
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Target node selector |
property | yes | — | Property name (supports dot notation) |
godot_get_property(selector="class:Player", property="position")
godot_get_property(selector="name:HealthBar", property="value")
godot_get_property(selector="/root/Main/Score", property="text")
godot_set_propertySet a property on a node.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Target node selector |
property | yes | — | Property name |
value | yes | — | New property value |
godot_set_property(selector="name:Player", property="position", value={"x": 100, "y": 200})
godot_set_property(selector="class:Label", property="text", value="Hello World")
godot_clickClick on a node or at screen coordinates.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | no* | — | Node to click |
position | no* | — | Screen coordinates {x, y} |
button | no | left | Mouse button: left, right, middle |
double_click | no | false | Whether to double-click |
*One of selector or position is required.
godot_click(selector="text:Start Game")
godot_click(selector="class:Button >> text:OK")
godot_click(position={"x": 400, "y": 300}, button="right")
godot_press_keySimulate a keyboard key press.
| Parameter | Required | Default | Description |
|---|---|---|---|
key | yes | — | Key name (e.g. Enter, Space, W, Escape) |
modifiers | no | [] | Modifier keys: shift, ctrl, alt, meta |
hold_ms | no | 100 | How long to hold the key in milliseconds |
godot_press_key(key="Enter")
godot_press_key(key="S", modifiers=["ctrl"])
godot_press_key(key="Space", hold_ms=2000)
godot_focus_windowGive window focus to a Window (e.g. a modal dialog) so godot_press_key reaches it. Use it when godot_press_key refuses because a modal dialog is visible but lacks window focus. With no selector, it targets the visible modal subwindow that lost focus.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | no | auto-target | Window to focus, e.g. class:AcceptDialog or name:SplashDialog |
instance_id | no | default | Instance to target |
godot_focus_window(selector="class:AcceptDialog")
godot_press_actionSimulate a Godot input action (as defined in the project's Input Map).
| Parameter | Required | Default | Description |
|---|---|---|---|
action | yes | — | Input action name (e.g. ui_accept, move_left) |
strength | no | 1.0 | Action strength (0.0-1.0) |
hold_ms | no | 100 | How long to hold the action in milliseconds |
godot_press_action(action="ui_accept")
godot_press_action(action="move_right", hold_ms=2000)
godot_press_action(action="jump", strength=0.5)
godot_type_textSend text input to the focused control.
| Parameter | Required | Default | Description |
|---|---|---|---|
text | yes | — | Text to type |
delay_ms | no | 50 | Delay between characters in milliseconds |
selector | no | — | Optional node to click first to gain focus |
godot_type_text(text="player_name", selector="class:LineEdit")
godot_type_text(text="Hello World")
godot_mouse_moveMove mouse cursor without clicking.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | no* | — | Node whose center to move to |
coordinates | no* | — | Absolute screen coordinates {x, y} |
*One of selector or coordinates is required.
godot_mouse_move(selector="class:Button")
godot_mouse_move(coordinates={"x": 200, "y": 150})
godot_touchSimulate touch screen events.
| Parameter | Required | Default | Description |
|---|---|---|---|
position | yes | — | Screen coordinates {x, y} for touch start |
index | no | 0 | Touch finger index (0-9 for multi-touch) |
action | no | tap | Touch action: tap, begin, move, end |
drag_to | no | — | Drag destination coordinates {x, y} |
duration_ms | no | 100 | Duration before releasing |
godot_touch(position={"x": 400, "y": 300})
godot_touch(position={"x": 100, "y": 200}, drag_to={"x": 300, "y": 200}, action="tap")
godot_screenshotCapture a screenshot of the game viewport.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | no | — | Crop to this node's bounding rect |
full_page | no | true | Capture the full viewport |
godot_screenshot()
godot_screenshot(selector="class:InventoryPanel")
godot_screenshot_save_baselineCapture a screenshot and save it as a named baseline for future comparison.
| Parameter | Required | Default | Description |
|---|---|---|---|
name | yes | — | Baseline name (used as filename) |
selector | no | — | Crop to this node's bounding rect |
godot_screenshot_save_baseline(name="main_menu")
godot_screenshot_save_baseline(name="inventory_open", selector="class:InventoryPanel")
godot_screenshot_diffCompare current screenshot against a saved baseline.
| Parameter | Required | Default | Description |
|---|---|---|---|
name | yes | — | Baseline name to compare against |
selector | no | — | Crop to this node's bounding rect |
threshold | no | 0.0 | Max acceptable fraction of differing pixels (0.0-1.0) |
pixel_sensitivity | no | 0.0 | Per-pixel color delta tolerance (0.0-1.0) |
godot_screenshot_diff(name="main_menu")
godot_screenshot_diff(name="hud", threshold=0.01, pixel_sensitivity=0.05)
godot_wait_for_nodeWait for a node matching a selector to reach a desired state.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Selector for the node to wait for |
state | no | exists | State to wait for: exists, visible, removed |
timeout_ms | no | 10000 | Maximum wait time (1-60000) |
poll_interval_ms | no | 100 | Polling interval (10-5000) |
godot_wait_for_node(selector="class:MainMenu", state="visible")
godot_wait_for_node(selector="class:LoadingScreen", state="removed", timeout_ms=30000)
godot_wait_for_signalWait for a specific signal to be emitted on a node.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Selector for the node that emits the signal |
signal_name | yes | — | Name of the signal to wait for |
timeout_ms | no | 5000 | Maximum wait time (1-60000) |
godot_wait_for_signal(selector="class:AnimationPlayer", signal_name="animation_finished")
godot_wait_for_signal(selector="/root/Main", signal_name="level_loaded", timeout_ms=15000)
godot_wait_for_propertyWait for a node's property to satisfy a condition.
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Selector for the node |
property | yes | — | Property name to monitor |
operator | yes | — | Comparison: equals, not_equals, exists, contains, greater_than, less_than |
expected_value | no* | — | Value to compare against (*required unless operator is exists) |
timeout_ms | no | 10000 | Maximum wait time (1-60000) |
poll_interval_ms | no | 100 | Polling interval (10-5000) |
godot_wait_for_property(selector="class:HealthBar", property="value", operator="less_than", expected_value=50)
godot_wait_for_property(selector="name:Player", property="is_grounded", operator="equals", expected_value=true)
godot_call_methodCall a method on a node. Some destructive/private methods are blocked for safety unless the game was launched with godot_launch(allow_unsafe=true).
| Parameter | Required | Default | Description |
|---|---|---|---|
selector | yes | — | Target node selector |
method | yes | — | Method name to call |
args | no | [] | Arguments to pass |
allow_multiple | no | false | Allow calling on multiple matched nodes |
Blocked methods: free, queue_free, set_script, add_child, remove_child, queue_redraw, notification, propagate_notification, set_process, set_physics_process, and any method starting with _.
godot_call_method(selector="class:AudioManager", method="play_sfx", args=["click"])
godot_call_method(selector="name:Enemy", method="take_damage", args=[25])
godot_evaluateEvaluate a GDScript expression in the running game. Powerful but dangerous. Requires unsafe mode: the game must have been launched with godot_launch(allow_unsafe=true); otherwise the request is refused.
| Parameter | Required | Default | Description |
|---|---|---|---|
expression | yes | — | GDScript expression to evaluate |
context_node | no | — | Optional node path to use as self context |
godot_evaluate(expression="get_tree().current_scene.name")
godot_evaluate(expression="Engine.get_frames_per_second()")
godot_evaluate(expression="score", context_node="/root/Main/GameManager")
godot_get_performanceGet performance metrics from the Godot Performance singleton.
| Parameter | Required | Default | Description |
|---|---|---|---|
monitors | no | default set | Performance monitor names (e.g. TIME_FPS, MEMORY_STATIC) |
godot_get_performance()
godot_get_performance(monitors=["TIME_FPS", "OBJECT_COUNT", "RENDER_TOTAL_DRAW_CALLS_IN_FRAME"])
godot_assert_performanceAssert that a performance monitor meets a threshold. Returns pass/fail.
| Parameter | Required | Default | Description |
|---|---|---|---|
monitor | yes | — | Performance monitor name |
threshold | yes | — | Threshold value |
op | no | lte | Comparison: lt, lte, gt, gte, eq |
godot_assert_performance(monitor="TIME_FPS", threshold=30, op="gte")
godot_assert_performance(monitor="MEMORY_STATIC", threshold=536870912, op="lte")
Recordings are versioned JSON — see recording-format.md.
godot_record_startStart recording player input. Returns {recording, session_id, output_path}.
| Parameter | Required | Default | Description |
|---|---|---|---|
output_path | no | user://stagehand_recordings/<session_id>.json | Where to save the recording, inside user://stagehand_recordings/ (e.g. run1.json or runs/run1.json). res://, absolute and .. paths are refused. Missing directories are created. |
include_mouse_move | no | false | Capture mouse-motion events too. Off by default — motion dominates a recording's size and is rarely what a repro depends on. |
godot_record_start(output_path="test_run.json")
godot_record_start() # addon picks the path
godot_record_start(include_mouse_move=true) # keep drag paths
godot_record_stopStop an active recording and write it to disk. No parameters.
Returns {session_id, events_count, duration_ms, path}.
godot_record_stop()
godot_replayReplay a previously recorded input session.
Returns {replayed, events_count, duration_ms}.
| Parameter | Required | Default | Description |
|---|---|---|---|
recording_path | yes | — | Recording to replay, inside user://stagehand_recordings/ — the path record_stop returned, or a relative name like run1.json |
speed | no | 1.0 | Playback speed multiplier; must be > 0. 4.0 replays four times as fast — use it to shorten CI runs. |
wait_for_ready | no | true | Wait for the current scene to exist before injecting the first event |
input_path | no | — | Deprecated alias for recording_path |
godot_replay(recording_path="test_run.json")
godot_replay(recording_path="test_run.json", speed=4.0)
Replay honors each event's recorded offset, so the sequence keeps its relative timing. It reproduces a rough repro case, not a frame-perfect deterministic run — game state during replay still depends on frame timing.
Selectors identify nodes in the Godot scene tree. They are validated on the Go side before being sent to the addon.
| Prefix | Description | Example |
|---|---|---|
| (none) | Exact node path | /root/Main/Player |
name: | Match by node name (supports * wildcards) | name:*Player* |
class: | Match by class/type | class:Button |
group: | Match by group membership | group:enemies |
text: | Match by text content (Labels, Buttons) | text:Submit |
meta: | Match by metadata attribute | meta:id=submit_btn |
unique: | Match by unique identifier | unique:main-menu-play |
>>Chain selectors to narrow scope. Each segment filters within the results of the previous one:
class:Panel >> text:OK # Find "OK" text inside any Panel
name:Inventory >> class:Button # Find Buttons inside the Inventory node
group:ui >> class:Label >> text:Score # Label with "Score" text, in a node in the "ui" group
The name: selector supports * wildcards:
name:*Player* # Any node with "Player" in the name
name:Enemy_* # Nodes starting with "Enemy_"
name:*_Label # Nodes ending with "_Label"
1. godot_launch(project_path="/path/to/project", headless=false, timeout_ms=45000)
2. godot_get_game_state() # Confirm scene, FPS, window
3. godot_screenshot() # Visual confirmation
1. godot_wait_for_node(selector="class:MainMenu", state="visible")
2. godot_screenshot()
3. godot_click(selector="text:Play")
4. godot_wait_for_node(selector="class:MainMenu", state="removed")
5. godot_wait_for_node(selector="class:GameWorld", state="visible")
6. godot_screenshot()
1. godot_click(selector="class:Dialog >> text:Confirm")
2. godot_wait_for_node(selector="class:Dialog", state="removed")
3. godot_screenshot()
1. godot_type_text(text="player1", selector="name:UsernameField")
2. godot_type_text(text="password123", selector="name:PasswordField")
3. godot_click(selector="text:Login")
4. godot_wait_for_node(selector="class:LoginScreen", state="removed")
1. godot_launch(project_path="...", headless=false)
2. godot_wait_for_node(selector="class:MainMenu", state="visible")
3. godot_screenshot_save_baseline(name="main_menu")
4. # ... make code changes, relaunch ...
5. godot_wait_for_node(selector="class:MainMenu", state="visible")
6. godot_screenshot_diff(name="main_menu", threshold=0.01)
1. godot_get_performance()
2. godot_press_action(action="move_right", hold_ms=5000)
3. godot_assert_performance(monitor="TIME_FPS", threshold=30, op="gte")
1. godot_record_start(output_path="menu_flow.json")
2. # ... interact with the game manually or via other tools ...
3. godot_record_stop() # -> {session_id, events_count, duration_ms, path}
4. # Later, replay it — at 4x to keep a CI run short:
5. godot_replay(recording_path="menu_flow.json", speed=4.0)
1. godot_press_action(action="interact")
2. godot_wait_for_property(selector="name:Door", property="is_open", operator="equals", expected_value=true)
3. godot_screenshot()
godot_launch or godot_connect before any other tool.--stagehand flag / STAGEHAND_ENABLED=1 env var.godot_launch reported (it auto-assigns with port=0); only a game you started yourself on the addon default is on 26700.timeout_ms on launch, or retry godot_connect after a few seconds.headless: true) cannot produce meaningful screenshots — use headless: false.timeout_ms values (45000-90000) for cold starts.project_path contains a valid project.godot file.name:, class:, group:, text:, meta:, unique:.>> (with spaces)._ (private/lifecycle) are blocked.free, queue_free, set_script, add_child, remove_child, etc.) are blocked.godot_launch(allow_unsafe=true), then use godot_call_method or godot_evaluate (with caution). Both are refused without it.port=0 (the default) so a free port is auto-assigned, or kill the stale process.godot_wait_for_node before clicking UI that may not be ready yet.godot_press_action over godot_press_key. Actions are project-defined and self-documenting; raw keys are fragile.headless: false for visual tests. Screenshots require a visible window.headless: true for structural tests. Faster startup when you only need find_nodes, get_tree, evaluate.godot_get_game_state + godot_get_tree(max_depth=3) to understand the current scene structure.class:Panel >> text:OK is safer than just text:OK which may match multiple nodes.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mrf/godot-stagehand --plugin godot-stagehand