thousandmiles/lsp-mcp-server
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.
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
-
Clone the repository:
git clone git@github.com:thousandmiles/lsp-mcp-server.git cd lsp-mcp-server -
Run the setup script to build the project and generate the configuration:
./setup.sh -
Copy the output JSON and paste it into your MCP client configuration file.
Manual Setup
-
Install dependencies and build:
npm install npm run build -
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"] } } }