lsp
LSP-MCP Server written in Zig
claude mcp add --transport stdio nzrsky-lsp-mcp-server lsp-mcp-server
How to use
The LSP MCP Server acts as a bridge between Model Context Protocol (MCP) clients used by AI assistants and Language Server Protocol (LSP) servers used by code editors and language tooling. It enables AI assistants like Claude Code, Claude Desktop, Gemini CLI, and GitHub Copilot to interact with any LSP-compatible language server by translating MCP requests into LSP protocol messages and returning results back through MCP. The server supports a variety of language servers (e.g., ZLS, rust-analyzer, gopls, typescript-language-server, python-lsp-server, clangd, jdtls, omnisharp) and provides a pluggable configuration to select which servers are available and how they are initialized. You can run it directly with the built-in binary and optionally wrap it in your preferred deployment method or container.
To use the MCP server in practice, start the binary and point clients at it via MCP. For example, you might run the server locally and connect an MCP client (an AI assistant integration) that requests code intelligence through the MCP bridge. The Quick Start section demonstrates using the server with a specific LSP (like zls) and shows how to configure AI assistants to start the MCP server with the desired LSP. You can also configure your own LSP server mappings and initialization options in the server configuration file under ~/.config/lsp-mcp-server/config.json, enabling precise control over which LSP servers are visible to MCP clients and how they are initialized.
How to install
Prerequisites:
- A supported host (Linux, macOS, or Windows with WSL) and appropriate runtime dependencies for your installation method
- Access to the internet to fetch packages or binaries as needed
Install via common package managers or methods shown in the project README:
- Quick start (binary distribution)
- Open a terminal and run the binary directly if downloaded and made executable:
- Download from GitHub releases
- chmod +x lsp-mcp-server
- ./lsp-mcp-server
- Package manager installation (examples from README):
-
macOS/Linux (Homebrew) brew install nzrsky/tap/lsp-mcp-server
-
Nix/NixOS nix profile install github:nzrsky/lsp-mcp-server services.lsp-mcp-server.enable = true;
-
Debian/Ubuntu curl -fsSL https://github.com/nzrsky/lsp-mcp-server/releases/latest/download/pubkey.gpg | sudo apt-key add - echo "deb https://github.com/nzrsky/lsp-mcp-server/releases/latest/download/ stable main" | sudo tee /etc/apt/sources.list.d/lsp-mcp-server.list sudo apt update && sudo apt install lsp-mcp-server
-
RHEL/Fedora/CentOS sudo dnf install lsp-mcp-server sudo dnf install epel-release sudo dnf install lsp-mcp-server
-
Arch Linux (AUR) yay -S lsp-mcp-server or paru -S lsp-mcp-server
-
openSUSE sudo zypper install lsp-mcp-server
-
Alpine Linux sudo apk add lsp-mcp-server
-
FreeBSD pkg install lsp-mcp-server
-
NetBSD pkg_add lsp-mcp-server
-
Gentoo emerge lsp-mcp-server
-
Void Linux xbps-install lsp-mcp-server
- Universal package managers (examples):
-
Snap (Linux) sudo snap install lsp-mcp-server
-
Flatpak (Linux) flatpak install flathub org.lsp_mcp_server.LspMcpServer
-
AppImage (Linux) wget https://github.com/nzrsky/lsp-mcp-server/releases/latest/download/lsp-mcp-server-x86_64.AppImage chmod +x lsp-mcp-server-x86_64.AppImage ./lsp-mcp-server-x86_64.AppImage
-
Smithery (Cross-platform) smithery install lsp-mcp-server
- Language-specific package managers (example commands):
-
Cargo (Rust) cargo install lsp-mcp-server
-
npm (Node.js) npm install -g lsp-mcp-server
-
Go go install github.com/nzrsky/lsp-mcp-server@latest
- Build from source (if you prefer): git clone https://github.com/nzrsky/lsp-mcp-server.git cd lsp-mcp-server make build sudo make install
Notes:
- The binary name is lsp-mcp-server and it is designed to be run as a standalone service or wrapped in your preferred orchestration.
- When using container or CI/CD environments, you can pull the official image (ghcr.io/nzrsky/lsp-mcp-server:latest) and run it as described in the Quick Start.
Additional notes
Configuration is stored at ~/.config/lsp-mcp-server/config.json. You can define multiple servers and their initialization options, and you can enable/disable specific language servers as needed. Ensure the LSP servers you want to bridge are installed on the host or available in your container image. If you encounter connectivity issues, verify that MCP clients are pointing to the correct address/port of the lsp-mcp-server instance and that any required permissions or firewall rules allow communication. For AI assistant integrations (Claude Code, Claude Desktop, Gemini CLI, GitHub Copilot), you typically provide an MCP server entry with the command and the --server flag corresponding to the chosen LSP server (e.g., zls, rust-analyzer, gopls).
Related MCP Servers
cclsp
Claude Code LSP: enhance your Claude Code experience with non-IDE dependent LSP integration.
swiftlens
SwiftLens is a Model Context Protocol (MCP) server that provides deep, semantic-level analysis of Swift codebases to any AI models. By integrating directly with Apple's SourceKit-LSP, SwiftLens enables AI models to understand Swift code with compiler-grade accuracy.
gRPC-zig
blazigly fast gRPC/MCP client & server implementation in zig
furi
CLI & API for MCP management
cursor-rust-tools
A MCP server to allow the LLM in Cursor to access Rust Analyzer, Crate Docs and Cargo Commands.
zig
A Model Context Protocol (MCP) server that provides Zig language tooling, code analysis, and documentation access. This server enhances AI capabilities with Zig-specific functionality including code optimization, compute unit estimation, code generation, and best practices recommendations.