LSP MCP Server
@Tritlo
About LSP MCP Server
An MCP server that lets you interact with LSP servers
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"lsp-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"tritlo/lsp-mcp",
"<language-id>",
"<path-to-lsp>",
"<lsp-args>"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is LSP MCP Server?
It is an MCP (Model Context Protocol) server for interacting with LSP (Language Server Protocol) interface. It acts as a bridge that allows LLMs to query LSP Hover and Completion providers.
How to use LSP MCP Server?
Configure the server in your MCP client with npx tritlo/lsp-mcp <language-id> <path-to-lsp> <lsp-args>, then run it via the command line. After starting the MCP server, you must explicitly call the start_lsp tool with a root directory before using any LSP functionality.
Key features of LSP MCP Server
- Bridges LLMs to LSP Hover and Completion providers.
- Provides MCP tools for code analysis and diagnostics.
- Offers MCP resources with real-time diagnostic subscriptions.
- Includes runtime-configurable logging with eight severity levels.
- Requires explicit LSP server start before other operations.
Use cases of LSP MCP Server
- Get hover information for functions and types at a specific file location.
- Obtain code completion suggestions at a given position in source code.
- Retrieve diagnostic error and warning messages for open files.
- Request code actions (e.g., quick fixes) for a range of code.
- Integrate language server capabilities into LLM-driven code assistants.
FAQ from LSP MCP Server
What are the prerequisites to run LSP MCP Server?
Node.js v16 or later and npm are required. For the demo Haskell server, GHC 8.10+ and Cabal 3.0+ are also needed.
How do I start the LSP server after launching the MCP server?
You must explicitly call the start_lsp tool with a root directory (e.g., /path/to/your/project) before using any LSP-related tools.
Do I need to open a file before getting diagnostics or hover information?
Yes, you must call the open_document tool to open a file in the LSP server before diagnostics or other operations on that file can be accessed.
Can I receive real-time updates for diagnostics?
Yes, diagnostic resources support subscriptions via the MCP resources/subscribe endpoint, providing updates when diagnostics change.
What log levels are available and can they be changed at runtime?
Eight severity levels are available: debug, info, notice, warning, error, critical, alert, and emergency. You can change the log level at runtime using the set_log_level tool.
Frequently asked questions
What are the prerequisites to run LSP MCP Server?
Node.js v16 or later and npm are required. For the demo Haskell server, GHC 8.10+ and Cabal 3.0+ are also needed.
How do I start the LSP server after launching the MCP server?
You must explicitly call the `start_lsp` tool with a root directory (e.g., `/path/to/your/project`) before using any LSP-related tools.
Do I need to open a file before getting diagnostics or hover information?
Yes, you must call the `open_document` tool to open a file in the LSP server before diagnostics or other operations on that file can be accessed.
Can I receive real-time updates for diagnostics?
Yes, diagnostic resources support subscriptions via the MCP `resources/subscribe` endpoint, providing updates when diagnostics change.
What log levels are available and can they be changed at runtime?
Eight severity levels are available: debug, info, notice, warning, error, critical, alert, and emergency. You can change the log level at runtime using the `set_log_level` tool.
Basic information
More Other MCP servers
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。

DeepMark
DeepMark helps teachers deliver rapid, consistent marking with meaningful feedback for every student — in a fraction of the time. What once took a week, now takes one free period.
Website
FunnyWolfAdversary simulation and Red teaming platform with AI
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Awesome Mlops
visengerA curated list of references for MLOps
Comments