npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aarav-j/zephyr-mcp-server

v0.2.0

Published

MCP server for Zephyr RTOS documentation - API signatures, Kconfig symbols, and Devicetree bindings

Readme

Zephyr RTOS MCP Server

An 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.

Quick Start

Option 1: npx (no install)

{
  "mcpServers": {
    "zephyr": {
      "command": "npx",
      "args": ["-y", "@aarav-j/zephyr-mcp-server"]
    }
  }
}

First startup auto-downloads the server + pre-built index (8.5 MB). Zero setup.

Option 2: Clone from GitHub

git clone https://github.com/Aarav-J/zephyr-mcp-server.git
cd zephyr-mcp-server
npm install
npm run build

Add to your MCP client config (e.g. ~/.cursor/mcp.json):

{
  "mcpServers": {
    "zephyr": {
      "command": "node",
      "args": ["/path/to/zephyr-mcp-server/dist/index.js"]
    }
  }
}

Tools

get_function_signature

Look up exact C function or macro signatures, parameters, return types, and header locations.

Arguments:
  name      — Function or macro name (e.g. k_sem_take, GPIO_DT_SPEC_GET)
  version?  — Zephyr version tag. Defaults to latest cached.

Returns:
  - signature    — Exact C signature with types
  - brief        — One-line description
  - params       — Typed parameter list with descriptions
  - return_type  — Return type
  - return_desc  — Return value description
  - header       — Declaring header file
  - section      — Doxygen group/section

Requires Doxygen XML output to be indexed (see Building a Full Index).

find_kconfig

Search Zephyr Kconfig symbols by name or description.

Arguments:
  pattern   — Search string (e.g. GPIO, CONFIG_I2C, USB)
  limit?    — Max results. Default 10, max 50.
  version?  — Zephyr version tag.

Returns:
  - name         — Symbol name (CONFIG_*)
  - type         — bool, string, int, hex, tristate
  - prompt       — User-visible prompt text
  - default      — Default value
  - depends_on   — Dependency symbol chain
  - path         — File path in Zephyr tree

get_dt_binding

Look up a Devicetree binding by compatible string.

Arguments:
  compatible — Compatible string (e.g. st,stm32-i2c, arm,cortex-m4)
  version?   — Zephyr version tag.

Returns:
  - compatible    — Compatible string
  - description   — Binding description
  - properties    — Schema with types, required/optional status, defaults
  - child_binding — Child binding schema (if any)
  - bus           — Bus type this binding provides
  - on_bus        — Bus this binding lives on
  - path          — YAML file path in Zephyr tree

search_docs

Full-text search across indexed documentation domains.

Arguments:
  query     — Search query (e.g. "semaphore", "i2c stm32", "gpio interrupt")
  domain?   — Scope: "api", "kconfig", "dt", or omit for all
  limit?    — Max results. Default 10, max 30.
  version?  — Zephyr version tag.

Returns:
  - query    — Original query
  - count    — Total results found
  - results  — Ranked list of { domain, title, snippet, path }

Index

Pre-built Index (auto-downloaded)

The server automatically downloads a pre-built index from GitHub Releases on first startup. The current index covers:

| Data | Count | |---|---| | Kconfig symbols | 24,118 | | Devicetree bindings | 3,553 | | Index size | 8.5 MB |

This is enough for the find_kconfig, get_dt_binding, and search_docs tools to work immediately.

Building a Full Index (with API signatures)

To also index function signatures, you need Doxygen XML output from Zephyr's documentation build:

# Option 1: Build Zephyr docs yourself
# (requires a full Zephyr build environment)
cd /path/to/zephyr
west build -t doxygen
# Doxygen XML will be in build/zephyr-doc/xml/

# Option 2: Use the pre-built docs source
npx tsx scripts/build-index.ts v4.4.1 \
  --source /path/to/zephyr \
  --doxygen /path/to/zephyr/build/zephyr-doc/xml/

Building from Source

If you want to build the index from a specific Zephyr release:

# Download and index Kconfig + DT bindings from Zephyr source
npx tsx scripts/build-index.ts v4.4.1 --source /path/to/zephyr

The CLI accepts a local Zephyr source directory. On first run against a new version, it will download the Zephyr source tarball automatically.

Version Management

The server checks for new Zephyr releases on startup and logs a message when one is available:

[update] New Zephyr release: v4.5.0 (cached: v4.4.1)
[update] Run: cd zephyr-mcp-server && npm run build-index v4.5.0

Architecture

zephyr-mcp-server/
├── src/
│   ├── index.ts                 # MCP server + tool handlers
│   ├── db.ts                    # SQLite FTS5 database layer
│   └── parsers/
│       ├── doxygen.ts           # Doxygen XML → FunctionRow[]
│       ├── kconfig.ts           # Kconfig → KconfigRow[]
│       └── dt-bindings.ts       # YAML bindings → DtBindingRow[]
├── scripts/
│   └── build-index.ts           # Index builder CLI
├── dist/                        # Compiled output
└── test/
    └── fixtures/                # Test fixtures

Development

npm run build      # Compile TypeScript
npm run start      # Start MCP server on stdio
npm run build-index <version> --source <path>   # Build index

Contributing

PRs welcome. Key areas for improvement:

  • Doxygen XML fetching — Automate downloading or building Doxygen XML for pre-built index releases
  • Kconfig parser quality — Current parser is regex-based; switching to kconfiglib (Python) would improve accuracy
  • RST docs chunking — Parse Zephyr's RST documentation for richer prose search results
  • CI pipeline — GitHub Action to auto-build indexes on new Zephyr releases

License

MIT