Skip to content

API Reference

Christian Presley edited this page Oct 1, 2026 · 5 revisions

API Reference

The API reference of the SDK is on the documentation site: https://christianpresley.github.io/zig-sdk/. The Zig compiler makes the reference from the doc comments of the source code1. The workflow docs.yml deploys the site from the last commit on main.

Applies to: zig-sdk 0.2.0.

Modules

Module Reference Contents
mcp https://christianpresley.github.io/zig-sdk/api/mcp/ The protocol types, the server, the client, the extensions, the stdio, HTTP, Unix socket and WebSocket transports, authorization and TLS.
mcp_grpc https://christianpresley.github.io/zig-sdk/api/mcp_grpc/ The gRPC transport. See Transport gRPC.

The first page of the site also links to the wiki, the Conformance page, the conformance matrix, the repository, the releases and the changelog.

How the site is made

The workflow .github/workflows/docs.yml runs on each push to main. You can also start it manually. It runs zig build site and deploys zig-out/site to GitHub Pages2. The workflow uses only actions that GitHub owns: actions/configure-pages3, actions/upload-pages-artifact4 and actions/deploy-pages5. The site is available when the repository has GitHub Pages enabled with the source GitHub Actions.

zig build site writes these files:

Path Contents
zig-out/site/index.html The first page of the site, from docs/site/index.html.
zig-out/site/api/mcp/ The reference of the module mcp.
zig-out/site/api/mcp_grpc/ The reference of the module mcp_grpc.

The CI job docs runs zig build docs site on each push to main and on each pull request. It keeps the site as the artifact site.

zig build docs writes only the reference of the module mcp to zig-out/docs.

Steps: read the reference offline

  1. Run zig build site.
  2. Serve the directory zig-out/site with a local web server. The reference loads a WebAssembly file, so a file:// URL does not work.
  3. Open the address of the server in a browser.

References

  1. ZIG-0.16-LANGREF: The Zig 0.16.0 language reference, section Doc Comments.
  2. GH-PAGES: GitHub Pages and custom workflows.
  3. GH-ACTION-CONFIGURE-PAGES: The action actions/configure-pages.
  4. GH-ACTION-UPLOAD-PAGES-ARTIFACT: The action actions/upload-pages-artifact.
  5. GH-ACTION-DEPLOY-PAGES: The action actions/deploy-pages.

Clone this wiki locally