agent-lsp
Lets your AI agent use language servers to find callers, preview edits and refactor code safely across many languages.
172 stars on GitHubby Blackwell SystemsLicense MITUpdated 18 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add agent-lsp -- npx -y @blackwell-systems/agent-lsp
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Show me every caller of this function, split into tests and non-tests.
Preview renaming this method and tell me which files would stop compiling.
What it is
This server runs the language servers your editor already relies on, such as gopls and rust-analyzer, and exposes them to your AI agent as tools. The agent can see who calls a function, preview what an edit would break before touching a file, and run multi-step refactors. It keeps the language servers warm between sessions so answers come back fast.
What it can do
blast_radius: all exports and all callers of a symbol in one callsimulate_edit: preview an edit in memory and check the diagnosticssafe_apply_edit: write an edit only if it could be verifiedpreview_edit: see the impact of an edit before the file changessimulate_chain: test a sequence of dependent editsfind_symbol: find symbols across all running language serversrefactor: ask the language server for refactorings and apply themstart_lsp: start or connect to a language server
When to use
- βΊWhen you rename or change a function in a large codebase and want to know what breaks first
- βΊWhen you want your agent to navigate code by meaning instead of searching text
- βΊWhen you need a refactor that checks the build and runs tests before it finishes
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
lspLets your agent get diagnostic information and code definitions. It's used to check references, symbols, and rename safety in the project.lsp-setupHas your agent set up development tools that help understand code. Useful for enabling features like autocompletion and finding function definitions.gitnexus-refactoringHelps your agent rename, extract, split, or move code safely, checking what depends on it before any file is changed.Frequently asked questions
Is it free and open source?
The readme shows a license badge and a public repository. It is a single Go binary.
Which languages work?
The readme says it runs 32 real language servers in CI, including Go, Python, TypeScript, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin and Swift.
Is it a language server itself?
No. It orchestrates existing language servers and exposes their features as MCP tools.
Does it write to my files when previewing?
No. Preview tools check the effect of an edit in memory. safe_apply_edit writes only an edit it could verify.
Why is the first session slower?
The language server must index the workspace first. The readme says later sessions reuse the warm index.
Does it reduce token use?
The readme says responses use a compact format and reports fewer tokens than grep and read on its test tasks.
If it does not work
- βΊIf a language gives no results, check that its language server (for example gopls or pyright) is installed and on your PATH.
- βΊPython and TypeScript projects need minutes of indexing at first, so wait for the daemon to finish before asking for references.
- βΊRestart your AI app fully after running agent-lsp init.
5 new skills a week. 1 minute to read.