Skip to main content
Glama
README.md
# godot-mcp

[![Glama Score](https://glama.ai/mcp/servers/CodyKlimkofski/godot-mcp/badges/score.svg)](https://glama.ai/mcp/servers/CodyKlimkofski/godot-mcp)

Zero-setup Godot 4.x MCP server for scene authoring, cached ClassDB docs, headless diagnostics, and deterministic TAS-style game playtesting.

![godot-mcp demo: ClassDB docs, atomic 3D scene authoring, mid-air ScriptBacktrace capture, and native 2x2 filmstrip playtesting](https://raw.githubusercontent.com/CodyKlimkofski/godot-mcp/main/docs/demo.gif)

- **No `res://addons/` plugin required** — works on any Godot 4.x repo while keeping `git status` clean.
- **Godot `>= 4.0`** (`>= 4.5` unlocks `OS.add_logger()` + `ScriptBacktrace` structured stack traces; `4.0–4.4` and pre-boot parse errors fall back to `stderr`).
- **Node.js `>= 20.0.0`** with zero native C++ addons.

## 60-Second Quickstart

### `npx` (recommended)

```bash
npx -y @codyklim/godot-mcp --version
```

### Homebrew (macOS / Linux)

```bash
brew tap CodyKlimkofski/tap
brew install godot-mcp
```

### CLI Options & Godot Discovery

```text
godot-mcp [--project <path>] [--godot-path <path>] [-v|--version] [-h|--help]
```

Godot binary discovery checks `--godot-path`, `GODOT_PATH`, `PATH` (`godot`, `godot4`), and standard platform locations (`/opt/homebrew/bin/godot`, `/Applications/Godot*.app/Contents/MacOS/Godot`, `/usr/bin/godot*`).

## Client Configuration

Pass `--project <path>` if you want a default project directory instead of relying on `cwd` or per-tool `projectPath`, and `--godot-path <path>` if Godot is not on `PATH`.

### Claude Code

```bash
claude mcp add godot-mcp -- npx -y @codyklim/godot-mcp
```

Or in `.mcp.json`:

```json
{
  "mcpServers": {
    "godot-mcp": {
      "command": "npx",
      "args": ["-y", "@codyklim/godot-mcp"]
    }
  }
}
```

### Cursor (`.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "godot-mcp": {
      "command": "npx",
      "args": ["-y", "@codyklim/godot-mcp", "--project", "/path/to/godot-project"]
    }
  }
}
```

### Antigravity (`~/.gemini/antigravity/mcp_config.json`)

```json
{
  "mcpServers": {
    "godot-mcp": {
      "command": "npx",
      "args": ["-y", "@codyklim/godot-mcp", "--godot-path", "/Applications/Godot.app/Contents/MacOS/Godot"]
    }
  }
}
```

### Codex (`~/.codex/config.toml`)

```toml
[mcp_servers.godot-mcp]
command = "npx"
args = ["-y", "@codyklim/godot-mcp"]
```

## How It Works

### Zero-Footprint Transient Injection

1. Before launching the game, `godot-mcp` stages `pilot.gd` into `<project>/.godot/mcp/` (ignored by Godot's standard `.gitignore` and skipped by `EditorFileSystem`).
2. Any existing `override.cfg` is backed up byte-for-byte to `.godot/mcp/override.cfg.bak`, and a transient `override.cfg` starting with `; __GODOT_MCP_TRANSIENT__` injects `_GodotMcpPilot="*res://.godot/mcp/pilot.gd"` under `[autoload]`.
3. Immediately after Godot reads `override.cfg` (~100ms after boot), `pilot.gd._init()` restores `override.cfg.bak` (or deletes `override.cfg`), so the project root stays clean even while playing or after a `SIGKILL`.

### Deterministic TAS Playtesting

- **Non-clobbering `autopause`:** `startPaused` on `game_launch` and `freezeAfter` (default `true`) on `game_step` freeze `current_scene.process_mode` and `PhysicsServer2D`/`3D` without touching `get_tree().paused`, so your game's pause menu still works.
- **`until` stop triggers:** `game_step` can stop early on `expression` (truthy GDScript expression), `onNewError`, `uiNodeVisible`, or `timeoutMs`.
- **Native filmstrips:** Set `capture: "filmstrip"` and `filmstripFrames` (1–9) to composite sampled frames inside GDScript via `Image.blit_rect` into a single PNG contact sheet.

## 14-Tool Reference

| Tool | Description | Parameters |
| --- | --- | --- |
| `project_info` | Inspect `project.godot`, Godot version, main scene, viewport, renderer, autoloads, `InputMap`, `.tscn`/`.gd` files | `projectPath?` |
| `godot_api_docs` | Look up cached Godot ClassDB docs for the active local Godot version | `className?`, `member?`, `search?` |
| `project_diagnostics` | Validate `.gd` scripts and scenes headlessly, optionally running `--import` first | `projectPath?`, `runImport?`, `scriptsOnly?` |
| `project_settings_patch` | Patch `project.godot` keys, `*res://...` autoloads, and `InputMap` actions via `ConfigFile` | `projectPath?`, `set?`, `autoloads?`, `inputActions?` |
| `scene_inspect` | Inspect `.tscn`/`.scn`/`.tres` node hierarchy, scripts, non-default properties, groups, signals, ext resources | `projectPath?`, `scenePath`, `maxDepth?` |
| `scene_patch` | Apply batched atomic ops (`create_scene`, `add_node`, `modify_node`, `remove_node`, `reparent_node`, `connect_signal`, `disconnect_signal`, `add_collision_shape`) | `projectPath?`, `scenePath`, `ops` |
| `run_headless_script` | Run a GDScript snippet inside `func run(tree: SceneTree)` headlessly | `projectPath?`, `code`, `timeoutMs?` |
| `game_launch` | Launch the game window with transient pilot injection, optionally frozen on frame 1 | `projectPath?`, `scene?`, `resolution?`, `position?`, `startPaused?`, `timeoutMs?` |
| `game_step` | Unfreeze, run input `actions`, advance `frames`/`durationMs`, check `until`, capture `final`/`filmstrip`/`none` PNG, auto-freeze | `actions?`, `durationMs?`, `frames?`, `timeScale?`, `until?`, `capture?`, `filmstripFrames?`, `freezeAfter?`, `timeoutMs?` |
| `game_screenshot` | Capture current viewport PNG without advancing simulation ticks | `maxWidth?` |
| `game_inspect` | Query live `SceneTree` nodes, visible `Control` rects/text/disabled states, and `Performance` monitors | `rootPath?`, `maxDepth?`, `includeControls?`, `includePerformance?` |
| `game_eval` | Evaluate a GDScript expression or statement block against the live `SceneTree` | `code`, `timeoutMs?` |
| `game_logs` | Read and optionally clear buffered structured `error` / `log` / `stderr` diagnostics | `clear?`, `sinceSeq?`, `kinds?` |
| `game_stop` | Stop the active game session, verify `override.cfg` cleanup, and return final diagnostics | *(none)* |

## Roadmap

See [ROADMAP.md](ROADMAP.md) for planned milestones from `0.2.0` through `1.0.0`.

## License

MIT — see [LICENSE](LICENSE).

TDQS

B3.2/5.0

Scored across 14 tools

Disambiguation4/5

The set is cleanly grouped into project_*, scene_*, and game_* families, and descriptions make the static vs. live distinction clear (scene_inspect vs. game_inspect). Minor overlap exists between scene_patch and run_headless_script, and between project_diagnostics and game_logs, but each tool's stated purpose keeps misselection unlikely.

Naming Consistency4/5

Nearly all tools follow a domain-prefix + noun_verb pattern (scene_inspect, scene_patch, game_launch, game_eval, project_info), which is highly predictable and readable. run_headless_script is the one clear outlier with verb-first ordering, and godot_api_docs breaks the family prefix, but these are minor deviations.

Tool Count5/5

Fourteen tools sit comfortably in the well-scoped 3-15 range for a Godot automation server. Each tool maps to a distinct lifecycle stage (inspect, validate, patch, run, observe, stop) with no filler entries.

Completeness4/5

The surface covers the full loop: project inspection/docs/diagnostics/settings, scene inspection and patching, headless scripting, and a complete game runtime cycle (launch, step, screenshot, inspect, eval, logs, stop). A gap remains around directly reading/writing GDScript or arbitrary resource files, which agents must work around via run_headless_script.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues