Zig MCP Server

MCP server for Zig that connects AI coding assistants to [ZLS](https://github.com/zigtools/zls) via the Language Server Protocol.

Local serverstdio

What is the Zig MCP Server?

MCP server for Zig that connects AI coding assistants to ZLS via the Language Server Protocol.

The short version

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.

What it needs from you

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
zig_definitionThe one true declaration, followed through imports and aliases. Takes symbol or file+line+character
zig_referencesReal usages, scope-aware; skips same-named identifiers, comments and strings. symbol mode also searches through re-exports
zig_hoverThe type after comptime evaluation and inference — invisible in the source text
zig_diagnosticsErrors for one file without building the project, re-synced against disk first
zig_workspace_symbolsDeclarations by name, not every line mentioning it
zig_document_symbolsA file's outline: declarations, kinds, nesting
zig_completionWhat can legally follow at a position, with types
zig_signature_helpThe real signature, comptime and generic parameters included
zig_renameWhich files a rename touches, scope-aware
zig_code_actionQuick fixes ZLS offers for a range
zig_inlay_hintsEvery inferred type in a file at once — nothing of this is in the source text
zig_type_definitionThe declaration of a value's type, not of the value
zig_ast_queryCode by shape: empty catch {}, catch unreachable, undefined initializers, unreachable, @panic. Matched over the syntax tree, so comments and string literals nev
zig_unused_privatePrivate declarations nothing refers to — exact, because a non-pub name cannot escape its file

How to install the Zig MCP Server

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

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

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

Example prompts to try

  • “Use Zig MCP to zig definition.”
  • “Use Zig MCP to zig references.”
  • “Use Zig MCP to zig hover.”

Frequently asked questions

MCP server for Zig that connects AI coding assistants to [ZLS](https://github.com/zigtools/zls) via the Language Server Protocol. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.