ZW

zig-wasm/zig-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

174 stars 8 forks 品質 69 トレンド 0MIT

Zigプログラミング言語標準ライブラリおよび組み込み関数の最新ドキュメントを提供するモデルコンテキストプロトコル(MCP)サーバー

概要

Zigプログラミング言語の標準ライブラリおよび組み込み関数の最新のドキュメントを提供するモデルコンテキストプロトコル(MCP)サーバーです。 Zigの公式オートドキュメント(ziglang.org)と同じ方法で、WASMモジュールを通じてSTD libのソースファイルを直接読み込みます。しかしHTMLを返す代わりにMarkdownを出力し、トークン使用を大幅に減らします。 デフォルトでは、サーバーはローカルにインストールされたZigコンパイラを使ってドキュメントを配信し、実際のZigバージョンに一致するドキュメントが常に届くようにしています。必要に応じて ziglang.org からドキュメントを取得することも可能です。 LLMにZigドキュメントツールの使用を明示的に指示したい場合は、プロンプトに「use zigdocs」を追加してください。そうでなければ、LLMは質問の文脈に基づいてMCPツールの利用タイミングを自動的に決定します。 - - 利用可能なすべてのZig組み込み関数を一覧表示します。組み込み関数はコンパイラによって提供され、接頭辞は「@」で始まります。

概要(AI 翻訳)

Zigプログラミング言語の標準ライブラリおよび組み込み関数の最新のドキュメントを提供するモデルコンテキストプロトコル(MCP)サーバーです。

Zigの公式オートドキュメント(ziglang.org)と同じ方法で、WASMモジュールを通じてSTD libのソースファイルを直接読み込みます。しかしHTMLを返す代わりにMarkdownを出力し、トークン使用を大幅に減らします。

デフォルトでは、サーバーはローカルにインストールされたZigコンパイラを使ってドキュメントを配信し、実際のZigバージョンに一致するドキュメントが常に届くようにしています。必要に応じて ziglang.org からドキュメントを取得することも可能です。

[!ヒント] もしLLMにZigドキュメントツールの使用を明示的に指示したい場合は、プロンプトにuse zigdocsを追加してください。そうでなければ、LLMは質問の文脈に基づいて自動的にMCPツールの利用タイミングを決定します。

道具

  • list_builtin_functions - 利用可能なすべてのZig組み込み関数を一覧にします。組み込み関数はコンパイラによって提供され、接頭辞は「@」で始まります。パラメータのcomptimeキーワードは、そのパラメータがコンパイル時に既知でなければならないことを意味します。これを使って利用可能な関数を見つけ、詳細なドキュメントを「get_builtin_function」で確認できます。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 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 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:

GitHub で README 全文を見る

インストール

npx -y zig-mcp@latest
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

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