lsp-mcp

lsp-mcp

32

The LSP MCP Server bridges LLMs with LSP servers, allowing for advanced code suggestions and features like diagnostics and completion. It includes logging, a CLI, and supports extensions for language-specific capabilities.

Overview

The LSP MCP Server is an MCP (Model Context Protocol) server designed to interact with the LSP (Language Server Protocol) interface. It facilitates communication between LLMs (Language Learning Models) and LSP servers to provide accurate code suggestions. Key features include: LSP client startup, MCP tools for requests, and real-time resource updates such as diagnostics and hover information. It offers comprehensive logging, a simple CLI, and extension support for language-specific enhancements.

Features

  • get_info_on_location: Retrieves hover information.
  • get_completions: Provides code completion suggestions.
  • get_code_actions: Offers code actions for a file range.
  • open_document and close_document: Manage file analysis.
  • start_lsp and restart_lsp_server: Manage LSP server state.
  • Real-time diagnostic, hover, and completion resource updates.

Usage

Initialize and use the server by specifying the LSP path and language. A logging system is available with multiple severity levels. Extensions support additional language-specific functionalities.