Zig

Docs and learning

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

Your AI app calls the Zig MCP server, which does the work through tools like list_builtin_functions, get_builtin_function, search_std_lib and get_std_lib_item and sends the result back to the chat.

About Zig

Zig is a community MCP server from zig-wasm, filed in our directory under docs and learning. Model Context Protocol (MCP) server that provides up-to-date documentation for the Zig programming language standard library and builtin functions.

Zig runs on your own machine: your AI app starts it with the command npx -y zig-mcp and talks to it over standard input and output.

The README for Zig lists tools such as list_builtin_functions, get_builtin_function, search_std_lib and get_std_lib_item, which your AI app can call once the server is connected.

At a glance

Publisher
zig-wasm (community)
Runs
Locally on your machine
Install from
Node.js package on npm: zig-mcp
Written in
TypeScript
License
MIT
GitHub stars
179

Tools Zig gives your AI app

  • list_builtin_functionsLists all available Zig builtin functions. Builtin functions are provided by the compiler and are prefixed with '@'. The comptime keyword on a parameter means t
  • get_builtin_functionSearch for Zig builtin functions by name and get their documentation, signatures, and usage information. Returns all matching functions ranked by relevance.
  • search_std_libSearch the Zig standard library for declarations by name. Returns a list of matching items with their fully qualified names. Use this to discover available type
  • get_std_lib_itemGet detailed documentation for a specific standard library item by its fully qualified name (e.g., "std.ArrayList.init"). Returns comprehensive documentation in

Tool names as the Zig README lists them. Your AI app shows the live list once Zig is connected.

How to set up Zig

  1. Install Node.js on the machine that runs your AI app, because Zig starts with npx and downloads its package on first run.
  2. Check the Zig README for keys or settings; the registry lists none that Zig requires.
  3. Add Zig to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Zig tools to confirm the connection.
  5. Run one read-only task with Zig first, such as a call to list_builtin_functions, before you allow anything that writes or sends.

Zig compared with similar servers

  • mcpSafetyScanner by johnhalloran321 has fewer GitHub stars than Zig (178 against 179); both are community servers, and both run locally.
  • Scholarly by adityak74 has more GitHub stars than Zig (185 against 179); both are community servers, and both run locally. The Scholarly README lists 3 tools to Zig's 4.
  • Simple Pubmed by andybrandt has fewer GitHub stars than Zig (172 against 179); both are community servers, and both run locally.

Before you connect Zig

  • Give Zig its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Zig tool call until you trust what it does with them.
  • Treat text that Zig fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Zig on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Zig

How marketing and sales teams put Zig to work, by company size. Pick the size closest to yours and start Zig on one use case.

Small business

  • A small business can use Zig to keep help docs and how-tos current, answering customer questions before they become tickets.
  • Owners can ask Zig for up-to-date docs while setting up a tool, instead of trusting an old tutorial.
  • Zig runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can connect Zig so agents write from current product docs, keeping launch copy accurate.
  • Enablement teams can use Zig to turn docs into training and battlecards sales actually uses.
  • Start with list_builtin_functions and get_builtin_function, the tools Zig lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can serve approved docs through Zig, so every agent answers from the same source of truth.
  • Large orgs can use Zig to keep documentation in sync across products and regions as features ship.
  • Zig is a community server, so have security review the code and pin a version before Zig touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Zig README

From zig-wasm/zig-mcp on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Zig Docs MCP

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

It uses the same approach as Zig's official autodoc (ziglang.org) by reading STD lib source files directly through a WASM module. However instead of returning HTML, it outputs Markdown which significantly reduces token usage.

By default, the server uses your locally installed Zig compiler to serve documentation, ensuring you always get docs that match your actual Zig version. It can also fetch documentation from ziglang.org if needed.

[!TIP] Add use zigdocs to your prompt if you want to explicitly instruct the LLM to use Zig docs tools. Otherwise, LLM will automatically decide when to utilize MCP tools based on the context of your questions.

Tools

  • list_builtin_functions - Lists all available Zig builtin functions. Builtin functions are provided by the compiler and are prefixed with '@'. The comptime keyword on a parameter means that the parameter must be known at compile time. Use this to discover what functions are available, then use 'get_builtin_function' to get detailed documentation.
  • get_builtin_function - Search for Zig builtin functions by name and get their documentation, signatures, and usage information. Returns all matching functions ranked by relevance.
  • search_std_lib - Search the Zig standard library for declarations by name. Returns a list of matching items with their fully qualified names. Use this to discover available types, functions, and constants in the standard library.
  • get_std_lib_item - Get detailed documentation for a specific standard library item by its fully qualified name (e.g., "std.ArrayList.init"). Returns comprehensive documentation including function signatures, parameters, errors, examples, and source code. Set get_source_file: true to retrieve the entire source file where the item is implemented.

Commands

The CLI provides flexible options for version control and update management:

# Start MCP server
zig-mcp --doc-source local

# Use specific Zig version from ziglang.org instead of local Zig
zig-mcp --doc-source remote --version 0.14.1

# Enable automatic daily updates
zig-mcp --doc-source remote --update-policy daily

# Update documentation without starting MCP server (only for remote)
zig-mcp update --version 0.15.1

# Start local web server to view documentation
zig-mcp view --version 0.15.1

Version options --version:

  • master (default) - Latest development version from Zig's master branch
  • 0.14.1, 0.14.0, etc. - Specific Zig release versions

Update policies --update-policy:

  • manual (default) - No automatic updates, manual control only
  • daily - Check for documentation updates once per day
  • startup - Update documentation every time the server starts

Documentation sources --doc-source:

  • local (default) - Use your locally installed Zig compiler's documentation server (zig std)
  • remote - Download documentation from ziglang.org

Documentation Sources

Local Mode (Default)

The server automatically uses your local Zig installation to serve documentation via zig std. This ensures:

  • Documentation always matches your installed Zig version
  • No network requests needed for standard library docs
  • Faster response times
Remote Mode

When using --doc-source remote, documentation is fetched from ziglang.org and cached in platform-specific directories:

  • Linux: ~/.cache/zig-mcp/
  • macOS: ~/Library/Caches/zig-mcp/
  • Windows: %LOCALAPPDATA%\zig-mcp\

Installation

The installation examples below use the local documentation source by default. In local mode, docs are served by your installed Zig via zig std, requiring no network and matching your actual Zig version. This is the recommended setup for most users. For downloading docs from ziglang.org instead, see Remote Documentation (Optional) below.

Claude Code

Using npx (Node.js)

claude mcp add zig-docs -- npx -y zig-mcp@latest

Using bunx (Bun)

claude mcp add zig-docs -- bunx zig-mcp@latest
Roo Code
  1. Click the MCP button in Roo Code
  2. Select "Edit Global MCP" or "Edit Project MCP"
  3. Add the configuration from the JSON template below
Augment Code

Navigate to Settings → MCP Servers → Add Server and use the JSON template below.

Claude Desktop

Add the JSON configuration below to your MCP settings file.

JSON Configuration Template

Node.js:

{
  "mcpServers": {
    "zig-docs": {
      "command": "npx",
      "args": ["-y", "zig-mcp@latest"]
    }
  }
}

Bun:

{
  "mcpServers": {
    "zig-docs": {
      "command": "bunx",
      "args": ["zig-mcp@latest"]
    }
  }
}
Remote Documentation (Optional)

If you prefer downloading documentation from ziglang.org instead of using your local Zig, enable remote mode explicitly and choose a version:

Using npx (Node.js)

claude mcp add zig-docs -- npx -y zig-mcp@latest --doc-source remote --version master

Using bunx (Bun)

claude mcp add zig-docs -- bunx zig-mcp@latest --doc-source remote --version 0.14.1

Node.js (remote):

{
  "mcpServers": {
    "zig-docs": {
      "command": "npx",
      "args": ["-y", "zig-mcp@latest", "--doc-source", "remote", "--version", "master"]
    }
  }
}

Bun (remote):

{
  "mcpServers": {
    "zig-docs": {
      "command": "bunx",
      "args": ["zig-mcp@latest", "--doc-source", "remote", "--version", "0.14.1"]
    }
  }
}

Questions about Zig

What is the Zig MCP server?

Model Context Protocol (MCP) server that provides up-to-date documentation for the Zig programming language standard library and builtin functions. Zig is maintained by zig-wasm on GitHub at zig-wasm/zig-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Zig MCP server?

Add Zig to your AI app's MCP config with the command npx -y zig-mcp. In Claude Code, run claude mcp add --transport stdio zig -- npx -y zig-mcp. To run Zig this way you need Node.js installed.

Does Zig need an API key?

The registry lists no required keys for Zig. Check the Zig README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Zig an official MCP server?

No. Zig is a community server maintained by zig-wasm. Community servers can be excellent; read the code and the open issues before you give Zig access to company data.

What license is Zig under?

Zig is released under the MIT license, according to its GitHub repository. The license covers the code of Zig; the service it connects to has its own terms.