Universal LSP MCP server
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
One MCP server to rule all Language Servers โ automatic language detection, zero-config setup.
A Model Context Protocol (MCP) server that gives language models access to Language Server Protocol (LSP) functionality across all major programming languages. Unlike existing LSP-MCP servers, this project supports 13 languages out of the box with zero manual configuration โ it automatically detects your codebase, selects the right language server, and exposes all LSP operations through a stable, language-independent tool interface.
| Language | Language Server | Auto-Detected Via |
|---|---|---|
| Python | pyright / pylsp | pyproject.toml, setup.py |
| TypeScript | typescript-language-server | tsconfig.json |
| JavaScript | typescript-language-server | package.json |
| C# | omnisharp | *.csproj, *.sln |
| Java | vscode-java / jdtls | pom.xml, build.gradle |
| Go | gopls | go.mod |
| Rust | rust-analyzer | Cargo.toml |
| C / C++ | clangd | *.c, *.cpp, *.h |
| Ruby | solargraph | Gemfile |
| PHP | intelephense | composer.json |
| Kotlin | kotlin-language-server | build.gradle.kts |
| Swift | sourcekit-lsp | Package.swift |
package.json, Cargo.toml, go.mod, etc.)lsp_init disappears from the tool list once all servers start cleanlylsp_init reappears if a previously-working server starts failing (e.g. language added, binary missing)text field + raw LSP data in raw fieldImportant: Install
lsp-mcpon the same machine where your code lives. The language servers it manages need direct filesystem access to your codebase โ they cannot work over a remote connection or on a different machine than your source files.
Add to your workspace .vscode/mcp.json (recommended โ ensures the server runs on the same machine as your code, including SSH remotes, WSL, and Dev Containers):
Why workspace config? VS Code runs servers defined in
.vscode/mcp.jsonwherever the workspace lives. Servers defined in your user profile always run locally โ which breaks LSP when your code is on a remote machine.
The server starts with no active project. Most clients auto-initialize when they support the MCP Roots protocol (VS Code, Copilot, etc.), but lsp_init remains available as a manual override.
For clients without Roots support, the first action the model must take is calling lsp_init:
lsp_init will:
Optional: pre-warm specific languages (skips detection, faster cold start):
Persistence: Once initialized, the workspace configuration (detected languages) is saved to your OS-standard config directory (~/.config/lsp-mcp/ on Linux, ~/Library/Application Support/lsp-mcp/ on macOS, %APPDATA%\lsp-mcp\ on Windows). On subsequent server startups, the MCP server will automatically reconnect using the last-known root, so you rarely need to call lsp_init again.
Re-emergence: If a language server that was previously healthy fails to start (e.g. you added a new language or removed a binary), lsp_init will reappear in the tool list, signaling the model should re-initialize.
| Tool | Description | Key Parameters | Visibility |
|---|---|---|---|
lsp_init | Initialize server for a project root | root (required), languages (optional string array) | Conditional โ hidden after a successful explicit lsp_init call |
lsp_definition | Go to definition | file, line, character | Always |
lsp_references | Find all references | file, line, character | Always |
lsp_document_symbols | List symbols in a file | file | Always |
lsp_workspace_symbols | Search symbols across workspace | query (limit: 100โ500 results) | Always |
lsp_diagnostics | Get errors & warnings | file (scope: file or workspace) | Always |
lsp_type_definition | Go to type definition | file, line, character | Always |
lsp_implementation | Find implementations | file, line, character | Always |
lsp_health | Check status of all LSP servers | (none) | Always |
| Tool | Description | Key Parameters |
|---|---|---|
lsp_rename | Rename symbol | file, line, character, newName |
lsp_code_action | Apply / list code actions | file, line, character, apply |
lsp_formatting | Format document | file |
lsp_range_formatting | Format code range | file, range |
| Environment Variable | Description | Default |
|---|---|---|
LSP_MCP_LOG_LEVEL | Log level: error, info, debug | info |
Two helper scripts are included for setting up a development environment:
setup-languages-ubuntu24.sh โ Installs all language runtimes, compilers, and toolchains on Ubuntu 24.04 (Python, Node.js, Java, Go, Rust, Ruby, PHP, Kotlin, Swift, etc.)setup-lsp.sh โ Installs all language servers (pyright, typescript-language-server, omnisharp, jdtls, gopls, rust-analyzer, clangd, solargraph, intelephense, kotlin-language-server)If a language server cannot be auto-installed, the server logs a structured error and continues running for other languages. Manually install the missing server:
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/lsp-mcp)<a href="https://allmcps.com/mcp/lsp-mcp"><img src="https://allmcps.com/api/badge/lsp-mcp?style=directory" alt="Lsp MCP on AllMCPs" /></a>