MCP server for Zig that connects AI coding assistants to [ZLS](https://github.com/zigtools/zls) via the Language Server Protocol.
MCP server for Zig that connects AI coding assistants to ZLS via the Language Server Protocol. That is what the zig mcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.
There is no zig_build, zig_test, zig_format, zig_version, zig_check or zig_manage. They used to exist and wrapped zig build, zig test, zig fmt, zig version, zig ast-check and zvm — and a wrapper loses to the shell it wraps: no pipes, no redirection, no working directory of its own. Session transcripts settle it: 526 zig build invocations through the shell, zero calls to the tool. Run those with your shell.
The server publishes 14 tools. What each one is for:
zig_definition — The one true declaration, followed through imports and aliases. Takes symbol or file+line+characterzig_references — Real usages, scope-aware; skips same-named identifiers, comments and strings. symbol mode also searches through re-exportszig_hover — The type after comptime evaluation and inference — invisible in the source textzig_diagnostics — Errors for one file without building the project, re-synced against disk firstzig_workspace_symbols — Declarations by name, not every line mentioning itzig_document_symbols — A file's outline: declarations, kinds, nestingzig_completion — What can legally follow at a position, with typeszig_signature_help — The real signature, comptime and generic parameters includedzig_rename — Which files a rename touches, scope-awarezig_code_action — Quick fixes ZLS offers for a rangezig_inlay_hints — Every inferred type in a file at once — nothing of this is in the source textzig_type_definition — The declaration of a value's type, not of the valueSetup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.
Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Zig MCP's toolset — zig_definition, zig_references, zig_hover and 11 more — is a fair guide to whether it matches your workflow. It is maintained by nzrsky; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| zig_definition | The one true declaration, followed through imports and aliases. Takes symbol or file+line+character |
| zig_references | Real usages, scope-aware; skips same-named identifiers, comments and strings. symbol mode also searches through re-exports |
| zig_hover | The type after comptime evaluation and inference — invisible in the source text |
| zig_diagnostics | Errors for one file without building the project, re-synced against disk first |
| zig_workspace_symbols | Declarations by name, not every line mentioning it |
| zig_document_symbols | A file's outline: declarations, kinds, nesting |
| zig_completion | What can legally follow at a position, with types |
| zig_signature_help | The real signature, comptime and generic parameters included |
| zig_rename | Which files a rename touches, scope-aware |
| zig_code_action | Quick fixes ZLS offers for a range |
| zig_inlay_hints | Every inferred type in a file at once — nothing of this is in the source text |
| zig_type_definition | The declaration of a value's *type*, not of the value |
| zig_ast_query | Code by shape: empty catch {}, catch unreachable, undefined initializers, unreachable, @panic. Matched over the syntax tree, so comments and string literals never match and multi-line forms always do |
| zig_unused_private | Private declarations nothing refers to — exact, because a non-pub name cannot escape its file |
Or edit `~/.claude/mcp_servers.json`:
```json
{
"mcpServers": {
"zig-mcp": {
"command": "/absolute/path/to/zig-mcp",
"args": ["--workspace", "/path/to/your/zig/project"]
}
}
}Configuration as documented by the project. Restart the client after saving.
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.