components-build-mcp

getlokiui/components-build-mcp

3.2

If you are the rightful owner of components-build-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

An MCP server implementing the components.build specification for UI component grading, generation, and validation.

Tools
11
Resources
0
Prompts
0

components-build-mcp

An MCP (Model Context Protocol) server that implements the components.build specification for grading, generating, and validating UI components.

npm version License

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

FeatureFrameworks Supported
SpecificationFramework-agnostic
GradingFramework-agnostic (React, Vue, Svelte, Angular, etc.)
TemplatesReact + 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

ToolDescription
get_specificationGet the full spec or a specific section
search_specificationSearch for terms like "aria", "CVA", "data-slot"
list_specification_sectionsList all 16 documentation sections

Grading & Validation Tools

ToolDescription
grade_componentGrade code and get detailed feedback with score
check_complianceQuick pass/fail check (threshold: 80/100)
get_rulesGet grading rules by category
get_ruleGet details about a specific rule
list_rulesList all rules with severity and weight

Generation Tools

ToolDescription
generate_componentGenerate a compliant component from templates
get_templateGet reference templates (button, card, input, etc.)
get_quick_referenceGet 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:

SectionDescription
overviewIntroduction and purpose
definitionsTerminology (Primitive, Component, Block, etc.)
principlesCore principles (Composability, Accessibility, etc.)
compositionRoot/Trigger/Content pattern
accessibilityComplete a11y guide
designTokensCSS variables and theming
stateControlled/uncontrolled state
stylingcn(), CVA, tailwind-merge
typesTypeScript patterns
polymorphismThe "as" prop
asChildRadix Slot pattern
dataAttributesdata-state/data-slot patterns
docsDocumentation standards
registryshadcn CLI distribution
marketplacesComponent marketplaces
npmNPM 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 rules
  • POST /?action=grade - Grade component code
  • POST /?action=generate - Generate component
  • GET /?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 for details.

Contributing

Contributions are welcome! Please read the components.build specification first to understand the patterns and rules.

Links