agent-lsp
agent-lsp is a stateful MCP server bridging Language Server Protocol (LSP) intelligence to AI agents, offering 56 tools and 22 skills across 30+ programming languages.
Code Navigation
Go to definition, declaration, type definition, and implementation
Navigate by symbol name (dot-notation), call hierarchy, and type hierarchy
Code Intelligence & Analysis
Find references (including cross-repository), document highlights, and workspace/document symbols
Hover info, signature help, completions, inlay hints, and semantic tokens
Diagnostics (errors/warnings), symbol source, and offline documentation (
go doc,pydoc,cargo doc)
Impact & Blast-Radius Analysis
get_change_impact— enumerate exported symbols and find all callers (with optional transitive analysis)get_cross_repo_references— find usages of a library symbol across consumer repositories
Editing & Refactoring
Apply edits via text-match or WorkspaceEdit, rename symbols workspace-wide (with dry-run preview), prepare/validate renames, get code actions, execute server commands, and format documents or ranges
Speculative Execution (simulate before writing)
Create in-memory sessions, apply edits or chains of edits, evaluate diagnostic impact, then commit to disk or discard — without touching files until you're ready
Build & Test Integration
Run builds (
go build,cargo build,tsc,mypy) and tests (go test,pytest,npm test)Find test files covering a given source file
Workspace & Lifecycle Management
Initialize/restart LSP, auto-detect language servers, manage multi-root workspaces, control document lifecycle, and inspect server capabilities
Agent Workflow Enforcement
Skills (e.g.,
blast-radius,safe-edit,refactor) encode multi-step operations with phase enforcement that blocks out-of-order tool calls, guiding agents through correct workflows
A persistent daemon maintains a warm index across files and projects, improving performance for repeated AI agent interactions.
Supports Bun runtime as an alternative to Node.js for running the MCP server, offering compatibility with JavaScript/TypeScript language server tooling.
Provides C++ language support through clangd language server integration, enabling code analysis, navigation, and refactoring capabilities for C++ projects.
Provides Clojure language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Clojure projects.
Provides Dart language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Dart projects.
Provides Docker container deployment options for the MCP server with stdio and HTTP modes, supporting multiple language server configurations in isolated environments.
Provides Elixir language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Elixir projects.
Hosts the project repository and provides installation scripts via GitHub raw URLs for platform-agnostic deployment of the MCP server.
Provides package installation through Homebrew tap for macOS/Linux users, offering a native package management experience for the MCP server.
Provides JavaScript language support through TypeScript language server integration, enabling code analysis, navigation, and refactoring capabilities for JavaScript projects.
Provides Kotlin language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Kotlin projects.
Provides LLVM-based tooling for C/C++ language support through clangd integration, enabling advanced code analysis and refactoring capabilities.
Provides Lua language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Lua projects.
Provides MongoDB query language support through language server integration, enabling code analysis and validation capabilities for MongoDB projects.
Provides Node.js runtime support for language servers and npm package installation for the MCP server and language server dependencies.
Provides npm package installation for the MCP server globally and for language server dependencies like TypeScript language server and pyright.
Provides PHP language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for PHP projects.
Provides Prisma schema language support through language server integration, enabling code analysis and validation capabilities for Prisma projects.
Provides Python language support through pyright language server integration, enabling code analysis, navigation, and refactoring capabilities for Python projects.
Provides Ruby language support through solargraph language server integration, enabling code analysis, navigation, and refactoring capabilities for Ruby projects.
Provides Rust language support through rust-analyzer language server integration, enabling code analysis, navigation, and refactoring capabilities for Rust projects.
Provides Scala language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Scala projects.
Provides Swift language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Swift projects.
Provides Terraform HCL language support through language server integration, enabling code analysis and validation capabilities for Terraform projects.
Provides TypeScript language support through typescript-language-server integration, enabling code analysis, navigation, and refactoring capabilities for TypeScript projects.
Provides Zig language support through language server integration, enabling code analysis, navigation, and refactoring capabilities for Zig projects.
The most complete MCP server for language intelligence. 60 tools, 30 CI-verified languages, 22 agent workflows. Single Go binary.
AI agents make incorrect code changes because they can't see the full picture: who calls this function, what breaks if I rename it, does the build still pass. Language servers have the answers, but existing MCP bridges either cold-start on every request or expose raw tools that agents use incorrectly.
agent-lsp is a stateful runtime over real language servers. It indexes your workspace once, keeps the index warm, and adds a skill layer that encodes correct multi-step operations so they actually complete.
What agents say
We asked AI agents to evaluate agent-lsp across 10 coding tasks (find callers, rename safely, preview edits, detect dead code) and write an honest assessment. Two different models, two independent evaluations, same conclusion:
Claude (Opus 4.6): "I would recommend agent-lsp for any workflow involving refactoring, impact analysis, or safe editing. The standout tools are
get_change_impact(blast radius in one call, with test/non-test partitioning that would take 5-10 grep commands to replicate),go_to_implementation(type-checked interface satisfaction that grep simply cannot do), and the simulation session workflow (speculative type-checking without touching disk, which has no grep/read equivalent at all)."
GPT (via Cursor): "I would recommend agent-lsp for Go-heavy refactors and code navigation because the rename, references, implementations, call hierarchy, and simulation tools remove a lot of brittle grep/manual-edit work and make changes safer."
How the pieces fit together: LSP (Language Server Protocol) is how editors get code intelligence: completions, diagnostics, go-to-definition. MCP (Model Context Protocol) is the standard way AI tools like Claude Code discover and call external tools. agent-lsp bridges the two: language server intelligence, accessible to AI agents.
How it works
One agent-lsp process manages your language servers. Point your AI at ~/code/. It routes .go to gopls, .ts to typescript-language-server, .py to pyright. No reconfiguration when you switch projects. The session stays warm across files, packages, and repositories.
Tested, not assumed
Every other MCP-LSP implementation lists supported languages in a config file. None of them run the actual language server in CI to verify it works.
agent-lsp CI runs 30 real language servers against real fixture codebases on every push: Go, Python, TypeScript, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, Scala, Zig, Lua, Elixir, Gleam, Clojure, Dart, Terraform, Nix, Prisma, SQL, MongoDB, and more. When we say "works with gopls," that's a verified, automated claim, not a hope.
Speculative execution
Simulate changes in memory before writing to disk. No other MCP-LSP implementation has this.
preview_edit previews the diagnostic impact of any edit. You see exactly what breaks before the file is touched. simulate_chain evaluates a sequence of dependent edits (rename a function, update all callers, change the return type) and reports which step first introduces an error.
8 speculative execution tools. See docs/speculative-execution.md for the full workflow.
Token savings
Structured LSP responses use 5-34x fewer tokens than grep/read on the same tasks. On HashiCorp Consul (319K lines), a blast-radius analysis uses 17.7MB via grep vs 841KB via LSP, reducing 5,534 tool calls to 119. Savings scale with codebase size. See docs/token-savings.md for the full experiment across five codebases.
Persistent daemon mode
Python and TypeScript projects need minutes of background indexing before find_references works. agent-lsp automatically spawns a persistent daemon broker that survives between sessions, so the workspace stays indexed. First session: daemon starts and indexes (~10s for FastAPI). Subsequent sessions: instant connection to the warm daemon. Auto-exits after 30 minutes of inactivity. Go, Rust, and other fast-indexing languages bypass this entirely (zero overhead).
Phase enforcement
Skills tell agents the correct order of operations. Phase enforcement makes the runtime block violations instead of trusting the agent to follow instructions.
When an agent activates a skill, every tool call is checked against the current phase's permissions. Calling apply_edit during blast-radius analysis doesn't silently proceed; it returns an error with specific recovery guidance ("complete the blast_radius phase first, allowed tools: [get_change_impact, find_references]"). Phases advance automatically as the agent calls tools from later phases.
No other MCP tool provider enforces workflow ordering at runtime. See docs/phase-enforcement.md.
Works with
AI Tool | Transport | Config |
stdio |
| |
stdio |
| |
stdio |
| |
stdio |
| |
Any MCP client | HTTP+SSE |
|
Skills
Raw tools get ignored. Skills get used. Each skill encodes the correct tool sequence so workflows actually happen without per-prompt orchestration instructions. Skills are available as AgentSkills slash commands and as MCP prompts via prompts/list / prompts/get for any MCP client.
See docs/skills.md for full descriptions and usage guidance.
Before you change anything
Skill | Purpose |
| Blast-radius analysis before touching a symbol or file |
| Find all concrete implementations of an interface |
| Detect zero-reference exports before cleanup |
Editing safely
Skill | Purpose |
| Speculative preview before disk write; before/after diagnostic diff; surfaces code actions on errors |
| Test changes in-memory without touching the file |
| Edit a named symbol without knowing its file or position |
| Safe editing of exported symbols, finds all callers first |
|
|
Understanding unfamiliar code
Skill | Purpose |
| "Tell me about this symbol": hover + implementations + call hierarchy + references in one pass |
| Deep-dive Code Map for a symbol or file: type info, call hierarchy, references, source |
| Three-tier documentation: hover → offline toolchain → source |
| Find all usages of a library symbol across consumer repos |
| File-scoped symbol list, usage search, and type info |
After editing
Skill | Purpose |
| Diagnostics + build + tests after every edit |
| Apply quick-fix code actions for all diagnostics in a file |
| Find and run only tests that cover an edited file |
| Format a file or selection via the language server formatter |
Generating code
Skill | Purpose |
| Trigger server-side code generation (interface stubs, test skeletons, mocks) |
| Extract a code block into a named function via code actions |
Full workflow
Skill | Purpose |
| End-to-end refactor: blast-radius → preview → apply → verify → test |
| Full code quality audit: dead symbols, test coverage, error handling, doc drift |
Docker
Stdio mode (MCP client spawns the container directly):
# Go
docker run --rm -i -v /your/project:/workspace ghcr.io/blackwell-systems/agent-lsp:go go:gopls
# TypeScript
docker run --rm -i -v /your/project:/workspace ghcr.io/blackwell-systems/agent-lsp:typescript typescript:typescript-language-server,--stdio
# Python
docker run --rm -i -v /your/project:/workspace ghcr.io/blackwell-systems/agent-lsp:python python:pyright-langserver,--stdioHTTP mode (persistent service, remote clients connect over HTTP+SSE):
docker run --rm \
-p 8080:8080 \
-v /your/project:/workspace \
-e AGENT_LSP_TOKEN=your-secret-token \
ghcr.io/blackwell-systems/agent-lsp:go \
--http --port 8080 go:goplsImages run as a non-root user (uid 65532) by default. Set AGENT_LSP_TOKEN via environment variable, never --token on the command line. Images are also mirrored to Docker Hub (blackwellsystems/agent-lsp). See DOCKER.md for the full tag list, HTTP mode setup, and security hardening options.
Setup
Step 1: Install agent-lsp
curl -fsSL https://raw.githubusercontent.com/blackwell-systems/agent-lsp/main/install.sh | shmacOS / Linux
brew install blackwell-systems/tap/agent-lspWindows
# PowerShell (no admin required)
iwr -useb https://raw.githubusercontent.com/blackwell-systems/agent-lsp/main/install.ps1 | iex
# Scoop
scoop bucket add blackwell-systems https://github.com/blackwell-systems/agent-lsp
scoop install blackwell-systems/agent-lsp
# Winget
winget install BlackwellSystems.agent-lspAll platforms
# pip
pip install agent-lsp
# npm
npm install -g @blackwell-systems/agent-lsp
# Go install
go install github.com/blackwell-systems/agent-lsp/cmd/agent-lsp@latestStep 2: Install language servers
Install the servers for your stack. Common ones:
Language | Server | Install |
TypeScript / JavaScript |
|
|
Python |
|
|
Go |
|
|
Rust |
|
|
C / C++ |
|
|
Ruby |
|
|
Full list of 30 supported languages in docs/language-support.md.
Step 3: Verify setup
agent-lsp doctorProbes each configured language server and reports capabilities. Fix any failures before proceeding. See language support for install commands and server-specific notes.
Step 4: Configure your AI tool
agent-lsp initDetects language servers on your PATH, asks which AI tool you use, writes the correct MCP config, and installs skill awareness rules for your AI provider (CLAUDE.md for Claude Code, .cursor/rules/ for Cursor, .clinerules for Cline, .windsurfrules for Windsurf, GEMINI.md for Gemini CLI). For CI or scripted use: agent-lsp init --non-interactive.
The generated config looks like:
{
"mcpServers": {
"lsp": {
"type": "stdio",
"command": "agent-lsp",
"args": [
"go:gopls",
"typescript:typescript-language-server,--stdio",
"python:pyright-langserver,--stdio"
]
}
}
}Each arg is language:server-binary (comma-separate server args).
Step 5: Install skills
git clone https://github.com/blackwell-systems/agent-lsp.git /tmp/agent-lsp-skills
cd /tmp/agent-lsp-skills/skills && ./install.sh --copySkills are prompt files copied into your AI tool's configuration. --copy means the clone can be safely deleted afterward.
Skills are also available as MCP prompts: any MCP client can discover them via prompts/list and retrieve full workflow instructions via prompts/get, with no manual installation required. The install.sh path is for AgentSkills-compatible clients (Claude Code slash commands).
Step 6: Allow tool permissions (Claude Code)
For Claude Code, add mcp__lsp__* to your permissions allow list so all 60 tools are available without per-tool approval prompts:
// ~/.claude/settings.json
{
"permissions": {
"allow": ["mcp__lsp__*"]
}
}Without this, Claude Code will prompt for permission on each tool call. Other MCP clients handle permissions differently; check your client's documentation.
Skills are multi-tool workflows that encode reliable procedures: blast-radius check before edit, speculative preview before write, test run after change. See docs/skills.md for the full list.
Step 6: Start working
Your AI agent calls tools automatically. The first call initializes the workspace:
start_lsp(root_dir="/your/project")This is what the agent does, not something you type. Then use any of the 60 tools. The session stays warm; no restart needed when switching files.
What's unique about agent-lsp
Capability | Details |
Tools | 60 |
Languages (CI-verified) | 30, end-to-end integration tests on every push |
Agent workflows (skills) | 22, named multi-step procedures, discoverable via MCP |
Speculative execution | 8 tools, simulate changes before writing to disk |
Phase enforcement | 4 skills, runtime blocks out-of-order tool calls with recovery guidance |
Connection model | persistent, warm index across files and projects |
Call hierarchy | ✓, single tool, direction param |
Type hierarchy | ✓, CI-verified |
Cross-repo references | ✓, multi-root workspace |
Auto-watch | ✓, always-on, debounced file watching |
HTTP+SSE transport | ✓, bearer token auth, non-root Docker |
Distribution | single Go binary, 10 install channels |
Use Cases
Multi-project sessions: point your AI at
~/code/, work across any project without reconfiguringPolyglot development: Go backend + TypeScript frontend + Python scripts in one session
Large monorepos: one server handles all languages, routes by file extension
Code migration: refactor across repos with full cross-repo reference tracking
CI pipelines: validate against real language server behavior
Niche language stacks: Gleam, Elixir, Prisma, Zig, Clojure, Nix, Dart, Scala, MongoDB, all CI-verified
Multi-Language Support
30 languages, CI-verified end-to-end against real language servers on every CI run. No other MCP-LSP implementation tests a single language in CI.
Go, Python, TypeScript, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, Scala, Zig, Lua, Elixir, Gleam, Clojure, Dart, Terraform, Nix, Prisma, SQL, MongoDB, JavaScript, YAML, JSON, Dockerfile, CSS, HTML.
See docs/language-support.md for the full coverage matrix.
Tools
60 tools covering navigation, analysis, refactoring, symbol editing, speculative execution, and session lifecycle. All CI-verified.
See docs/tools.md for the full reference with parameters and examples.
Further reading
Documentation
Tools reference: full tool reference with parameters and examples
Skills reference: skill reference, workflows, use cases, and composition
Language support: language coverage matrix
Architecture: system design and internals
Speculative execution: simulate-before-apply workflows
LSP conformance: LSP 3.17 spec coverage
Docker: Docker tags, compose, and volume caching
Contributing
CI notes: CI quirks and test harness details
Distribution: install channels and release pipeline
Development
git clone https://github.com/blackwell-systems/agent-lsp.git
cd agent-lsp && go build ./...
go test ./... # unit tests
go test ./... -tags integration # integration tests (requires language servers)Library Usage
The pkg/lsp, pkg/session, and pkg/types packages expose a stable Go API for using agent-lsp's LSP client directly without running the MCP server.
import "github.com/blackwell-systems/agent-lsp/pkg/lsp"
client := lsp.NewLSPClient("gopls", []string{})
client.Initialize(ctx, "/path/to/workspace")
defer client.Shutdown(ctx)
locs, err := client.GetDefinition(ctx, fileURI, lsp.Position{Line: 10, Character: 4})See docs/architecture.md for the full package API.
License
MIT
Maintenance
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/blackwell-systems/agent-lsp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server