MCP.so
Sign In

LSP MCP Server

@Tritlo

About LSP MCP Server

An MCP server that lets you interact with LSP servers

Basic information

Category

Other

License

MIT license

Runtime

node

Transports

stdio

Publisher

Tritlo

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

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

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.

Comments

More Other MCP servers