Skip to content

API Reference

Complete reference for GRB commands, environment variables, and MCP tools.


Read-only commands. No side effects on game state.

CommandDescription
pingHealth check. Returns server status
auth_infoCurrent authentication state and session tier
capabilitiesList of available commands for current tier
screenshotCapture current frame as PNG
scene_treeDump full scene tree hierarchy
get_propertyRead a property from any node by path
runtime_infoEngine version, FPS, frame count, OS info
get_errorsRetrieve captured engine errors and warnings
wait_forBlock until a condition is met (node exists, signal emitted)
audio_stateAudio bus layout, volumes, effects
network_stateNetwork peer status and connection info
grb_performanceGRB-specific performance metrics
find_nodesSearch scene tree by name, class, or group

Inject user input events. Does not modify game code or state directly.

CommandDescription
clickInject mouse click at coordinates
keyInject keyboard key press
press_buttonFind and press a UI button by text or path
dragInject mouse drag from point A to point B
scrollInject mouse scroll events
gestureInject touch gestures (pinch, swipe)
gamepadInject gamepad button/axis input

Modify live game state. Use with caution.

CommandDescription
set_propertyWrite a property on any node by path
call_methodCall a method on any node by path
quitGracefully quit the running game
run_custom_commandExecute a registered custom command

Arbitrary code execution. Disabled by default.

CommandDescription
evalExecute arbitrary GDScript. Requires GDRB_TIER=3 and GDRB_ENABLE_DANGER=1

VariableDefaultDescription
GDRB_TOKEN(none)Auth token. Enables the server. Auto-generates if GODOT_DEBUG_SERVER=1
GDRB_PORT0TCP port. 0 = OS-assigned random port
GDRB_TIER1Maximum session tier (0–3)
GDRB_INPUT_MODEsyntheticsynthetic = inject InputEvents without OS cursor. os = move real cursor
GDRB_FORCE_WINDOWED(none)1 = force windowed mode at startup
GDRB_ENABLE_DANGER(none)1 = allow eval command. Also requires GDRB_TIER=3
GODOT_DEBUG_SERVER(none)Legacy activation. 1 = enable server with auto-generated token

The MCP bridge exposes GRB commands as MCP tools that Cursor and Claude Code can call directly. Each GRB command maps to a corresponding MCP tool with the grb_ prefix.

MCP tools are configured in .cursor/mcp.json:

.cursor/mcp.json
{
"mcpServers": {
"godot-runtime-bridge": {
"command": "node",
"args": ["/path/to/godot-runtime-bridge/mcp/index.js"],
"env": {
"GODOT_PATH": "/path/to/godot"
}
}
}
}
MCP ToolGRB CommandDescription
grb_launchLaunch Godot with the current project
grb_screenshotscreenshotCapture the current frame
grb_scene_treescene_treeDump the scene hierarchy
grb_clickclickClick at screen coordinates
grb_keykeyPress a keyboard key
grb_get_propertyget_propertyRead a node property
grb_set_propertyset_propertyWrite a node property
grb_runtime_inforuntime_infoGet engine and performance info

For the complete MCP tool reference, see mcp/README.md in the GRB repository.


Register custom commands by adding the GRBCommands autoload:

Path: res://addons/godot-runtime-bridge/runtime_bridge/GRBCommands.gd

Add it in Project → Project Settings → Autoload, then register callables in your game code:

example_commands.gd
func _ready():
GRBCommands.register("reset_level", _reset_level)
GRBCommands.register("set_difficulty", _set_difficulty)
func _reset_level(_args: Dictionary) -> Dictionary:
get_tree().reload_current_scene()
return {"status": "ok"}
func _set_difficulty(args: Dictionary) -> Dictionary:
var level = args.get("level", 1)
GameState.difficulty = level
return {"status": "ok", "difficulty": level}

Invoke via the run_custom_command GRB command or the corresponding MCP tool.