Components Build MCP
Provides AI assistants with tools to grade, generate, and validate UI components against the components.build specification. Supports searching documentation, checking compliance, and generating framework-agnostic accessible components.
README
components-build-mcp
An MCP (Model Context Protocol) server that implements the components.build specification for grading, generating, and validating UI components.
About
This MCP server provides AI assistants with tools to:
- Access the complete components.build specification - The full documentation embedded and searchable
- Grade components - Validate any component against the spec's rules
- Generate compliant components - Create new components that follow all best practices
- Search documentation - Find specific patterns, rules, or concepts
The components.build specification is an open-source standard for building modern, composable, and accessible UI components, co-authored by Hayden Bleasel and shadcn.
Framework Support
| Feature | Frameworks Supported |
|---|---|
| Specification | Framework-agnostic |
| Grading | Framework-agnostic (React, Vue, Svelte, Angular, etc.) |
| Templates | React + TypeScript |
The grading rules check for universal patterns (accessibility, composition, data attributes) that apply to any framework.
Installation
For Claude Code / Claude Desktop
npm install -g components-build-mcp
Add to your Claude configuration (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"components-build": {
"command": "components-build-mcp"
}
}
}
For Local Development
git clone https://github.com/getlokiui/components-build-mcp.git
cd components-build-mcp
npm install
npm run build
Add to Claude config with full path:
{
"mcpServers": {
"components-build": {
"command": "node",
"args": ["/path/to/components-build-mcp/dist/index.js"]
}
}
}
Available Tools
Documentation Tools
| Tool | Description |
|---|---|
get_specification |
Get the full spec or a specific section |
search_specification |
Search for terms like "aria", "CVA", "data-slot" |
list_specification_sections |
List all 16 documentation sections |
Grading & Validation Tools
| Tool | Description |
|---|---|
grade_component |
Grade code and get detailed feedback with score |
check_compliance |
Quick pass/fail check (threshold: 80/100) |
get_rules |
Get grading rules by category |
get_rule |
Get details about a specific rule |
list_rules |
List all rules with severity and weight |
Generation Tools
| Tool | Description |
|---|---|
generate_component |
Generate a compliant component from templates |
get_template |
Get reference templates (button, card, input, etc.) |
get_quick_reference |
Get the cheat sheet |
Usage Examples
Once configured, ask your AI assistant:
"Show me the components.build spec section on accessibility"
"Grade this component against the spec:
export const Button = ({ children }) => <button>{children}</button>"
"Generate a Card component with composable sub-components"
"Search the spec for keyboard navigation patterns"
"What rules does the grader check for?"
Specification Sections
The complete components.build specification includes:
| Section | Description |
|---|---|
overview |
Introduction and purpose |
definitions |
Terminology (Primitive, Component, Block, etc.) |
principles |
Core principles (Composability, Accessibility, etc.) |
composition |
Root/Trigger/Content pattern |
accessibility |
Complete a11y guide |
designTokens |
CSS variables and theming |
state |
Controlled/uncontrolled state |
styling |
cn(), CVA, tailwind-merge |
types |
TypeScript patterns |
polymorphism |
The "as" prop |
asChild |
Radix Slot pattern |
dataAttributes |
data-state/data-slot patterns |
docs |
Documentation standards |
registry |
shadcn CLI distribution |
marketplaces |
Component marketplaces |
npm |
NPM distribution |
Grading Rules
Components are graded on:
- Types - Extending HTML props, exporting types, spreading props correctly
- Styling - Using cn() utility, class order, design tokens
- Accessibility - ARIA attributes, keyboard navigation, semantic HTML
- Composition - Single element wrapping, composable patterns
- State - Supporting controlled and uncontrolled usage
- Naming - Following conventions (Root, Trigger, Content, etc.)
HTTP API
A Vercel-compatible HTTP API is also available for non-MCP usage:
# Deploy to Vercel
cd components-build-mcp
vercel --prod
Endpoints:
GET /?action=rules- Get all rulesPOST /?action=grade- Grade component codePOST /?action=generate- Generate componentGET /?action=quick-reference- Get cheat sheet
Credits
This project implements the components.build specification.
The specification is:
- Copyright 2023 Vercel, Inc.
- Co-authored by Hayden Bleasel and shadcn
- Licensed under Apache License 2.0
This MCP server is a community project by Audrey Klammer and is not officially affiliated with or endorsed by Vercel, Inc.
License
Apache License 2.0 - See LICENSE for details.
Contributing
Contributions are welcome! Please read the components.build specification first to understand the patterns and rules.
Links
- components.build - The specification
- shadcn/ui - Reference implementation
- Radix UI - Primitives library
- getlokiui - Component library built on this spec
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。