MCP.so
登录

LSP MCP Server

@Tritlo

关于 LSP MCP Server

An MCP server that lets you interact with LSP servers

基本信息

分类

其他

许可证

MIT license

运行时

node

传输方式

stdio

发布者

Tritlo

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "lsp-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "tritlo/lsp-mcp",
        "<language-id>",
        "<path-to-lsp>",
        "<lsp-args>"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

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.

评论

其他 分类下的更多 MCP 服务器