@roost-design/ui-mcp
v0.1.3
Published
MCP server for @roost-design/ui — component docs, examples, and usage guidance for AI coding agents.
Downloads
20
Readme
@roost-design/ui-mcp
Optional Model Context Protocol (stdio) server for @roost-design/ui.
It indexes component docs, guides, examples, and reusable page patterns so any MCP-capable AI client can look up the real API before writing code. It does not replace installing the UI library:
pnpm add @roost-design/uiPublic docs: run the docs site (pnpm dev) and open Docs → MCP.
Run
npx -y @roost-design/ui-mcpTypical client config (field names vary by client):
{
"command": "npx",
"args": ["-y", "@roost-design/ui-mcp"]
}Local checkout:
pnpm --filter @roost-design/ui-mcp build
node packages/ui-mcp/bin/roost-design-ui-mcp.jsTools
MCP also exposes resources and resource templates for clients that support resources/list, resources/templates/list, and resources/read. Call version to see the current resource and template counts.
Static resources:
wi://catalog/index.jsonwi://design-rules.json
Resource templates:
component-docs→wi://components/{component}/docs/{locale}component-api→wi://components/{component}/api.jsonguide-docs→wi://guides/{guide}/docs/{locale}
Core — component docs
| Tool | Purpose |
| ---------------- | -------------------------------------------- |
| list | List components / guides / examples / categories / patterns |
| search | Search docs, examples, patterns, and decisions |
| get_component | Component metadata and API |
| get_example | One source-backed example |
| get_guide | Guide docs |
| get_setup | Install / setup bundle |
| validate_usage | Soft-check props / events |
| version | Package + catalog status |
Advanced — page composition (optional)
| Tool | Purpose |
| --------------------- | ------------------------------------------------------------- |
| list_patterns | List reusable page composition patterns |
| get_pattern | Read a pattern's structure, layout, and rules |
| recommend_page | Recommend a pattern from page intent; optional starter scaffold |
| get_design_rules | Design-token and composition rules |
| recommend_component | List, read, or recommend component selection guides |
mode: zh (default) or en.
Component lookup accepts common aliases such as DataTable, 数据表格, Pager, and 确认弹窗.
Recommended workflow
Look up a component:
searchorget_componentget_examplefor unfamiliar APIsvalidate_usageon generated snippets
Plan a page:
recommend_pagewith business intent, page type, and featuresget_patternfor the returnedmatchedPatternget_component/get_examplefor core componentsget_design_rulesbefore custom layout or CSSrecommend_componentwhen choosing between similar components
For a starter Vue file, pass includeScaffold: true to recommend_page:
{
"intent": "Oil well management list",
"pageType": "list",
"features": ["filters", "create", "pagination"],
"mode": "en",
"includeScaffold": true
}recommend_component modes:
- omit
queryanddecision→ list decision guides decisiononly → read one guide (e.g.overlay-choice)query→ recommend a component for a UI question
Develop
pnpm install
pnpm mcp:generate
pnpm mcp:buildCatalog sources: src/components/*/docs and playground/src/docs/guide/*.md.
pnpm mcp:generate
pnpm mcp:check-catalog
pnpm mcp:validate-catalog
pnpm mcp:audit-examplesRelease
From the repo root (version syncs from @roost-design/ui):
pnpm release:mcp -- --dry-run
pnpm release:mcp