Why Codex?
AI agents working with Vielzeug need reliable, structured access to package metadata and documentation. A custom fetch integration or web scraper breaks with every docs update and returns inconsistent data shapes.
ts
// Before — fetch and parse docs manually in each agent
const res = await fetch('https://vielzeug.dev/spell/api');
const html = await res.text();
// parse, clean, truncate — fragile, network-dependent, inconsistent
// After — structured MCP tool call, always in sync with the published snapshot
{ "name": "get-docs", "arguments": { "packageSlug": "spell", "page": "api" } }| Feature | @vielzeug/codex | Custom fetch | Generic web search |
|---|---|---|---|
| Bundle size | 0 KB | — | — |
| Zero external deps | |||
| Structured metadata | |||
| Sigil component CEM | |||
| Offline / snapshot-backed | |||
| Stdio + HTTP transports |
Use @vielzeug/codex when you are building or configuring an AI agent that needs reliable, offline access to Vielzeug documentation and component metadata.
Consider a web search when you need content from the live docs site that post-dates the current published snapshot.
Installation
sh
pnpm add @vielzeug/codexsh
npm install @vielzeug/codexsh
yarn add @vielzeug/codexQuick Start
sh
# Run over stdio (Claude Desktop, Copilot Chat)
npx -y @vielzeug/codex
# Run over HTTP (remote agents)
npx -y @vielzeug/codex --port 3100
# CLI helpers
npx -y @vielzeug/codex --help
npx -y @vielzeug/codex --versionThen wire it into your AI client — see the Usage Guide.
What it exposes
Tools
| Tool | Input | Description |
|---|---|---|
list-packages | — | All packages with metadata (no filter) |
get-package | packageSlug | Single package metadata by slug |
get-docs | packageSlug, page? | Package docs page (index, api, usage, examples); defaults to index |
get-source | packageSlug | Bundled src/index.ts text for a package |
search-packages | query | Search package metadata and docs with weighted ranked matches |
list-components | — | Sigil component tags from bundled CEM metadata |
get-component | tagName | Full Sigil component CEM declaration by tag |
Resources
| URI pattern | MIME type | Content |
|---|---|---|
vielzeug://docs/<slug>/<page> | text/markdown | Documentation page |
vielzeug://source/<slug> | text/x-typescript | src/index.ts source |
Transports
- Stdio (default) for local MCP clients
- Streamable HTTP with
--port <number>for remote agents
Features
list-packagesreturns all packages; useget-packagewithpackageSlugto fetch a single entrysearch-packagesreturns weighted ranked hits — name matches (3.9) outrank description (3.1) outrank keywords (2.5) outrank exports (2.2) outrank related (2.0) outrank docs (1.0) outrank source (0.9)matchedInreports distinct categories:"metadata","keywords","exports","related","docs","source"- MCP Resources exposed at
vielzeug://docs/<slug>/<page>andvielzeug://source/<slug> - Programmatic API:
createServer,createServerFromDisk,loadData,packageMeta,validateBundledDataexported from@vielzeug/codex search-packagessupports multi-word AND queries — all words must match- Unknown CLI flags print a usage hint and exit cleanly (no stack trace)
- Port-in-use (
EADDRINUSE) prints a clean error and exits with code 1 - Bundled snapshot data — runs without a local Vielzeug checkout
- Fail-fast startup: missing or malformed data aborts immediately with an actionable error message
- Health endpoint at
/healthin HTTP mode