Skip to content
Back to search

zig-mcp

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/zig-wasm--zig-mcp/badge.svg)](/listings/zig-wasm--zig-mcp)

HTML

<a href="/listings/zig-wasm--zig-mcp"><img src="/api/listings/zig-wasm--zig-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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"]
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 165 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Zig Docs MCP
  2. Model Context Protocol (MCP) server that provides up-to-date documentation for the Zig programming language standard library and builtin functions.
  3. 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.
  4. 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.
  5. > [!TIP]
  6. > 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.
  7. <p align="center" width="100%">
  8. <img src="https://raw.githubusercontent.com/zig-wasm/.github/refs/heads/main/static/readme_mcp_1.gif" width="49%" />
  9. <img src="https://raw.githubusercontent.com/zig-wasm/.github/refs/heads/main/static/readme_mcp_2.gif" width="49%" />
  10. </p>
  11. ## Tools
  12. - **`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.
  13. - **`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.
  14. - **`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.
  15. - **`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.
  16. ## Commands
  17. The CLI provides flexible options for version control and update management:
  18. ```bash
  19. # Start MCP server
  20. zig-mcp --doc-source local
  21. # Use specific Zig version from ziglang.org instead of local Zig
  22. zig-mcp --doc-source remote --version 0.14.1
  23. # Enable automatic daily updates
  24. zig-mcp --doc-source remote --update-policy daily
  25. # Update documentation without starting MCP server (only for remote)
  26. zig-mcp update --version 0.15.1
  27. # Start local web server to view documentation
  28. zig-mcp view --version 0.15.1
  29. ```
  30. **Version options `--version`**:
  31. - `master` (default) - Latest development version from Zig's master branch
  32. - `0.14.1`, `0.14.0`, etc. - Specific Zig release versions
  33. **Update policies `--update-policy`**:
  34. - `manual` (default) - No automatic updates, manual control only
  35. - `daily` - Check for documentation updates once per day
  36. - `startup` - Update documentation every time the server starts
  37. **Documentation sources `--doc-source`**:
  38. - `local` (default) - Use your locally installed Zig compiler's documentation server (`zig std`)
  39. - `remote` - Download documentation from ziglang.org
  40. ## Documentation Sources
  41. ### Local Mode (Default)
  42. The server automatically uses your local Zig installation to serve documentation via `zig std`. This ensures:
  43. - Documentation always matches your installed Zig version
  44. - No network requests needed for standard library docs
  45. - Faster response times
  46. ### Remote Mode
  47. When using `--doc-source remote`, documentation is fetched from ziglang.org and cached in platform-specific directories:
  48. - Linux: `~/.cache/zig-mcp/`
  49. - macOS: `~/Library/Caches/zig-mcp/`
  50. - Windows: `%LOCALAPPDATA%\zig-mcp\`
  51. ## Installation
  52. 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.
  53. ### Claude Code
  54. Using npx (Node.js)
  55. ```bash
  56. claude mcp add zig-docs -- npx -y zig-mcp@latest
  57. ```
  58. Using bunx (Bun)
  59. ```bash
  60. claude mcp add zig-docs -- bunx zig-mcp@latest
  61. ```
  62. ### Roo Code
  63. 1. Click the **MCP** button in Roo Code
  64. 2. Select **"Edit Global MCP"** or **"Edit Project MCP"**
  65. 3. Add the configuration from the JSON template below
  66. ### Augment Code
  67. Navigate to **Settings → MCP Servers → Add Server** and use the JSON template below.
  68. ### Claude Desktop
  69. Add the JSON configuration below to your MCP settings file.
  70. ### JSON Configuration Template
  71. **Node.js:**
  72. ```json
  73. {
  74. "mcpServers": {
  75. "zig-docs": {
  76. "command": "npx",
  77. "args": ["-y", "zig-mcp@latest"]
  78. }
  79. }
  80. }
  81. ```
  82. **Bun:**
  83. ```json
  84. {
  85. "mcpServers": {
  86. "zig-docs": {
  87. "command": "bunx",
  88. "args": ["zig-mcp@latest"]
  89. }
  90. }
  91. }
  92. ```
  93. ### Remote Documentation (Optional)
  94. If you prefer downloading documentation from ziglang.org instead of using your local Zig, enable remote mode explicitly and choose a version:
  95. Using npx (Node.js)
  96. ```bash
  97. claude mcp add zig-docs -- npx -y zig-mcp@latest --doc-source remote --version master
  98. ```
  99. Using bunx (Bun)
  100. ```bash
  101. claude mcp add zig-docs -- bunx zig-mcp@latest --doc-source remote --version 0.14.1
  102. ```
  103. **Node.js (remote):**
  104. ```json
  105. {
  106. "mcpServers": {
  107. "zig-docs": {
  108. "command": "npx",
  109. "args": ["-y", "zig-mcp@latest", "--doc-source", "remote", "--version", "master"]
  110. }
  111. }
  112. }
  113. ```
  114. **Bun (remote):**
  115. ```json
  116. {
  117. "mcpServers": {
  118. "zig-docs": {
  119. "command": "bunx",
  120. "args": ["zig-mcp@latest", "--doc-source", "remote", "--version", "0.14.1"]
  121. }
  122. }
  123. }
  124. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.