lsp-mcp

lsp-mcp

3.5

If you are the rightful owner of lsp-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

An MCP (Model Context Protocol) server for interacting with LSP (Language Server Protocol) interface.

The LSP MCP Server acts as a bridge that allows Language Model Models (LLMs) to query LSP Hover and Completion providers. It starts an LSP client that connects to an LSP server, exposes MCP tools to send requests to the LSP server, and returns results in a format that LLMs can understand and use. This enables LLMs to utilize LSPs for more accurate code suggestions. The server supports various programming languages and provides tools for getting hover information, completion suggestions, code actions, and diagnostics. It also includes a comprehensive logging system and supports extensions for language-specific enhancements.

Features

  • Comprehensive logging system with multiple severity levels
  • Colorized console output for better readability
  • Runtime-configurable log level
  • Detailed error handling and reporting
  • Simple command-line interface

Tools

  1. get_info_on_location

    Get hover information at a specific location in a file

  2. get_completions

    Get completion suggestions at a specific location in a file

  3. get_code_actions

    Get code actions for a specific range in a file

  4. open_document

    Open a file in the LSP server for analysis

  5. close_document

    Close a file in the LSP server

  6. get_diagnostics

    Get diagnostic messages (errors, warnings) for open files

  7. start_lsp

    Start the LSP server with a specified root directory

  8. restart_lsp_server

    Restart the LSP server without restarting the MCP server

  9. set_log_level

    Change the server's logging verbosity level at runtime