@htmlbricks/mcp
v0.76.5
Published
MCP server with HTML Bricks (hb-*) web component catalog resources and tools for agentic IDEs.
Maintainers
Readme
@htmlbricks/mcp
Model Context Protocol server for HTML Bricks (hb-* web components). It exposes the agent catalog reference, list.json, CDN helpers, search, and prompts so coding agents can build correct markup (snake_case attributes, Bootstrap 5, Bootstrap Icons). The same list.json schemas support emitting complete TypeScript for all component props and all custom events (CustomEvent detail per event name).
Usage (agentic IDEs)
Run via stdio (example for MCP clients):
{
"command": "npx",
"args": ["-y", "@htmlbricks/mcp"]
}Requires Node.js 18+. The published package embeds AGENT_WEBCOMPONENTS_REFERENCE.md and list.json for the same version as @htmlbricks/hb-bundle. If assets are missing, the server falls back to jsDelivr for that version.
Instructions for coding agents
Treat this server as the source of truth for the public hb-* catalog. Do not invent tags, attributes, or events.
- Start with resources (server id is usually
htmlbricksin the client config):- Read
htmlbricks://docs/development-guidefor conventions and how to interpretlist.json. - Read
htmlbricks://catalog/agent-referencefor human-oriented docs and examples (large file — usesearch_catalogto narrow). - Read
htmlbricks://catalog/package-listwhen you need exact JSON Schema for props andCustomEventdetail.
- Read
- Use tools before answering specific API questions:
search_catalog— quick lookup by keyword in the reference.get_component_props—definitions.componentonly (props /ComponentJSON Schema).get_component_events—definitions.eventsonly (custom events →detailJSON Schema).get_component_schemas— both schemas in one call (use the split tools when you need a smaller payload). From any of these JSON Schemas you can derive full TS: aComponent-style interface andCustomEvent<Detail>per event.get_component_description— packagedescriptiononly (what the element does).get_component_css—styleSetup.vars(CSS variables) andstyleSetup.parts(::partnames).get_component_slots—htmlSlotsonly (slot names and docs).get_bundle_cdn_urls— correct jsDelivr URLs for this package version.
- Use the prompt
plan_htmlbricks_pagewhen the user wants a multi-section plan or example HTML built fromhb-*components.
Local development of this repo: you can point the MCP client at the workspace server instead of npx (for example run node /absolute/path/to/mcp/cli.js as the command) so agents exercise the same version as the working tree.
Resources
| URI | Content |
|-----|---------|
| htmlbricks://docs/development-guide | Conventions and workflow |
| htmlbricks://catalog/agent-reference | Full merged component reference (Markdown) |
| htmlbricks://catalog/package-list | list.json: per package, JSON Schemas (definitions.*) plus manifest fields: description, styleSetup (vars + parts), htmlSlots. Same TypeScript shapes as npm for props/events; use get_component_* tools for focused slices. |
Tools
- search_catalog — keyword search in the reference
- get_component_props —
definitions.componentonly (props / TypeScriptComponentshape as JSON Schema) - get_component_events —
definitions.eventsonly (each event name →event.detailschema) - get_component_schemas —
definitions.events+definitions.componentfor onehb-*(from bundledlist.json); use to derive all TS props and all custom-eventdetailtypes - get_component_description —
descriptionstring only - get_component_css —
styleSetup.vars+styleSetup.partsonly - get_component_slots —
htmlSlotsarray only - get_bundle_cdn_urls — jsDelivr URLs for
hb-bundlematching this package version
Prompts
- plan_htmlbricks_page — structured task to read resources and plan UI with
hb-*elements
