{"_id":"@aarav-j/zephyr-mcp-server","_rev":"3-f1d6e1f488331ba9d09eec272670181b","name":"@aarav-j/zephyr-mcp-server","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@aarav-j/zephyr-mcp-server","version":"0.1.0","_id":"@aarav-j/zephyr-mcp-server@0.1.0","maintainers":[{"name":"aarav-j","email":"aaravjain2007@gmail.com"}],"bin":{"zephyr-mcp":"dist/index.js"},"dist":{"shasum":"fe9377a3c801de9e777ba1407203b49baa57ef6d","tarball":"https://registry.npmjs.org/@aarav-j/zephyr-mcp-server/-/zephyr-mcp-server-0.1.0.tgz","fileCount":30,"integrity":"sha512-mO0fnD/pw2+uSmrwsxWGRdWSVQWWlradui9qS6+QwZgrO69DPkNP0OjCe1GKUJhM6gAAcomscl/N3+OIJ/UxlA==","signatures":[{"sig":"MEUCIHHWShsPt1VCg6taIFj7lnYwnPww0oTgZxb2JJ7qoG77AiEA6PoLLOfodcoMYWrfwvK4aA86BLu19mI34NurkeMhb4A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109391},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"b07cbf1bad1e12c10c9a042cc407e6158c2f99d2","scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","build":"tsc","start":"node dist/index.js","build-index":"node dist/scripts/build-index.js"},"_npmUser":{"name":"aarav-j","email":"aaravjain2007@gmail.com"},"_npmVersion":"11.6.2","description":"MCP server for Zephyr RTOS documentation - API signatures, Kconfig symbols, and Devicetree bindings","directories":{},"_nodeVersion":"25.2.0","dependencies":{"js-yaml":"^4.1.0","node-fetch":"^3.3.2","better-sqlite3":"^11.7.0","fast-xml-parser":"^5.0.0","@modelcontextprotocol/sdk":"^1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.13.0","@types/js-yaml":"^4.0.9","@types/better-sqlite3":"^7.6.12"},"_npmOperationalInternal":{"tmp":"tmp/zephyr-mcp-server_0.1.0_1782935878897_0.8756528922408093","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aarav-j/zephyr-mcp-server","version":"0.1.1","_id":"@aarav-j/zephyr-mcp-server@0.1.1","maintainers":[{"name":"aarav-j","email":"aaravjain2007@gmail.com"}],"bin":{"zephyr-mcp":"dist/index.js"},"dist":{"shasum":"95bd957f260b265a62c1c75f4f62d7c426303a83","tarball":"https://registry.npmjs.org/@aarav-j/zephyr-mcp-server/-/zephyr-mcp-server-0.1.1.tgz","fileCount":30,"integrity":"sha512-f7De3Wq/0Xpg6LvQOpFEbXp5IHmzcPV/e5UXwslT0qO7xnnzCUcpgk9e/MCWViqrJ/FY9WIr8VM8p0dCOEXN4w==","signatures":[{"sig":"MEQCIDjZU7KJpUdlTE+tIfwEZLZhR85VpG9NllkQFzzt+zlXAiAflsz1bqeXiBlWaOBZeASFB/ga4aKLTxzLuBO2SNxVgA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109464},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"ee291ac2ff25a80f918d340eeaca8779c3e7cbe0","scripts":{"dev":"tsc --watch","lint":"tsc --noEmit","build":"tsc","start":"node dist/index.js","build-index":"node dist/scripts/build-index.js"},"_npmUser":{"name":"aarav-j","email":"aaravjain2007@gmail.com"},"_npmVersion":"11.6.2","description":"MCP server for Zephyr RTOS documentation - API signatures, Kconfig symbols, and Devicetree bindings","directories":{},"_nodeVersion":"25.2.0","dependencies":{"js-yaml":"^4.1.0","node-fetch":"^3.3.2","better-sqlite3":"^11.7.0","fast-xml-parser":"^5.0.0","@modelcontextprotocol/sdk":"^1.8.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.13.0","@types/js-yaml":"^4.0.9","@types/better-sqlite3":"^7.6.12"},"_npmOperationalInternal":{"tmp":"tmp/zephyr-mcp-server_0.1.1_1782936307253_0.4111563960961053","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aarav-j/zephyr-mcp-server","version":"0.2.0","description":"MCP server for Zephyr RTOS documentation - API signatures, Kconfig symbols, and Devicetree bindings","type":"module","main":"dist/index.js","bin":{"zephyr-mcp":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsc --watch","build-index":"node dist/scripts/build-index.js","lint":"tsc --noEmit"},"dependencies":{"@modelcontextprotocol/sdk":"^1.8.0","better-sqlite3":"^11.7.0","fast-xml-parser":"^5.0.0","js-yaml":"^4.1.0","node-fetch":"^3.3.2"},"devDependencies":{"@types/better-sqlite3":"^7.6.12","@types/js-yaml":"^4.0.9","@types/node":"^22.13.0","typescript":"^5.7.0"},"gitHead":"a20facd9b183876336e75d8908f94c8abfe6dab6","types":"./dist/index.d.ts","_id":"@aarav-j/zephyr-mcp-server@0.2.0","_nodeVersion":"25.2.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-GtnfDoLy6dl2yPse4GpDqJgrGpP6eI+Uih5W2JEAQKBL/VcY3+dT4mV3D789wHGaonKkkwRZhrOlPbekwqfgXQ==","shasum":"dd996ae38d3b5847680f35f86302b41426f780d5","tarball":"https://registry.npmjs.org/@aarav-j/zephyr-mcp-server/-/zephyr-mcp-server-0.2.0.tgz","fileCount":34,"unpackedSize":124908,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDqle0lHGj1iAEu4tVi9jDllqqCPp9XlF4xS9E+Y1IVtwIhAOGEAvradK5xN20XPT7LdK+XZ+12fxTXY4BBCmEjyi2s"}]},"_npmUser":{"name":"aarav-j","email":"aaravjain2007@gmail.com"},"directories":{},"maintainers":[{"name":"aarav-j","email":"aaravjain2007@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zephyr-mcp-server_0.2.0_1782936811798_0.26793102801852453"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T19:57:58.799Z","modified":"2026-07-01T20:13:32.063Z","0.1.0":"2026-07-01T19:57:59.032Z","0.1.1":"2026-07-01T20:05:07.394Z","0.2.0":"2026-07-01T20:13:31.951Z"},"description":"MCP server for Zephyr RTOS documentation - API signatures, Kconfig symbols, and Devicetree bindings","maintainers":[{"name":"aarav-j","email":"aaravjain2007@gmail.com"}],"readme":"# Zephyr RTOS MCP Server\n\nAn MCP (Model Context Protocol) server that gives LLMs grounded access to Zephyr RTOS documentation — Kconfig symbols, Devicetree bindings, and API signatures. No more hallucinated driver structs or made-up Kconfig options.\n\n## Quick Start\n\n### Option 1: npx (no install)\n\n```json\n{\n  \"mcpServers\": {\n    \"zephyr\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@aarav-j/zephyr-mcp-server\"]\n    }\n  }\n}\n```\n\nFirst startup auto-downloads the server + pre-built index (8.5 MB). Zero setup.\n\n### Option 2: Clone from GitHub\n\n```bash\ngit clone https://github.com/Aarav-J/zephyr-mcp-server.git\ncd zephyr-mcp-server\nnpm install\nnpm run build\n```\n\nAdd to your MCP client config (e.g. `~/.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"zephyr\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/zephyr-mcp-server/dist/index.js\"]\n    }\n  }\n}\n```\n\n## Tools\n\n### `get_function_signature`\n\nLook up exact C function or macro signatures, parameters, return types, and header locations.\n\n```\nArguments:\n  name      — Function or macro name (e.g. k_sem_take, GPIO_DT_SPEC_GET)\n  version?  — Zephyr version tag. Defaults to latest cached.\n\nReturns:\n  - signature    — Exact C signature with types\n  - brief        — One-line description\n  - params       — Typed parameter list with descriptions\n  - return_type  — Return type\n  - return_desc  — Return value description\n  - header       — Declaring header file\n  - section      — Doxygen group/section\n```\n\n> Requires Doxygen XML output to be indexed (see Building a Full Index).\n\n### `find_kconfig`\n\nSearch Zephyr Kconfig symbols by name or description.\n\n```\nArguments:\n  pattern   — Search string (e.g. GPIO, CONFIG_I2C, USB)\n  limit?    — Max results. Default 10, max 50.\n  version?  — Zephyr version tag.\n\nReturns:\n  - name         — Symbol name (CONFIG_*)\n  - type         — bool, string, int, hex, tristate\n  - prompt       — User-visible prompt text\n  - default      — Default value\n  - depends_on   — Dependency symbol chain\n  - path         — File path in Zephyr tree\n```\n\n### `get_dt_binding`\n\nLook up a Devicetree binding by compatible string.\n\n```\nArguments:\n  compatible — Compatible string (e.g. st,stm32-i2c, arm,cortex-m4)\n  version?   — Zephyr version tag.\n\nReturns:\n  - compatible    — Compatible string\n  - description   — Binding description\n  - properties    — Schema with types, required/optional status, defaults\n  - child_binding — Child binding schema (if any)\n  - bus           — Bus type this binding provides\n  - on_bus        — Bus this binding lives on\n  - path          — YAML file path in Zephyr tree\n```\n\n### `search_docs`\n\nFull-text search across indexed documentation domains.\n\n```\nArguments:\n  query     — Search query (e.g. \"semaphore\", \"i2c stm32\", \"gpio interrupt\")\n  domain?   — Scope: \"api\", \"kconfig\", \"dt\", or omit for all\n  limit?    — Max results. Default 10, max 30.\n  version?  — Zephyr version tag.\n\nReturns:\n  - query    — Original query\n  - count    — Total results found\n  - results  — Ranked list of { domain, title, snippet, path }\n```\n\n## Index\n\n### Pre-built Index (auto-downloaded)\n\nThe server automatically downloads a pre-built index from GitHub Releases on first startup. The current index covers:\n\n| Data | Count |\n|---|---|\n| Kconfig symbols | 24,118 |\n| Devicetree bindings | 3,553 |\n| Index size | 8.5 MB |\n\nThis is enough for the `find_kconfig`, `get_dt_binding`, and `search_docs` tools to work immediately.\n\n### Building a Full Index (with API signatures)\n\nTo also index function signatures, you need Doxygen XML output from Zephyr's documentation build:\n\n```bash\n# Option 1: Build Zephyr docs yourself\n# (requires a full Zephyr build environment)\ncd /path/to/zephyr\nwest build -t doxygen\n# Doxygen XML will be in build/zephyr-doc/xml/\n\n# Option 2: Use the pre-built docs source\nnpx tsx scripts/build-index.ts v4.4.1 \\\n  --source /path/to/zephyr \\\n  --doxygen /path/to/zephyr/build/zephyr-doc/xml/\n```\n\n### Building from Source\n\nIf you want to build the index from a specific Zephyr release:\n\n```bash\n# Download and index Kconfig + DT bindings from Zephyr source\nnpx tsx scripts/build-index.ts v4.4.1 --source /path/to/zephyr\n```\n\nThe CLI accepts a local Zephyr source directory. On first run against a new version, it will download the Zephyr source tarball automatically.\n\n## Version Management\n\nThe server checks for new Zephyr releases on startup and logs a message when one is available:\n\n```\n[update] New Zephyr release: v4.5.0 (cached: v4.4.1)\n[update] Run: cd zephyr-mcp-server && npm run build-index v4.5.0\n```\n\n## Architecture\n\n```\nzephyr-mcp-server/\n├── src/\n│   ├── index.ts                 # MCP server + tool handlers\n│   ├── db.ts                    # SQLite FTS5 database layer\n│   └── parsers/\n│       ├── doxygen.ts           # Doxygen XML → FunctionRow[]\n│       ├── kconfig.ts           # Kconfig → KconfigRow[]\n│       └── dt-bindings.ts       # YAML bindings → DtBindingRow[]\n├── scripts/\n│   └── build-index.ts           # Index builder CLI\n├── dist/                        # Compiled output\n└── test/\n    └── fixtures/                # Test fixtures\n```\n\n## Development\n\n```bash\nnpm run build      # Compile TypeScript\nnpm run start      # Start MCP server on stdio\nnpm run build-index <version> --source <path>   # Build index\n```\n\n## Contributing\n\nPRs welcome. Key areas for improvement:\n\n- **Doxygen XML fetching** — Automate downloading or building Doxygen XML for pre-built index releases\n- **Kconfig parser quality** — Current parser is regex-based; switching to kconfiglib (Python) would improve accuracy\n- **RST docs chunking** — Parse Zephyr's RST documentation for richer prose search results\n- **CI pipeline** — GitHub Action to auto-build indexes on new Zephyr releases\n\n## License\n\nMIT\n","readmeFilename":"README.md"}