zig-mcp

by nzrsky

Not rated
GitHub

About

MCP server for Zig that connects AI coding assistants to ZLS (Zig Language Server) via LSP — 16 tools for code intelligence, build, and test.

Details

Author
nzrsky
Categories
Developer Tools

Setup

Install zig-mcp in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/nzrsky/zig-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

MCP server for Zig that connects AI coding assistants toZLSvia the Language Server Protocol.

Works withClaude Code, Cursor, Windsurf, and any MCP-compatible client.

AI assistant <--(MCP stdio)--> zig-mcp <--(LSP pipes)--> ZLS | zig build / test / check

- Zig0.17.0-dev.1415+64dfaa568 or newer
-
ZLS(auto-detected from PATH, or specify with--zls-path)

Install directly from the Claude Code interface — no manual build needed:

# 1. Add the marketplace /plugin marketplace add nzrsky/zig-mcp # 2. Install the plugin /plugin install zig-mcp@zig
claude plugin marketplace add nzrsky/zig-mcp && claude plugin install zig-mcp@zig

The binary is built automatically on first use. Just make surezigandzlsare in your PATH.

git clone https://github.com/nzrsky/zig-mcp.git cd zig-mcp zig build -Doptimize=ReleaseFast

If you installed via the plugin system, skip this section — everything is configured automatically.

# add globally claude mcp add zig-mcp -- /absolute/path/to/zig-mcp --workspace /path/to/your/zig/project # add for current project only claude mcp add --scope project zig-mcp -- /absolute/path/to/zig-mcp --workspace /path/to/your/zig/project
{ "mcpServers": { "zig-mcp": { "command": "/absolute/path/to/zig-mcp", "args": ["--workspace", "/path/to/your/zig/project"] } } }

If you omit--workspace, zig-mcp uses the current working directory.

Add to.cursor/mcp.jsonin your project:

{ "mcpServers": { "zig-mcp": { "command": "/absolute/path/to/zig-mcp", "args": ["--workspace", "/path/to/your/zig/project"] } } }

Add to~/.codeium/windsurf/mcp_config.json:

{ "mcpServers": { "zig-mcp": { "command": "/absolute/path/to/zig-mcp", "args": ["--workspace", "/path/to/your/zig/project"] } } }
--workspace, -w <path> Project root directory (default: cwd) --zls-path <path> Path to ZLS binary (default: auto-detect from PATH) --help, -h Show help --version Show version

All of these answer from ZLS's semantic model — the part a shell and a text search cannot reach.

There is nozig_build,zig_test,zig_format,zig_version,zig_checkorzig_manage. They used to exist and wrappedzig build,zig test,zig fmt,zig version,zig ast-checkandzvm— and a wrapper loses to the shell it wraps: no pipes, no redirection, no working directory of its own. Session transcripts settle it: 526zig buildinvocations through the shell, zero calls to the tool. Run those with your shell.

zig-mcp spawns ZLS as a child process and talks to it over stdin/stdout using the LSP protocol (Content-Length framing). On the other side, it speaks MCP (newline-delimited JSON-RPC) to the AI assistant.

- main-- reads MCP requests, dispatches tool calls, writes responses
- reader-- reads LSP responses from ZLS, correlates by request ID
- stderr-- forwards ZLS stderr to the server log

If ZLS crashes, zig-mcp automatically restarts it and re-opens all tracked documents.

Files are opened in ZLS lazily on first access, and re-synced (didChange) whenever their contents change on disk -- no need to manage document state manually.

# build zig build # run tests (162 unit tests, including a fake-ZLS harness) zig build test # quality gates: lint, coverage, dead code, mutants make lint cov deadcode mutants # run manually echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}' | \ zig-out/bin/zig-mcp --workspace . 2>/dev/null

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

A stateful LSP runtime for AI agents: warm language server sessions with 50+ tools for go-to-definition, find-references, diagnostics, rename, and more across 30+ languages.

MCP server for the Brainfuck programming language that allows your favourite LLM to debug Brainfuck programs.

Diagnoses token waste in Claude Code sessions with 6 anomaly types and severity scoring. Fully local.

MCP server that gives coding agents program-analysis primitives — data flow, call graphs, taint analysis — so they reason from ground truth instead of grep-and-guess. (same as the GitHub About — keeps your messaging consistent across the web).

An MCP service that equips your workspace with a complete set of AI-accessible development tools for reading, editing, executing, and managing code.

Fennara MCP connects AI agents like Codex, Cursor, Claude Code, and Claude Desktop to Godot-aware tools for real Godot projects. It focuses on feedback from Godot: GDScript diagnostics, scene validation, runtime errors, scene inspection, node properties, screenshots, SemanticSearch, and patch-and-rerun workflows.

Search verified engineering fixes by error message or technology. Step-by-step solutions with trust scores, built for developers and AI agents.

LSP-Claw is an MCP server that lets an AI agent safely build, run, and debug Lua/LSP web apps inside a controlled Mako/Xedge/BAS lab, including on embedded or RTOS devices.

Integrates with Language Server Protocol (LSP) to provide features like code completion, diagnostics, and hover information.

Visual Studio extension with 20 Roslyn-powered MCP tools for AI assistants. Semantic code navigation, symbol search, inheritance, call graphs, safe rename, build/test.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.