lsp-mcp-server

thousandmiles/lsp-mcp-server

3.2

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

This server provides semantic code analysis capabilities using the Language Server Protocol (LSP) and acts as a bridge between MCP and LSP.

Tools
4
Resources
0
Prompts
0

Semantic Code MCP Server

This is a Model Context Protocol (MCP) server that provides semantic code analysis capabilities using the Language Server Protocol (LSP).

Features

  • Semantic Navigation: Go to definition, find references, hover info.
  • Relationship Analysis: Check if function A calls function B (using LSP references).

Architecture

This server acts as a bridge between MCP and LSP. It spawns a typescript-language-server instance and translates MCP tool calls into LSP JSON-RPC requests.

Tools

  • get_definition: Find where a symbol is defined.
  • get_references: Find all usages of a symbol.
  • search_in_file: Search for a string in a file to find its line and character position.
  • check_function_call: Analyze if one function calls another.

Usage

Installation

  1. Clone the repository:

    git clone git@github.com:thousandmiles/lsp-mcp-server.git
    cd lsp-mcp-server
    
  2. Run the setup script to build the project and generate the configuration:

    ./setup.sh
    
  3. Copy the output JSON and paste it into your MCP client configuration file.

Manual Setup

  1. Install dependencies and build:

    npm install
    npm run build
    
  2. Configure your MCP client (e.g. Claude Desktop) to run this server:

    {
      "mcpServers": {
        "semantic-code": {
          "command": "node",
          "args": ["/path/to/code_node/build/index.js"]
        }
      }
    }