Zig Language Server

v1.0.0Developer Toolsstable

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.

mcpmodelcontextprotocolzigzig-std
Share:
158
Stars
0
Downloads
0
Weekly
0/5

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

LSP integration for Zig
Code intelligence (hover, go-to-def)
Build and test operations
nzrsky

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 11, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y zig

Manual Installation

npx -y zig

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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/releases
2

Build 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=ReleaseFast
3

Verify the binary works

Run the binary with --version to confirm it compiled successfully and can find ZLS.

./zig-out/bin/zig-mcp --version
4

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

5

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.

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.

Quick Config Preview

{ "mcpServers": { "zig": { "command": "npx", "args": ["-y", "zig"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides