Zig Docs MCP
Provides up-to-date Zig standard library and builtin function documentation via MCP tools, using local Zig installation or remote ziglang.org sources.
README
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 zigdocsto 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.
<p align="center" width="100%"> <img src="https://raw.githubusercontent.com/zig-wasm/.github/refs/heads/main/static/readme_mcp_1.gif" width="49%" /> <img src="https://raw.githubusercontent.com/zig-wasm/.github/refs/heads/main/static/readme_mcp_2.gif" width="49%" /> </p>
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. Setget_source_file: trueto 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 branch0.14.1,0.14.0, etc. - Specific Zig release versions
Update policies --update-policy:
manual(default) - No automatic updates, manual control onlydaily- Check for documentation updates once per daystartup- 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
- Click the MCP button in Roo Code
- Select "Edit Global MCP" or "Edit Project MCP"
- 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"]
}
}
}
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。