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: AI-First Code Analysis for GDScript
An MCP server providing 15 semantic analysis tools for GDScript, powered by Godot's built-in Language Server.
Built for AI Agents
AI coding agents work with text files but lack semantic understanding of GDScript. When an agent uses grep to find usages of a function, it cannot distinguish a function call from a comment containing the same name, a signal declaration from a signal emission, or an overridden method from an unrelated function.
GodotLens bridges this gap by exposing Godot's built-in Language Server through the Model Context Protocol (MCP), giving AI agents compiler-accurate code intelligence for GDScript — go to definition, find references, diagnostics, rename, and more.
Example: Finding all usages of _on_player_hit:
Approach | Result |
| 12 matches including comments, strings, and similarly named functions |
| Exactly 4 call sites where |
Prerequisites
Godot 4.x editor must be running with your project open — Godot's LSP server starts automatically when the editor opens a project
Python 3.10+ (for pip install) or Node.js 16+ (for npx)
Quick Start
Option A: npx (recommended for MCP clients)
Add to your MCP configuration (e.g., .mcp.json for Claude Code):
{
"mcpServers": {
"godotlens": {
"command": "npx",
"args": ["-y", "godotlens-mcp"]
}
}
}The npm package bundles the full server (~20 KB of Python). Zero external Python dependencies.
Option B: pip
pip install godotlens-mcp{
"mcpServers": {
"godotlens": {
"command": "godotlens-mcp"
}
}
}Configuration
Environment Variable | Default | Description |
|
| Godot LSP server host |
|
| Godot LSP server port |
Tools
Health
Tool | Description |
| Check connection to Godot LSP. Use to verify editor is running before other tools. |
Navigation (6 tools)
Tool | Description |
| Navigate to where a symbol is defined. Returns file path and line number. |
| Navigate to the declaration site of a symbol. |
| Find all references to a symbol across the project. Essential for impact analysis before refactoring. |
| Get type information and documentation for a symbol. Use to understand types and return values. |
| List all symbols (classes, functions, variables, signals) in a file. Use to explore file structure. |
| Get function signature and parameter info at a call site. |
Refactoring
Tool | Description |
| Rename a symbol across all files. Workflow: references to preview impact, rename, then sync. |
Synchronization (3 tools)
Tool | Description |
| Sync a modified file with the LSP and get updated diagnostics. Call after editing .gd files. |
| Batch sync multiple modified files. More efficient than syncing individually. |
| Notify LSP a file was deleted. Clears stale diagnostics. |
Batch Operations (3 tools)
Tool | Description |
| Get symbols from multiple files in one call. |
| Get definitions for multiple positions in one call. |
| Find references for multiple symbols in one call. Use for bulk impact analysis. |
Diagnostics
Tool | Description |
| Get compiler errors and warnings. Workflow: edit, sync, then diagnostics to verify. |
Architecture
┌──────────────┐ ┌────────────────────┐ ┌───────────────────┐
│ AI Agent │ stdio │ GodotLens (MCP) │ TCP │ Godot Editor │
│ (Claude, etc)├────────►│ JSON-RPC 2.0 ├────────►│ Built-in LSP │
│ │◄────────┤ Python 3.10+ │◄────────┤ Port 6005 │
└──────────────┘ └────────────────────┘ └───────────────────┘GodotLens acts as a bridge between the AI agent and Godot's built-in Language Server. The AI agent communicates with GodotLens via MCP (JSON-RPC over stdio). GodotLens translates MCP tool calls into LSP requests and sends them to the Godot editor over TCP. Responses are compacted for efficient AI consumption.
Zero dependencies — the server uses only the Python standard library. The MCP and LSP protocols are implemented directly, keeping the server lightweight and self-contained.
Important: File Synchronization
Godot's LSP does not automatically detect file changes made outside the editor. When the AI agent modifies a .gd file, it should call gdscript_sync_file or gdscript_sync_files so the LSP re-analyzes the changed code. Without this, diagnostics and navigation results may be stale.
Recommended workflow:
Use GodotLens tools to analyze code
Write changes to files
Call
gdscript_sync_fileto refresh LSP stateUse GodotLens tools to verify changes
Coordinate System
All line and character parameters are 0-indexed, matching the LSP specification:
Line 0, Character 0 = first character of the file
License
MIT License — see LICENSE for details.
Latest Blog Posts
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