Semantic Zig tools for Codex, backed by zls and the Zig compiler.
This plugin exposes a local MCP server that gives Codex token-efficient Zig code intelligence without relying on text search alone. It starts zls per project root for semantic LSP queries and shells out to zig for builds, tests, formatting checks, AST checks, and environment probes.
zlshover, definitions, references, document symbols, workspace symbols, diagnostics, and code actions.zig build.zig test <file>.zig ast-check.- Non-mutating
zig fmt --check. - Lightweight
--selftestfixture for smoke testing the MCP server.
- Python 3.11 or newer.
zigonPATH.zlsonPATH.
Place this directory at:
%USERPROFILE%\.codex\plugins\zig-native
The plugin metadata is in .codex-plugin/plugin.json, and the MCP server command is in .mcp.json.
Run from the plugin root:
python scripts\zig_native_mcp.py --selftestExpected result: JSON output with "ok": true.
- LSP positions use 1-based
lineand 1-basedcharacterinputs. - Call
zig_lsp_diagnosticsbeforezig_lsp_code_actionswhen asking for quick fixes on a problematic range. zig_fmt_checkchecks formatting without rewriting files.
MIT.