drio
Open app

LSP MCP Server

Source

An MCP server that lets you interact with LSP servers

Catalog onlyCatalog onlySTDIO

Overview

LSP MCP Server is an MCP (Model Context Protocol) server designed to facilitate interaction with LSP (Language Server Protocol) interfaces, enabling LLMs (Large Language Models) to query LSP Hover and Completion providers for enhanced code suggestions.

To use the LSP MCP Server, clone the repository, install the dependencies, and run the server by providing the path to the LSP executable along with any necessary arguments. Ensure to start the LSP server using the start_lsp tool before utilizing other functionalities.

  • get_info_on_location: Retrieve hover information at a specific file location. - get_completions: Obtain completion suggestions at a specific file location. - get_code_actions: Get code actions for a specified range in a file. - start_lsp: Initialize the LSP server with a designated root directory. - restart_lsp_server: Restart the LSP server without restarting the MCP server. - Detailed logging for debugging and auditing. - Simple command-line interface.
  1. Enhancing code completion suggestions in IDEs.
  2. Providing hover information for better code understanding.
  3. Facilitating code actions for refactoring and improvements.

Add to your AI client

Use these steps to connect LSP MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "lsp-mcp-tritlo": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "lsp-mcp-tritlo": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "lsp-mcp-tritlo": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "lsp-mcp-tritlo": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "lsp-mcp-tritlo": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "lsp-mcp-tritlo": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-lsp-mcp-tritlo"
      ]
    }
  }
}

FAQ

What are the prerequisites for using LSP MCP Server?

You need Node.js (v16 or later) and npm installed. For the demo server, GHC (8.10 or later) and Cabal (3.0 or later) are required.

How do I enable logging?

You can enable logging by setting the `LSP_MCP_LOG` environment variable before starting the server.

Can I restart the LSP server without stopping the MCP server?

Yes! You can use the `restart_lsp_server` tool to restart the LSP server independently.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":3865,"uuid":"aeb9bb9d-b481-4a74-9b50-374619ba2ca8","name":"lsp-mcp","title":"LSP MCP Server","description":"An MCP server that lets you interact with LSP servers","avatar_url":"https://avatars.githubusercontent.com/u/1667287?v=4","created_at":"$D2025-03-22T04:35:53.502Z","updated_at":"$D2025-03-22T04:52:40.930Z","status":"created","author_name":"Tritlo","author_avatar_url":"https://avatars.githubusercontent.com/u/1667287?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/Tritlo/lsp-mcp","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"0\",\"license\":\"MIT license\",\"language\":\"TypeScript\",\"is_official\":false,\"latest_commit_time\":\"2025-03-22 22:16:02\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]