
zig-wasm/zig-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Zig 프로그래밍 언어 표준 라이브러리와 내장 함수에 대한 최신 문서를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다
개요
Zig 프로그래밍 언어 표준 라이브러리와 내장 함수에 대한 최신 문서를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 모드는 Zig의 공식 자동문서(ziglang.org)와 동일한 방식을 사용하며, WASM 모듈을 통해 STD 라이브러리 소스 파일을 직접 읽습니다. 하지만 HTML을 반환하는 대신 Markdown을 출력하여 토큰 사용을 크게 줄입니다. 기본적으로 서버는 로컬에 설치된 Zig 컴파일러를 사용해 문서를 제공하므로, 실제 Zig 버전과 일치하는 문서를 항상 받을 수 있습니다. 필요하다면 ziglang.org 에서 문서를 가져올 수도 있습니다. LLM에게 Zig 문서 도구를 명시적으로 사용하라고 지시하고 싶다면 프롬프트에 'use zigdocs'를 추가하세요. 그렇지 않으면 LLM이 질문의 맥락에 따라 MCP 도구를 언제 사용할지 자동으로 결정합니다. - - 사용 가능한 모든 Zig 내장 함수를 나열합니다. 내장 함수는 컴파일러에서 제공하며 '@'가 앞에 붙습니다.
개요(AI 번역)
Zig 프로그래밍 언어 표준 라이브러리와 내장 함수에 대한 최신 문서를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다.
이 모드는 Zig의 공식 자동문서(ziglang.org)와 동일한 방식을 사용하며, WASM 모듈을 통해 STD 라이브러리 소스 파일을 직접 읽습니다. 하지만 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 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.
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:
설치
npx -y zig-mcp@latest설정
{
"mcpServers": {
"zig-docs": {
"command": "npx",
"args": ["-y", "zig-mcp@latest"]
}
}
}