godot-mcp
A Model Context Protocol (MCP) server that gives AI assistants full integration with the Godot game engine IDE. Interact with live editor state, parse and modify scene files, run projects, capture screenshots, debug with breakpoints, profile performance, and more.
84 tools across 16 categories, covering the full Godot development workflow.
Features
- Scene editing — Parse, create, and modify
.tscnscene files directly on disk (no editor required) - Live editor integration — Add/remove/rename/duplicate/move/reparent nodes, set properties, open scenes, and save via the running Godot editor
- Script tools — Read open scripts, get selected code, insert code at the cursor, create and attach scripts, detach scripts
- Signals — List, connect, and disconnect signals on nodes
- Animation — List, inspect, and create animations in AnimationPlayer nodes
- Run/stop scenes — Launch scenes in debug mode and capture stdout/stderr output with incremental polling
- Screenshots — Capture the editor viewport or the running game window as base64 PNG images
- Debugger — Set/remove breakpoints, inspect stack traces and local variables, step over/into/out, continue execution
- Profiler — Start/stop profiling and retrieve performance frame data
- File & resource management — Create folders, list directories, delete/rename files, list/import/read/write resources
- Export — List export presets, export projects, export MeshLibrary resources
- Project scanning — Discover Godot projects (with sort and version filter) and read project metadata
- GDScript validation — Validate scripts using Godot's
--check-onlyflag - Testing — Detect, list, create, and run GDScript tests with GUT, GdUnit4, or the built-in runner
- Resource UIDs — Look up and update Godot 4.4+ resource UIDs
- Autoloads — List, add and remove autoload singletons
- Auto-detects Godot — Finds the Godot executable automatically on macOS, Windows, and Linux (including Steam installs)
Architecture
The integration has two components:
- Node.js MCP server (
src/) — Runs as a stdio MCP server. Handles file-based operations directly and connects to the Godot editor via TCP for live operations. - Godot editor plugin (
plugin/) — A GDScript@toolplugin that runs a TCP server on127.0.0.1:6008inside the editor, exposing editor state over JSON-RPC.
Many tools work in a hybrid mode: they use the live editor bridge when available, and fall back to file-based parsing when the editor is not running.
Development
npm run build # compile TypeScript to build/
npm test # run the vitest suite (Node side, no Godot needed)
npm run test:gd # headless GDScript tests (requires Godot; set GODOT_PATH)
npm run test:bridge # editor-bridge end-to-end (boots the editor; set GODOT_PATH)
npm run test:gd builds a throwaway project with the editor plugin installed and runs every test in tests/gdscript/ headlessly, exiting non-zero on any failure.
npm run test:bridge boots a real Godot editor with the addon, drives the bridge tools through the MCP server over the 6008 socket, and asserts the editor changed — the only automated check of the full MCP → bridge → editor path. On a headless host (CI) run it under xvfb-run with a software renderer (GODOT_EDITOR_ARGS="--rendering-driver opengl3").
Prerequisites
- Node.js 18 or later, with npm 10 or later (older npm can crash while installing dependencies — upgrade with
npm install -g npm@latest) - Godot 4.3 through 4.7 — verified against 4.6.3 and 4.7.2. Scene files round-trip byte-identically: node identity (
unique_id), groups, instance links, editable instances and signal binds are all preserved - Claude Code or another MCP-compatible client
Installation
1. Build and install the MCP server
git clone https://github.com/Sods2/godot-mcp.git
cd godot-mcp
npm install
Then run the installer for your platform:
macOS / Linux:
./scripts/install.sh
Windows (PowerShell):
powershell -ExecutionPolicy Bypass -File scripts\install.ps1
Windows users: run the PowerShell installer rather than the bash script under Git Bash — Git Bash often ships an old, crash-prone npm.
The installer compiles TypeScript, copies the build output to ~/.claude/mcp-servers/godot-mcp/ (%USERPROFILE%\.claude\mcp-servers\godot-mcp\ on Windows), installs production dependencies there, and prints a ready-to-paste .mcp.json snippet with your Godot path pre-filled.
2. Add the server to your project's .mcp.json
Create or update .mcp.json in your Claude project root:
{
"mcpServers": {
"godot": {
"command": "node",
"args": ["~/.claude/mcp-servers/godot-mcp/build/index.js"],
"env": {
"GODOT_PATH": "/path/to/godot"
}
}
}
}
Setting
GODOT_PATH: The install script auto-detects Godot and pre-fills this value. If it can't find Godot, or if you install to a custom location, set the path explicitly. The server checksGODOT_PATH, thengodot,godot4andGodot_v4*on$PATH, then these standard locations:On macOS the executable is inside the
.appbundle atGodot.app/Contents/MacOS/Godot.
Environment Variables
3. Install the Godot editor plugin (optional, for live editor tools)
The plugin is required for tools that interact with the running Godot editor (live scene tree edits, screenshots, script insertion, etc.). File-based tools work without it.
- Copy
plugin/addons/godot_mcp_bridge/into your Godot project'saddons/directory - Open the project in the Godot editor
- Go to Project > Project Settings > Plugins
- Enable MCP Bridge
To screenshot the running game, the plugin registers an autoload
(ClaudeBridgeGameCapture) in your project. The editor cannot read the game's
pixels — Godot runs the game as a separate process — so the capture has to
happen inside the game and travel back over the debugger connection. The
autoload does nothing unless a debugger is attached, so exported builds are
unaffected. To opt out, set claude_bridge/enable_game_capture to false in
the editor settings; the autoload is removed on the next editor start.
The plugin starts a TCP server on 127.0.0.1:6008 when enabled.
Tool Reference
Project & Version
Autoloads
Editor Control
Scene Editing (file-based, no editor required)
Scene Editing (live editor, requires plugin)
Scripts
Signals
Input Map
Events: {type:"key", physical_keycode|keycode, shift?, ctrl?, alt?, meta?}, {type:"mouse_button", button_index}, {type:"joypad_button", button_index}, {type:"joypad_motion", axis, axis_value}. Edits go through the editor's ProjectSettings and require the editor plugin.
Animation
Files & Resources
Export
Run & Debug
Testing
GDScript does not support custom annotations for tests. All frameworks use the test_ method naming convention. Tests can be run headlessly without opening the editor.
Supported frameworks:
- GUT — auto-detected via
addons/gut/; tests extendGutTest - GdUnit4 — auto-detected via
addons/gdUnit4/; tests extendGdUnitTestSuite - Built-in — no addon needed; a minimal test runner is bundled with this MCP server
Example test (GUT):
extends GutTest
func before_each() -> void:
pass
func test_player_starts_with_full_health() -> void:
var player = Player.new()
assert_eq(player.health, 100)
player.free()
Screenshots
Debugger
All debugger tools require the editor plugin and a running game paused at a breakpoint (except set/remove/list breakpoints).