{"id":48823224,"url":"https://github.com/nzrsky/zig-mcp","last_synced_at":"2026-04-14T16:02:36.002Z","repository":{"id":336906031,"uuid":"1151618085","full_name":"nzrsky/zig-mcp","owner":"nzrsky","description":"Zig ZLS MCP for Claude Code 🤖","archived":false,"fork":false,"pushed_at":"2026-03-10T09:46:15.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-10T17:07:34.718Z","etag":null,"topics":["agent","ai","claude","llm","mcp","zig","zls"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nzrsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T17:31:22.000Z","updated_at":"2026-03-10T09:45:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nzrsky/zig-mcp","commit_stats":null,"previous_names":["nzrsky/zig-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nzrsky/zig-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzrsky%2Fzig-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzrsky%2Fzig-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzrsky%2Fzig-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzrsky%2Fzig-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nzrsky","download_url":"https://codeload.github.com/nzrsky/zig-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzrsky%2Fzig-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31803790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","claude","llm","mcp","zig","zls"],"created_at":"2026-04-14T16:02:34.808Z","updated_at":"2026-04-14T16:02:35.993Z","avatar_url":"https://github.com/nzrsky.png","language":"Zig","readme":"# zig-mcp\n\nMCP server for Zig that connects AI coding assistants to [ZLS](https://github.com/zigtools/zls) via the Language Server Protocol.\n\nWorks with [Claude Code](https://docs.anthropic.com/en/docs/claude-code), Cursor, Windsurf, and any MCP-compatible client.\n\n```\nAI assistant  \u003c--(MCP stdio)--\u003e  zig-mcp  \u003c--(LSP pipes)--\u003e  ZLS\n                                    |\n                             zig build / test / check\n```\n\n## Requirements\n\n- [Zig](https://ziglang.org/download/) 0.15.2+\n- [ZLS](https://github.com/zigtools/zls/releases) (auto-detected from PATH, or specify with `--zls-path`)\n\n## Install\n\n### Claude Code plugin (recommended)\n\nInstall directly from the Claude Code interface — no manual build needed:\n\n```bash\n# 1. Add the marketplace\n/plugin marketplace add nzrsky/zig-mcp\n\n# 2. Install the plugin\n/plugin install zig-mcp@zig\n```\n\nOr as a one-liner from the terminal:\n\n```bash\nclaude plugin marketplace add nzrsky/zig-mcp \u0026\u0026 claude plugin install zig-mcp@zig\n```\n\nThe binary is built automatically on first use. Just make sure `zig` and `zls` are in your PATH.\n\n### Manual build\n\n```bash\ngit clone https://github.com/nzrsky/zig-mcp.git\ncd zig-mcp\nzig build -Doptimize=ReleaseFast\n```\n\nBinary is at `zig-out/bin/zig-mcp`.\n\n## Setup (manual install only)\n\nIf you installed via the plugin system, skip this section — everything is configured automatically.\n\n### Claude Code\n\n```bash\n# add globally\nclaude mcp add zig-mcp -- /absolute/path/to/zig-mcp --workspace /path/to/your/zig/project\n\n# add for current project only\nclaude mcp add --scope project zig-mcp -- /absolute/path/to/zig-mcp --workspace /path/to/your/zig/project\n```\n\nOr edit `~/.claude/mcp_servers.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"zig-mcp\": {\n      \"command\": \"/absolute/path/to/zig-mcp\",\n      \"args\": [\"--workspace\", \"/path/to/your/zig/project\"]\n    }\n  }\n}\n```\n\n\u003e If you omit `--workspace`, zig-mcp uses the current working directory.\n\n### Cursor\n\nAdd to `.cursor/mcp.json` in your project:\n\n```json\n{\n  \"mcpServers\": {\n    \"zig-mcp\": {\n      \"command\": \"/absolute/path/to/zig-mcp\",\n      \"args\": [\"--workspace\", \"/path/to/your/zig/project\"]\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"zig-mcp\": {\n      \"command\": \"/absolute/path/to/zig-mcp\",\n      \"args\": [\"--workspace\", \"/path/to/your/zig/project\"]\n    }\n  }\n}\n```\n\n### Options\n\n```\n--workspace, -w \u003cpath\u003e   Project root directory (default: cwd)\n--zls-path \u003cpath\u003e        Path to ZLS binary (default: auto-detect from PATH)\n--help, -h               Show help\n--version                Show version\n```\n\n## Tools\n\n### Code intelligence (via ZLS)\n\n| Tool | What it does |\n|------|-------------|\n| `zig_hover` | Type info and docs for a symbol |\n| `zig_definition` | Go to definition |\n| `zig_references` | Find all references |\n| `zig_completion` | Completion suggestions |\n| `zig_diagnostics` | Errors and warnings for a file |\n| `zig_format` | Format a file |\n| `zig_rename` | Rename a symbol across the workspace |\n| `zig_document_symbols` | List all symbols in a file |\n| `zig_workspace_symbols` | Search symbols across the project |\n| `zig_code_action` | Quick fixes and refactors for a range |\n| `zig_signature_help` | Function signature at cursor |\n\n### Build \u0026 run\n\n| Tool | What it does |\n|------|-------------|\n| `zig_build` | Run `zig build` with optional args |\n| `zig_test` | Run tests (whole project or single file, with optional filter) |\n| `zig_check` | Run `zig ast-check` on a file |\n| `zig_version` | Show Zig and ZLS versions |\n| `zig_manage` | Manage Zig versions via [zvm](https://github.com/marler/zvm) |\n\n## How it works\n\nzig-mcp spawns ZLS as a child process and talks to it over stdin/stdout using the LSP protocol (Content-Length framing). On the other side, it speaks MCP (newline-delimited JSON-RPC) to the AI assistant.\n\nThree threads:\n- **main** -- reads MCP requests, dispatches tool calls, writes responses\n- **reader** -- reads LSP responses from ZLS, correlates by request ID\n- **stderr** -- forwards ZLS stderr to the server log\n\nIf ZLS crashes, zig-mcp automatically restarts it and re-opens all tracked documents.\n\nFiles are opened in ZLS lazily on first access -- no need to manage document state manually.\n\n## Development\n\n```bash\n# build\nzig build\n\n# run tests (~75 unit tests)\nzig build test\n\n# run manually\necho '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"capabilities\":{}}}' | \\\n  zig-out/bin/zig-mcp --workspace . 2\u003e/dev/null\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzrsky%2Fzig-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnzrsky%2Fzig-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzrsky%2Fzig-mcp/lists"}