Get the FREE Ultimate OpenClaw Setup Guide →

zig

Model Context Protocol (MCP) server that provides up-to-date documentation for the Zig programming language standard library and builtin functions

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio zig-wasm-zig-mcp npx -y zig-mcp@latest

How to use

The Zig Docs MCP server exposes a set of tools that generate up-to-date Zig standard library and builtin function documentation in Markdown. It mirrors Zig’s official autodoc approach by reading the STD lib sources through a WASM module and returning Markdown instead of HTML, ensuring docs stay aligned with your installed Zig version when using local mode. Core capabilities include listing available builtin functions, retrieving detailed information for specific functions, and searching or inspecting standard library items by fully qualified names. Typical usage involves starting the MCP server and then querying with commands such as list_builtin_functions, get_builtin_function, search_std_lib, and get_std_lib_item to explore signatures, parameters, errors, and usage examples. You can also switch between local documentation (via your installed Zig) and remote documentation from ziglang.org, depending on your needs.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Internet access to install the Zig MCP package via npm

Step 1: Install Node.js (if not already installed)

  • macOS: Install via Homebrew: brew install node
  • Windows: Download from https://nodejs.org and run the installer
  • Linux: Use your distribution’s package manager, e.g., sudo apt-get install nodejs npm

Step 2: Install the Zig Docs MCP package via npx (no permanent install needed)

  • The server is run using npx zig-mcp@latest. You don’t need to install a global binary; npx will fetch the latest package on first run.

Step 3: Run the MCP server (default local doc source)

  • npx -y zig-mcp@latest

Step 4: Verify the server is running

  • Access the CLI help or the embedded web view if provided by the package (follow the on-screen prompts).

Optional: Run in remote mode or configure version/document source

  • For remote docs, pass --doc-source remote and optionally --version X.Y.Z as described in the README.

Notes:

  • If you prefer not to install via npx each time, you can use a package manager wrapper (e.g., npm install -g zig-mcp) when available.
  • In environments without internet access, use local documentation mode to avoid network calls.

Additional notes

Tips and common issues:

  • Ensure your Zig installation (for local docs) is accessible in your PATH if you rely on the local doc-source option.
  • When using remote mode, cached docs will be stored under platform-specific directories (Linux: ~/.cache/zig-mcp, macOS: ~/Library/Caches/zig-mcp, Windows: %LOCALAPPDATA%\zig-mcp).
  • The tools require no auth and are designed to be query-driven: start the server, then invoke list_builtin_functions, followed by get_builtin_function for details. Use search_std_lib to locate items by name, then get_std_lib_item for full docs and source.
  • If you update Zig versions, you may want to restart the MCP server to refresh the locally detected docs.
  • If you encounter network issues in remote mode, verify your environment’s proxy settings or firewall rules.

Related MCP Servers

Sponsor this space

Reach thousands of developers