get_info_on_locationLABSCO SUMMARY
The assistant stops guessing at symbols it could have looked up.
Hover types, completions, code actions and diagnostics come from the same language server your editor trusts, so the assistant reads what the compiler knows instead of inferring it from text. One launch wraps one language server, chosen by language id and executable path.
What it is
A bridge from an MCP client to one language server you choose at launch by language id, executable path and arguments. Its tools pass hover, completion, code-action and diagnostic requests to that server and return the answers.
What you get
- Hover information at a position in a file — the type and documentation the language server reports — through
get_info_on_location - Completion suggestions at a position through
get_completions - Code actions for a range, such as the fixes the server offers for an error, through
get_code_actions - Errors and warnings for the files you have opened through
get_diagnostics, pluslsp-diagnostics://resources that update over subscriptions - Control over which files the server analyses, with
open_documentandclose_document - The language server started with a project root through
start_lsp, and restarted without restarting the MCP server throughrestart_lsp_server lsp-hover://andlsp-completions://resources for the same hover and completion answers- Logging verbosity changed at runtime with
set_log_level, across eight severity levels
Requirements
Node.js 16 or later, plus the language server you want to query, passed at launch as in npx tritlo/lsp-mcp haskell /usr/bin/haskell-language-server-wrapper lsp. From version 0.2.0, call start_lsp with your project's root directory before any LSP request. No account and no key.
Setup effort
One command — npx tritlo/lsp-mcp <YOUR_LANGUAGE> <YOUR_PATH_TO_LSP> [<YOUR_LSP_ARGS>]
USE CASES
Checking what a symbol actually is before you use it
Open the file, then ask at a line and column and read back the language server's own hover text.
Completing against the real API rather than a guess
Completion candidates at the cursor position come from the language server that indexed the project.
Finding the errors a build would find
Diagnostics for one open file, or for every file currently open, without running the compiler yourself.
Getting the fix the editor would offer
Give it the line and column range around the error and it returns the code actions available there.
Recovering when the language server wedges
Restart the LSP process on its own, optionally with a new root directory, and turn up the log level to see why.
9 tools
Listed in project docs. Your client may show a different list.
get_completionsget_code_actionsopen_documentclose_documentget_diagnosticsstart_lsprestart_lsp_serverset_log_levelBEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation. Each one has its own parameters section in the README. The lsp-diagnostics://, lsp-hover:// and lsp-completions:// entries are resources, not extra tools.
Requires
- Node.js (v16 or later)
- npm
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
Build from source
git clone https://github.com/Tritlo/lsp-mcp.git
cd lsp-mcp
npm install
npm run buildnpx
npx tritlo/lsp-mcp <YOUR_LANGUAGE> <YOUR_PATH_TO_LSP> [<YOUR_LSP_ARGS>]MCP Clients
Any MCP client
{
"mcpServers": {
"lsp-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"tritlo/lsp-mcp",
"<YOUR_LANGUAGE_ID>",
"<YOUR_PATH_TO_LSP>",
"<YOUR_LSP_ARGS>"
]
}
}
}