LSP MCP Server
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.
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
Maintainer
Works with
Installation
Manual Installation
npx lsp-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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 buildInstall 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-serverAdd 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"]
}
}
}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.
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.
LSP MCP Server Alternatives — Similar Coding Agents Servers
Looking for alternatives to LSP MCP Server? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up LSP MCP Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.