Purpose
agent-lsp is an MCP server used to orchestrate existing LSP language servers (gopls, rust-analyzer, jdtls, etc.) into workflows oriented toward AI agents. It is not itself an LSP server, but rather an orchestration layer situated between language servers and AI agents: language servers provide code intelligence, agent-lsp is responsible for orchestrating workflows and maintaining a hot runtime, and AI agents call it through the MCP protocol. The goal is to give AI coding agents language-server-level capabilities, such as go-to-definition, find references, diagnostics, refactoring, and speculative execution.
Main capabilities
- Persistent hot runtime: Language servers maintain their index across multiple agent sessions. The first session indexes the workspace (about 10 seconds for a typical project), and subsequent sessions are immediately available, avoiding the cold-start overhead of each request.
- Batch operations: For example, blast_radius returns all exports and all callers in a single call, partitioned by test/non-test; without orchestration, this would require more than 20 sequential LSP calls.
- Speculative editing: simulate_edit previews changes in memory, checks diagnostic differences, and then applies or discards them, making it possible to test changes without touching disk. preview_edit previews the diagnostic impact of any edit; simulate_chain evaluates a series of dependent edits and reports which step first introduces an error. The project states there are 8 speculative execution tools in total.
- Workflow orchestration: 24 skills string LSP operations into complete pipelines, for example /lsp-refactor performs impact analysis -> preview -> apply -> verify build -> run tests; /lsp-safe-edit performs preview -> diagnostic diff -> apply when safe; /lsp-verify performs LSP diagnostics -> build -> test suite.
- Multi-language single session: A single agent-lsp process routes by file extension, .go to gopls, .ts to tsserver, .py to pyright, with no need to reconfigure when switching projects, and sessions persist across files and repositories.
- Token-optimized output: Tool responses are encoded in GCF (Graph Compact Format) rather than JSON, which is said to reduce tokens by 30-84% depending on the tool (up to 92.7% with session deduplication). Available in the benchmarkMedium comparison; GCF is enabled by default and can be switched back to JSON.
- Phase enforcement: Skills tell the agent the correct order of operations, and at runtime the current phase's permissions are checked when tools are called. Unauthorized calls return an error with recovery guidance, and the phase automatically advances as tools from subsequent phases are called.
- Concurrency analysis: The checker provides 4 concurrency checks, covering 25 languages and 4 concurrency families (goroutine, thread, async, actor), including unrecovered concurrency entry points, unchecked shared state, channels that are never closed, and shared fields missing synchronization. blast_radius marks sync_guarded: true when the parent type has a mutex; find_callers with cross_concurrent: true can trace call chains across goroutine/thread boundaries.
- Automatic diagnostics: Symbol editing tools (replace_symbol_body, insert_after_symbol, insert_before_symbol, safe_delete_symbol) automatically return errors_after and warnings_after counts, so the agent can know whether a change broke the code without making a separate diagnostics call. safe_apply_edit combines preview and apply into a single call, writing to disk only when the net increase in errors is 0.
Language support and validation
The project claims that CI runs tests against 32 real language servers on every push, covering Go, Python, TypeScript, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, Scala, Zig, Lua, Elixir, Gleam, Clojure, Dart, Terraform, Nix, Prisma, SQL, MongoDB, MQL, and more. See docs/reference/language-support.md for the full list.
How to use
- Install agent-lsp.
- Install language servers: Install the corresponding server for the technology stack you use.
- Verify the setup: Probe each configured language server and report capabilities, and fix failures before continuing.
- Configure AI tools: init detects language servers on PATH,asks which AI tool is being used, writes the correct MCP configuration, and installs skill-aware rules for the AI provider (CLAUDE.md for Claude Code, .cursor/rules/ for Cursor, .clinerules for Cline, .windsurfrules for Windsurf, GEMINI.md for Gemini CLI, AGENTS.md for Pi). For CI or scripted use, add --non-interactive.
- Install skills: They can be copied via an installation script, or the embedded skills can be installed with agent-lsp init --with-skills; skills can also be discovered by any MCP client as MCP prompts via prompts/list and prompts/get, with no manual installation required.
- Allow tool permissions (Claude Code): Add mcp__lsp__* to the permission allowlist, otherwise every tool call will request approval.
- Start working: The agent calls tools automatically, the first call initializes the workspace, the session stays hot, and switching files does not require a restart.
A Docker run method is also provided: in Stdio mode, the MCP client starts the container directly; in HTTP mode, it is a persistent service, and remote clients connect via HTTP+SSE. The image runs as a non-root user by default (uid 65532), and AGENT_LSP_TOKEN must be set via an environment variable, not with the command-line --token. The image is also mirrored to Docker Hub (blackwellsystems/agent-lsp). See DOCKER.md for configuration examples and security hardening options.
Use cases
- Building code generation systems with agent capabilities
- Automated refactoring across large codebases
- CI tools that need programmatic code intelligence
- Any workflow where sequential LSP calls are too slow or too complex
- Multi-project sessions, multilingual development, large monorepos, code migration, CI pipelines, and niche language stacks
Limitations
The materials do not provide explicit information on pricing, charging model, license agreement, performance limits, or known limitations; some features (such as various token savings ratios and model comprehension rates) come from the project's own documentation and self-testing, with no independent verification information provided. For GCF details, see gcformat.com, specification, and Go/Python/TypeScript implementations with a playground.