Run banira as an MCP server so an AI assistant introspects, verifies and scaffolds your components against real data — not hallucinated APIs.
AI coding assistants are good at reading your files but bad at two things: they hallucinate component APIs (attributes, events, slots that don't exist), and they write generic, framework-shaped code instead of your toolchain's conventions. banira already solves the data side — its manifest is structured, typed metadata, and its compiler and test helper produce real diagnostics. The Model Context Protocol exposes all of that to the agent: typed data to kill hallucination, and a verify loop — compile and actually mount the component — to check the agent's work.
The server runs as a local stdio process — no hosted service, nothing leaves your machine. Point any MCP client at it:
{
"mcpServers": {
"banira": { "command": "npx", "args": ["-y", "banira", "mcp"] }
}
}Or run it directly and explore it with the official MCP Inspector:
$ npx @modelcontextprotocol/inspector npx banira mcpTen tools across four groups. Introspection and guidance are read-only; compile/verify and docs do the work.
| Tool | What it does |
|---|---|
| get_component_manifest | The full Custom Elements Manifest for the given file(s). |
| get_component_api | A compact typed view of one component — attributes, properties, methods, events, slots, parts, custom properties. |
| list_components | Every custom element in a file or directory, with a summary and per-feature counts. |
| get_component_demo | A component's @demo blocks as structured { language, code }. |
| check_component | Type-check in memory (no files written) and return structured diagnostics, so the agent can self-correct. |
| compile_component | Compile to browser-ready ES modules, writing .js/.js.map. (read-only mode omits it) |
| test_component | Mount the component (JSDOM by default) and report whether it registers and upgrades; optional real-browser run. |
| generate_docs | Produce the HTML documentation page as a string. |
| get_authoring_guidelines | banira's conventions — the jsdoc tag contract and per-variant starter components. |
| scaffold_component | Generate a banira-shaped starter component from a spec. (read-only mode omits it) |
Resources — resource://banira/components (a manifest of every component in the workspace) and
resource://banira/authoring-guide (the conventions as Markdown). Prompts —
implement_component_with_attributes, add_event_to_component, and document_and_verify:
the composable scaffold → check → test → docs flow that makes MCP outperform plain retrieval.
| Flag | Effect |
|---|---|
| --read-only | Expose only the read/analysis tools — no writes or scaffolding. Safe to leave always-on. |
| --local-only | Confine file access to the project and never emit network-reaching output (e.g. a CDN doc stylesheet). |
| -p, --project | A tsconfig.json whose options override the compiler defaults for the compile/analysis tools. |
2025-11-25 — so the server adds no heavy dependencies on top of the toolchain you already have.