Zig Language Server
MCP server for Zig that connects AI coding assistants to ZLS (Zig Language Server) via LSP. Provides 16 tools for code intelligence (hover, go-to-definition, references, completions, diagnostics, rename, format) and build/test operations.
What is Zig Language Server?
Zig Language Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for zig that connects ai coding assistants to zls (zig language server) via lsp. provides 16 tools for code intelligence (hover, go-to-definition, references, completions, diagnostics, rena...
MCP server for Zig that connects AI coding assistants to ZLS (Zig Language Server) via LSP. Provides 16 tools for code intelligence (hover, go-to-definition, references, completions, diagnostics, rename, format) and build/test operations.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server for Zig that connects AI coding assistants to ZLS
Use Cases
Maintainer
Works with
Installation
NPM
npx -y zigManual Installation
npx -y zigConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Zig Language Server
zig-mcp bridges AI coding assistants to ZLS (Zig Language Server) via the Language Server Protocol, giving them 16 tools covering code intelligence (hover info, go-to-definition, find references, completions, diagnostics, rename, format, signature help) and build/test operations (zig build, zig test, zig check). It lets AI assistants reason about Zig projects with the same depth as a human developer using a fully configured IDE, without the assistant needing to parse source files manually.
Prerequisites
- Zig 0.15.2 or newer installed and available in PATH
- ZLS (Zig Language Server) installed — the server auto-detects it but the binary must be on PATH
- Node.js 18+ for npx-based installation, or a local build with 'zig build'
- An MCP-compatible client such as Claude Code, Cursor, or Windsurf
Install Zig and ZLS
zig-mcp requires both the Zig compiler and the ZLS language server. Install both before proceeding. ZLS version should match your Zig version.
# Install Zig from https://ziglang.org/download/
# Install ZLS from https://github.com/zigtools/zls/releasesBuild zig-mcp from source
Clone the repository and build the release binary. The compiled binary is placed in zig-out/bin/zig-mcp.
git clone https://github.com/nzrsky/zig-mcp.git
cd zig-mcp
zig build -Doptimize=ReleaseFastVerify the binary works
Run the binary with --version to confirm it compiled successfully and can find ZLS.
./zig-out/bin/zig-mcp --versionConfigure your MCP client
Add the server to your client configuration, pointing --workspace at your Zig project root. Use the absolute path to the compiled binary.
Open a Zig project and start using AI assistance
With the MCP server running, your AI assistant can now invoke LSP-backed tools against any .zig file in the workspace — no manual source parsing needed.
Zig Language Server Examples
Client configuration
Claude Desktop / Claude Code configuration for zig-mcp. Replace /path/to/zig-mcp with the actual build output path and /path/to/project with your Zig project root.
{
"mcpServers": {
"zig-mcp": {
"command": "/path/to/zig-mcp/zig-out/bin/zig-mcp",
"args": ["--workspace", "/path/to/your/zig/project"]
}
}
}Prompts to try
Example prompts after connecting zig-mcp to your AI assistant.
- "Show me the hover documentation for the allocator parameter in this function"
- "Find all references to the `parseToken` function across the project"
- "Run zig build and show me any compilation errors with their locations"
- "Rename the struct field `buf` to `buffer` everywhere in the codebase"
- "Format all .zig files in the src/ directory to match the standard style"Troubleshooting Zig Language Server
ZLS not found when starting the server
Ensure zls is on your PATH ('which zls' should return a path). Alternatively, pass --zls-path /absolute/path/to/zls to the server binary in the args array.
Build fails with Zig version mismatch
zig-mcp requires Zig 0.15.2+. Run 'zig version' to check. Download the correct Zig release from https://ziglang.org/download/ and ensure the right version is first on PATH.
Completions or diagnostics return empty results
Verify --workspace points to the directory containing your build.zig file. ZLS needs the project root to resolve imports and packages correctly.
Frequently Asked Questions about Zig Language Server
What is Zig Language Server?
Zig Language Server is a Model Context Protocol (MCP) server that mcp server for zig that connects ai coding assistants to zls (zig language server) via lsp. provides 16 tools for code intelligence (hover, go-to-definition, references, completions, diagnostics, rename, format) and build/test operations. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Zig Language Server?
Install via npm with the command: npx -y zig. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Zig Language Server?
Zig Language Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Zig Language Server free to use?
Yes, Zig Language Server is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Zig Language Server Alternatives — Similar Developer Tools Servers
Looking for alternatives to Zig Language Server? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Zig Language 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 Zig Language Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.