LSP MCP Server

v1.0.0Coding Agentsstable

Provides code refactoring capabilities for TypeScript/JavaScript and Python through Language Server Protocol integration. Enables renaming symbols, extracting functions, finding references, and moving code between files via natural language commands.

lsp-mcp-servermcpai-integration
Share:
125
Stars
0
Downloads
0
Weekly
0/5

What is LSP MCP Server?

LSP MCP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to provides code refactoring capabilities for typescript/javascript and python through language server protocol integration. enables renaming symbols, extracting functions, finding references, and moving...

Provides code refactoring capabilities for TypeScript/JavaScript and Python through Language Server Protocol integration. Enables renaming symbols, extracting functions, finding references, and moving code between files via natural language commands.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Provides code refactoring capabilities for TypeScript/JavaSc

Use Cases

Refactor TypeScript/JavaScript and Python code through LSP.
Rename symbols, extract functions, and move code between files.
Tritlo

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx lsp-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use LSP MCP Server

LSP MCP Server bridges the Language Server Protocol and the Model Context Protocol, giving AI agents access to real-time IDE-grade code intelligence from any LSP-compatible language server. It exposes tools for hover documentation, code completion, diagnostics (errors and warnings), code actions (refactors and quick fixes), and document lifecycle management — all driven by natural language commands. TypeScript, JavaScript, Python, Haskell, and any language with an LSP server are supported, making it ideal for AI-assisted code review, refactoring, and debugging workflows.

Prerequisites

  • Node.js 16+ and npm installed
  • A language server binary for your target language (e.g. typescript-language-server, pylsp, haskell-language-server)
  • An MCP-compatible client such as Claude Desktop or Cursor
  • The LSP MCP server built from source (no npm package currently; build required)
1

Clone and build the server

Clone the lsp-mcp repository and install dependencies. The TypeScript source must be compiled before running.

git clone https://github.com/Tritlo/lsp-mcp.git
cd lsp-mcp
npm install
npm run build
2

Install a language server for your target language

The MCP server wraps your existing language server — you must have one installed. Install the appropriate language server for your project's language.

# TypeScript/JavaScript
npm install -g typescript-language-server typescript

# Python
pip install python-lsp-server

# Haskell
gh release download --repo haskell/haskell-language-server
3

Add to your MCP client config

Configure your MCP client to launch the LSP MCP server with your chosen language ID and the path to the language server binary. The language-id must match LSP conventions (e.g. typescript, python, haskell).

{
  "mcpServers": {
    "lsp-mcp": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/lsp-mcp/dist/index.js", "typescript", "typescript-language-server", "--stdio"]
    }
  }
}
4

Initialize the LSP server in your session

Before using any LSP features, call the start_lsp tool with the root directory of your project. This is a required first step — LSP tools will not work until the server is initialized.

5

Open a file and explore diagnostics

Ask your AI client to open a source file and retrieve diagnostics. The server tracks open documents through open_document and close_document to match LSP document lifecycle semantics.

LSP MCP Server Examples

Client configuration

MCP config for a TypeScript project using typescript-language-server. Adjust the path to match where you cloned and built lsp-mcp.

{
  "mcpServers": {
    "lsp-mcp": {
      "type": "stdio",
      "command": "node",
      "args": [
        "/Users/yourname/lsp-mcp/dist/index.js",
        "typescript",
        "typescript-language-server",
        "--stdio"
      ],
      "env": {}
    }
  }
}

Prompts to try

These prompts leverage LSP tools for real-time code intelligence, refactoring, and diagnostics.

- "Start the LSP server for this TypeScript project and show me all current errors"
- "What does the function at line 42 column 10 in src/index.ts do? (hover info)"
- "Get code completion suggestions at the current cursor position in utils.py"
- "What refactoring actions are available for the selected range in app.ts?"
- "Open src/auth.ts and show me all diagnostics — errors, warnings, and hints"
- "Enable debug logging so I can see the raw LSP communication"

Troubleshooting LSP MCP Server

LSP tools return 'server not initialized' errors

You must call the start_lsp tool first with the root_dir set to your project root. This is a required initialization step before any other LSP tool can be used in a session.

Language server binary not found when starting LSP

Ensure the language server is installed globally and on your PATH. For typescript-language-server run 'npm install -g typescript-language-server typescript'. Pass the full absolute path to the binary in the MCP config args if it is not on PATH.

Diagnostics are empty even for files with known errors

Open the file explicitly using the open_document tool before calling get_diagnostics. LSP servers only compute diagnostics for documents that have been opened in the current session. Also check that the language_id argument matches the file type exactly.

Frequently Asked Questions about LSP MCP Server

What is LSP MCP Server?

LSP MCP Server is a Model Context Protocol (MCP) server that provides code refactoring capabilities for typescript/javascript and python through language server protocol integration. enables renaming symbols, extracting functions, finding references, and moving code between files via natural language commands. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install LSP MCP Server?

Follow the installation instructions on the LSP MCP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with LSP MCP Server?

LSP MCP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is LSP MCP Server free to use?

Yes, LSP MCP Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use LSP MCP Server?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides