Theodolite — Claude Code MCP server: headless LSP bridge
Theodolite is an MCP server for Claude Code that spawns language-server sessions in isolation and exposes navigation, diagnostics, and refactoring as MCP tools.
Apache-2.0 updated 2026-10-28
Open on GitHubWhat Theodolite does
Theodolite maintains its own pinned language-server sessions—Rust Analyzer, Lua Language Server, bacon-ls, serve-d for D—and surfaces their functions as a closed set of MCP tools. The read surface includes hover, definition, references, document_symbols, diagnostics, and code_actions (listings only, no execution). This contrasts with periscope, which reads through a human's live editor.
The bridge is deterministic: child processes are spawned by absolute path through setpriv, server versions are pinned exactly, and config is validated before startup. Communication happens over stdio with NDJSON JSON-RPC. The configuration is TOML; you pin binary paths and capture exact --version output from your target machine.
Mutation tools (code_action_apply, rename_apply) are gated off by default. Enable them via mutation = "gated" with a non-empty mutation_allowlist. Handles for code actions are minted server-side; the bridge writes file contents only (no creation or deletion), validates every edit before applying, and uses atomic temp-and-rename operations.
What it helps with
- retrieve type information and definitions from code outside an editor
- spawn an isolated language-server session for an AI agent
- aggregate diagnostics from multiple LSP sources
- apply refactoring and code actions from a bot safely
- query navigation and workspace symbols programmatically
Example prompts for the agent
- List all symbols in
src/main.rsusingdocument_symbols - Find every reference to the function
parse_configacross the workspace - Preview a rename of
old_nametonew_nameand show the full change set
How to install Theodolite
Install
The MCP registry has no launch command for it: see the repository 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 Theodolite
How do I install Theodolite in Claude Code?
Theodolite runs as a standalone MCP server. Build it with cargo build --release, then run ./target/release/theodolite --config bridge.toml. The config file describes which language servers (Rust Analyzer, Lua Language Server, etc.) to run and their exact versions. Connect it to Claude Code through the standard MCP configuration mechanism.
What does Theodolite do?
It is an LSP bridge: it maintains its own language-server sessions and exposes their capabilities—definitions, diagnostics, refactoring, symbols—as MCP tools. It runs headless, without an editor, making it suitable for bots, agents, workers, and sandbox environments.
Can I apply refactoring through Theodolite?
Yes, but mutation is gated off by default. Set mutation = "gated" in the config and provide a non-empty mutation_allowlist to allow specific clients. Then code_action_apply and rename_apply become available only to allowlisted clients. The bridge validates and applies every change atomically.