# Zig Docs MCP server

> Provides up-to-date Zig programming language standard library and builtin function documentation in Markdown format for AI clients.

- Repository: https://github.com/zig-wasm/zig-mcp
- Page: https://hostedmcp.org/servers/zig-wasm/zig-mcp
- Official: yes
- Transport: stdio
- Stars: 175
- License: MIT

## Install

### Claude Code

```sh
claude mcp add zig-mcp -- npx -y @iflow-mcp/zig-wasm-zig-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "zig-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@iflow-mcp/zig-wasm-zig-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "zig-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@iflow-mcp/zig-wasm-zig-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"zig-mcp","type":"stdio","command":"npx","args":["-y","@iflow-mcp/zig-wasm-zig-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "zig-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@iflow-mcp/zig-wasm-zig-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add zig-mcp -- npx -y @iflow-mcp/zig-wasm-zig-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.zig-mcp]
command = "npx"
args = ["-y", "@iflow-mcp/zig-wasm-zig-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user zig-mcp npx -- -y @iflow-mcp/zig-wasm-zig-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "zig-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@iflow-mcp/zig-wasm-zig-mcp"
      ]
    }
  }
}
```

## Tools (4)

- `list_builtin_functions`
- `get_builtin_function`
- `search_std_lib`
- `get_std_lib_item`

## FAQ

### How can I ensure the documentation matches my installed Zig version?

By default, the server uses your locally installed Zig compiler to serve documentation via 'zig std'.

### Can I use documentation from a specific Zig version?

Yes, you can specify a version using the --version flag, such as '0.14.1' or 'master'.

### Does the server support automatic updates?

Yes, you can enable automatic daily updates using the --update-policy daily command.

### How do I get the source code for a standard library item?

You can retrieve the entire source file where an item is implemented by setting get_source_file to true.
