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 "Install 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 MCPgrade 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.
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
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.