Get the FREE Ultimate OpenClaw Setup Guide →

lsp

LSP-MCP Server written in Zig

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. 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
  1. 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

  1. Universal package managers (examples):
  1. 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

  1. 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

Sponsor this space

Reach thousands of developers