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.

コメント

「その他」の他のコンテンツ