Skip to main content
MCP server CX Codex

GodotLens — Claude Code MCP server: what it does, how to install

Connects coding agents to Godot 4.6+ to inspect GDScript, validate scene hierarchies, and drive gameplay headlessly without manual playtesting.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env GODOT_LSP_HOST=<GODOT_LSP_HOST> --env GODOT_LSP_PORT=<GODOT_LSP_PORT> --env GODOT_DAP_HOST=<GODOT_DAP_HOST> --env GODOT_DAP_PORT=<GODOT_DAP_PORT> --env GODOT_BIN=<GODOT_BIN> --transport stdio godotlens -- npx -y godotlens-mcp
Open on GitHub

What GodotLens does

GodotLens delegates project queries directly to the Godot engine rather than parsing GDScript text with search tools. Commands follow explicit namespaces: gdscript_* queries the editor language server, scene_* and project_* execute project validation via the engine binary, and runtime_* manages standalone game processes. An agent sees exact call sites, true engine method signatures, and scene signal wiring without confusing comments for code.

Full operation requires an active Godot 4.6+ editor instance or a headless editor process with LSP and DAP ports exposed. If the Import Resources When Unfocused editor setting remains disabled, Godot ignores newly created script files and class_name definitions because the agent-controlled window never receives window focus. For runtime evaluation, GodotLens injects a temporary helper script via command-line arguments without modifying repository files.

What it helps with

  • locate exact GDScript function call sites without false positives from comments
  • validate scene files and signal bindings directly against engine rules
  • launch headless game sessions to observe runtime behavior without manual interaction
  • execute in-game expressions via runtime_eval without altering project assets

Example prompts for the agent

  • Find all references to the take_damage method across the project using gdscript_references
  • Validate the player.tscn scene structure and check for broken signal links
  • Start the game headlessly using runtime_run and inspect the active scene tree

How to install GodotLens

Platform CLI

claude mcp add --env GODOT_LSP_HOST=<GODOT_LSP_HOST> --env GODOT_LSP_PORT=<GODOT_LSP_PORT> --env GODOT_DAP_HOST=<GODOT_DAP_HOST> --env GODOT_DAP_PORT=<GODOT_DAP_PORT> --env GODOT_BIN=<GODOT_BIN> --transport stdio godotlens -- npx -y godotlens-mcp

Replace <…> with your own values. 6 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about GodotLens

How do I install GodotLens in Claude Code?

Run claude mcp add godotlens -- npx -y godotlens-mcp in your terminal. For custom ports or binary paths, pass environment variables: `claude mcp add --env GODOT_LSP_HOST=<GODOT_LSP_HOST> --env GODOT_LSP_PORT=<GODOT_LSP_PORT> --env GODOT_DAP_HOST=<GODOT_DAP_HOST> --env GODOT_DAP_PORT=<GODOT_DAP_PORT> --env GODOT_BIN=<GODOT_BIN> --transport stdio godotlens -- npx -y godotlens-mcp`.

What does GodotLens do?

It provides an MCP interface for querying Godot's language server, inspecting scene trees, and driving game execution. Agents can verify edits against the real engine, execute test inputs, and review logs without human playtesting.

Why does GodotLens require Godot 4.6 or higher?

Godot 4.5 and 4.6 introduced critical updates to URI handling and document ownership in the built-in LSP. Earlier versions are rejected immediately to prevent silent parsing failures.

Similar MCP servers

Everything for Game dev and 3D: Unity, Unreal, Godot, Blender →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor