Components Build MCP
Implements the components.build specification which uses Radix UI primitives library patterns, including support for the asChild/Slot pattern and composable component structures.
Provides tools for grading, generating, and validating UI components against the components.build specification, which shadcn co-authored and serves as the reference implementation.
Implements the components.build specification (copyright Vercel, Inc.) and provides a Vercel-compatible HTTP API for component grading, generation, and validation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Components Build MCP grade this React button component for accessibility compliance"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: Basecoat UI MCP
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-mcpAdd 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 buildAdd 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 the full spec or a specific section |
| Search for terms like "aria", "CVA", "data-slot" |
| List all 16 documentation sections |
Grading & Validation Tools
Tool | Description |
| Grade code and get detailed feedback with score |
| Quick pass/fail check (threshold: 80/100) |
| Get grading rules by category |
| Get details about a specific rule |
| List all rules with severity and weight |
Generation Tools
Tool | Description |
| Generate a compliant component from templates |
| Get reference templates (button, card, input, etc.) |
| 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 |
| Introduction and purpose |
| Terminology (Primitive, Component, Block, etc.) |
| Core principles (Composability, Accessibility, etc.) |
| Root/Trigger/Content pattern |
| Complete a11y guide |
| CSS variables and theming |
| Controlled/uncontrolled state |
| cn(), CVA, tailwind-merge |
| TypeScript patterns |
| The "as" prop |
| Radix Slot pattern |
| data-state/data-slot patterns |
| Documentation standards |
| shadcn CLI distribution |
| Component marketplaces |
| 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 --prodEndpoints:
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
Available Tools
11 toolscheck_complianceC
Quick check if component code is compliant (score >= 80)
Inputs: code (required).
generate_componentC
Generate a new component that follows all rules. Choose a template type or customize.
Inputs: name (required), template (required), element, hasVariants, +2 more.
get_quick_referenceB
Get a quick reference cheat sheet for component development
Inputs: no named parameters.
get_ruleC
Get details about a specific rule by ID
Inputs: ruleId (required).
get_rulesB
Get component rules documentation. Use this to understand what rules exist and how to follow them. Can filter by category.
Inputs: category, format.
get_specificationB
Get the FULL components.build specification documentation. This is the complete guide to building modern UI components by Hayden Bleasel and shadcn. Use this to understand the complete philosophy, patterns, and best practices.
Inputs: section.
get_templateC
Get a component template for reference
Inputs: template (required).
grade_componentB
Grade a component against all rules. Returns a score, grade, violations, and suggestions for fixes.
Inputs: code (required), verbose.
list_rulesB
List all available rules with their IDs, names, and categories
Inputs: no named parameters.
list_specification_sectionsB
List all available sections in the components.build specification
Inputs: no named parameters.
search_specificationB
Search the components.build specification for a specific term or concept. Returns matching sections and context.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have distinct purposes, but there is some overlap between get_rules and list_rules, as both deal with rules documentation, which could cause confusion. However, descriptions clarify that get_rules provides detailed documentation with filtering, while list_rules offers a summary list, helping to mitigate ambiguity.
Tool names follow a consistent verb_noun pattern throughout, such as check_compliance, generate_component, get_quick_reference, and grade_component. This predictability makes it easy for agents to understand and select tools without confusion.
With 11 tools, the server is well-scoped for its purpose of component development and compliance. Each tool serves a specific function, from generating and grading components to accessing documentation, ensuring a comprehensive toolset without being overwhelming.
The tool surface covers key aspects like component generation, compliance checking, grading, and extensive documentation access. A minor gap is the lack of tools for updating or deleting components, but agents can likely work around this given the server's focus on development and compliance rather than full lifecycle management.
Maintenance
Related MCP Connectors
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Find UI components and themes, retrieve code, and generate with hosted 21st AI when enabled.
Mlola UI components, tokens and design rules for coding agents, with a markup checker
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI-powered generation, customization, and documentation of its-just-ui React components. Provides tools for component generation, theme management, form creation, responsive layouts, and accessibility guidance.9219 npm4MIT
- AlicenseAqualityDmaintenanceProvides access to 77 pre-built, accessible Basecoat CSS UI components across forms, navigation, feedback, interactive, and layout categories, enabling AI assistants to retrieve HTML components and usage documentation for building user interfaces.74MIT
- AlicenseAqualityDmaintenanceProvides AI assistants with frontend development tools including component scaffolding, bundle analysis, accessibility checks, and responsive design guidance. Enables automated generation of React components with tests and stories, bundle optimization recommendations, and WCAG compliance fixes.6MIT
- FlicenseAqualityDmaintenanceProvides AI assistants with direct access to shadcn/ui components and blocks, enabling real-time fetching of component source code, documentation, and implementation examples.44-