godotlens-mcp
GodotLens-MCP is an MCP server that provides AI agents with semantic code intelligence for GDScript by bridging the Model Context Protocol with Godot's built-in Language Server.
Health Check: Verify connectivity to the Godot LSP server (
gdscript_status)Go to Definition/Declaration: Navigate to where a symbol is defined or declared (
gdscript_definition,gdscript_declaration)Find References: Locate all references to a symbol across the project with compiler-accurate precision (
gdscript_references)Hover Info: Retrieve type information and documentation for any symbol (
gdscript_hover)List Symbols: Enumerate all symbols (classes, functions, variables, signals) within a file (
gdscript_symbols)Signature Help: Get function signatures and parameter information at a call site (
gdscript_signature_help)Rename Symbol: Rename a symbol across all project files in one operation (
gdscript_rename)File Sync: Notify the LSP of changes to one or more
.gdfiles and retrieve updated diagnostics (gdscript_sync_file,gdscript_sync_files)Delete File: Inform the LSP that a file has been deleted to clear stale diagnostics (
gdscript_delete_file)Diagnostics: Fetch compiler errors and warnings for specified files (
gdscript_diagnostics)Batch Operations: Efficiently retrieve symbols, definitions, or references for multiple files/positions in a single call (
gdscript_symbols_batch,gdscript_definitions_batch,gdscript_references_batch)
GodotLens: Godot's own view of your GDScript project
An MCP server that lets an AI agent ask Godot itself about your project — where a symbol is used, what a method's real signature is, whether an edit compiles, how a scene is wired, and what the game actually printed when it ran.
Why
An agent editing GDScript from text alone is guessing. It cannot tell a call from a comment,
cannot know which methods exist on a CharacterBody2D in your Godot version, cannot see that
a signal handler is wired by name inside a .tscn, and cannot see what happened at runtime.
GodotLens never answers those questions itself. It asks the engine and returns the engine's
answer. Measured on Godot 4.7.1, in a project where take_damage is defined in player.gd,
called twice from enemy.gd, once from player.gd, and named in a comment:
Approach | Result |
| 5 matches, including the comment |
| exactly 4 real call sites; the comment is not among them |
That principle — delegate every judgement to Godot — is what makes the answers trustworthy,
and it is why the tool names tell you where an answer came from. gdscript_* is the language
server. scene_* and project_config run the engine. debug_* is the debugger.
Related MCP server: Godot MCP Server
Requirements
Needed for | |
Godot 4.6+ with your project open | everything — the language server and debug adapter live inside the editor |
Python 3.10+, or Node.js 16+ for | running this server |
A Godot binary via |
|
Godot 4.6 is the floor because the language server changed materially at 4.5 (URI encoding) and 4.6 (document ownership). Older versions are refused with a clear message rather than silently misread.
The editor does not need a visible window — this is what CI uses:
godot --path <project> --editor --headless --lsp-port 6005 --dap-port 6006Install
npx (recommended). The package bundles the server; there are no runtime dependencies.
{
"mcpServers": {
"godotlens": {
"command": "npx",
"args": ["-y", "godotlens-mcp"]
}
}
}pip
pip install godotlens-mcp{
"mcpServers": {
"godotlens": { "command": "godotlens-mcp" }
}
}The loop
The tools are designed around one cycle. Read it once and the rest of this document is a reference.
flowchart LR
U["<b>Understand</b><br/>gdscript_find<br/>gdscript_references<br/>gdscript_hover"]
W["<b>Write</b><br/>gdscript_engine_api<br/>gdscript_complete<br/>gdscript_validate"]
S["<b>Sync</b><br/>gdscript_sync_file"]
V["<b>Verify</b><br/>gdscript_diagnostics<br/>scene_validate"]
R["<b>Run</b><br/>debug_run<br/>debug_output"]
U --> W --> S --> V --> R
R -- "something is wrong" --> U
classDef step fill:#f5f7fa,stroke:#4a6785,stroke-width:1px,color:#1b2733;
class U,W,S,V,R step;Understand.
gdscript_findlocates a symbol by name;gdscript_referencesandgdscript_hoverexplain how it is used and what type it is.Write.
gdscript_engine_apigives real signatures instead of recalled ones,gdscript_completeoffers scene-aware candidates, andgdscript_validatechecks proposed content before it reaches disk.Sync. Godot's language server does not watch the filesystem. After editing a
.gdfile, callgdscript_sync_fileor it keeps answering from the old text.Verify.
gdscript_diagnosticsfor compile errors,scene_validatefor the wiring the compiler cannot see.Run.
debug_runstarts the game and returns what it printed.
Two conventions apply throughout:
All line and character parameters are 0-indexed, matching the LSP. Editor line 1 is line 0.
gdscript_findexists partly so you rarely have to compute one by hand.Results carry a
verifiedflag where it matters.verified: falsewith an empty diagnostics list means Godot never reported back — that is not a clean bill of health.
Tools
Understanding code
Tool | Description |
| Locate a declaration by name. Returns a position the tools below accept directly. |
| Where a symbol is defined. |
| Every reference project-wide. On 4.6+ this reparses every |
| Occurrences within one file. Much cheaper. Godot 4.7+. |
| Type information and documentation for a symbol. |
| The symbol tree of a file. |
| Parameter info at a call site. |
| The same, across many files or positions in one call. |
Writing code
Tool | Description |
| Signatures and docs for an engine class or member, from the exact build in use. Use instead of recalling Godot's API. |
| Completions at a position. The only scene-aware query: includes real |
| Check proposed content for errors without writing it to disk. |
| Rename a symbol. Refuses when Godot will not rename it, and warns when the name also appears in scene files it cannot update. |
Keeping Godot in step
Tool | Description |
| Sync one modified file and return its diagnostics. |
| Sync several at once. |
| Release a file so the language server reads from disk again. |
| Errors and warnings for one or more files. |
| Connection check. Start here if anything behaves oddly. |
Project and scenes
These invoke the Godot binary so scenes resolve exactly as the engine builds them, inherited
scenes included. They do not parse .tscn as text.
Tool | Description |
| Autoload singletons, input action names, |
| Node tree, types, script attachments, |
| Checks every connection points at a method that exists. |
Runtime
Godot serves a Debug Adapter Protocol server from the editor, no addon required. The language server tells you whether code compiles; only the debugger tells you what it did.
Tool | Description |
| Run the project and return what it printed. |
| Console output from a running game — |
| Set breakpoints in a file. |
| The call stack where execution is paused. Empty means not paused. |
| Variables in a stack frame, by scope. |
| Evaluate an expression at a breakpoint, instead of adding |
| Execution control. |
| Stop the running game. |
| Adapter connection and whether the game is running or paused. |
What Godot cannot tell you
Worth knowing before you trust a result:
The language server reads
.gdfiles only. A signal handler wired in a.tscn[connection]block is invisible to it, so renaming that handler leaves the scene pointing at a method that no longer exists — and that fails at runtime with no compile error. This is whyscene_validateexists and whygdscript_renamewarns.Autoload and input action names are bare strings.
GameState.add_score(1)andInput.is_action_pressed("jump")are validated by nothing at all. Check them againstproject_configbefore writing them.gdscript_referencesis expensive on 4.6+, reparsing every script in the project. Prefergdscript_references_in_filewhen one file is enough.
Architecture
Three mechanisms, one process. Each tool group maps to exactly one of them, which is how you know where an answer came from.
flowchart TD
Agent["AI Agent"]
GL["<b>GodotLens</b><br/>MCP server · JSON-RPC 2.0<br/>Python 3.10+ · no dependencies"]
Agent <-- "stdio" --> GL
GL -- "TCP 6005<br/>language server" --> Editor
GL -- "TCP 6006<br/>debug adapter" --> Editor
GL -- "subprocess<br/>--headless --script" --> Binary
Editor["<b>Godot Editor</b><br/>must be open<br/><i>gdscript_* · debug_*</i>"]
Binary["<b>Godot binary</b><br/>invoked on demand<br/><i>scene_* · project_config</i>"]
classDef svc fill:#eef4fb,stroke:#4a6785,stroke-width:1px,color:#1b2733;
classDef godot fill:#f3f0fb,stroke:#6b5b95,stroke-width:1px,color:#1b2733;
class Agent,GL svc;
class Editor,Binary godot;The MCP and LSP/DAP protocols are implemented directly against the standard library, so the
package has zero runtime dependencies and the npm bundle is a handful of .py files.
Configuration
Variable | Default | Description |
|
| Language server host |
|
| Language server port. The official VS Code extension uses |
|
| Debug adapter host |
|
| Debug adapter port, used by |
| auto | Godot executable, required by |
| auto | Project root; auto-detected by walking up for |
|
| Seconds to wait for a single language server response |
|
| Seconds to wait for diagnostics after a sync |
| auto | Override capability detection |
|
| Max files |
Contributing
pip install -e ".[dev]"
pytest -m "not integration" # no Godot needed
ruff check .Integration tests launch a real headless Godot and skip cleanly without one:
GODOT_BIN=/path/to/godot pytest -m integrationCI runs the suite on Linux, Windows and macOS across Python 3.10–3.13, runs the integration tests against a real Godot on all three, and installs the built npm tarball and executes it.
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceProvides instant GDScript syntax validation and diagnostics by bridging Godot's native Language Server Protocol to MCP clients. Enables real-time syntax checking in AI assistants without requiring custom plugins or context switching to the Godot editor.Last updated41738MIT
- FlicenseAqualityDmaintenanceAn MCP server that provides tools for Godot Engine development, enabling users to run unit tests, check for syntax errors, and manage project scenes or exports.Last updated52
- AlicenseBqualityDmaintenanceAn MCP server for Godot game development that provides 45 tools for reading, analyzing, and editing projects. It enables users to manage scene trees, navigate GDScript symbols, and interact with the Godot runtime for debugging and state capture.Last updated52MIT
- AlicenseAqualityBmaintenanceA Godot 4 MCP server for AI-assisted project inspection, editing, validation, and runtime automation via stdio and optional WebSocket bridge.Last updated388MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for generating rough-draft project plans from natural-language prompts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pzalutski-pixel/godotlens-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server