MCP Design System
Global CSS variables, color tokens, and design system fundamentals exposed through the Vayu UI MCP server.
MCP Design System
The Vayu UI MCP (Model Context Protocol) server exposes the complete design system and component registry to AI assistants and automated tools. This documentation covers how to access design tokens, components, hooks, and patterns through the MCP interface.
Overview
The Vayu UI MCP server provides programmatic access to:
- Component Registry - All components and hooks with metadata
- Design Tokens - CSS variables and their usage
- Component Examples - Ready-to-use code snippets
- Accessibility Data - ARIA roles, keyboard navigation, focus management
- Pattern Documentation - Composition, anti-patterns, and best practices
All design system data is available through MCP tools, enabling AI assistants to understand and use Vayu UI components correctly.
Getting Started
Installing the MCP Server
Add the Vayu UI MCP server to your Claude Desktop or MCP-compatible client:
{
"mcpServers": {
"vayu-ui": {
"command": "node",
"args": ["/path/to/vayu-ui/packages/mcp/dist/index.js"]
}
}
}Available MCP Tools
| Tool | Description |
|---|---|
list_components | List all available components and hooks |
find_component | Search for components by use-case description |
get_component_props | Get all props with types and descriptions |
get_component_variants | Get available visual variants |
get_component_states | Get interactive and visual states |
get_component_events | Get event handlers with TypeScript signatures |
get_component_example | Get ready-to-paste TSX examples |
get_component_a11y | Get ARIA roles and accessibility info |
get_component_doNot | Get anti-pattern rules and common mistakes |
get_component_dependencies | Get NPM and registry dependencies |
get_component_peer_components | Get frequently used components |
get_component_composition | Get compound component patterns |
scaffold_component_usage | Generate copy-paste ready snippets |
get_design_tokens | Get CSS design tokens |
get_component_full | Get complete component definition |
Color System
Accessing Colors via MCP
The color system is organized into semantic color groups. Use get_design_tokens to access color tokens for any component.
{
"name": "list_components",
"arguments": {
"category": "action",
"type": "component"
}
}[
{
"name": "Button",
"slug": "button",
"category": "action",
"type": "component",
"description": "A button component with variants"
}
]| Group | Description | MCP Access |
|---|---|---|
| Primary | Lime - Brand identity, CTAs | Component tokens |
| Ground | Zinc - Neutral foundation | Component tokens |
| Warning | Yellow - Caution signals | Component tokens |
| Success | Green - Confirmations | Component tokens |
| Error | Red - Destructive actions | Component tokens |
| Info | Blue - Informational | Component tokens |
Primary - Lime
Brand identity color for CTAs, active states, key highlights.
// Request design tokens for a component
{
"name": "get_design_tokens",
"arguments": {
"name": "Button",
"overridableOnly": false
}
}Available Shades: 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
Usage Rules:
- 100-300 → backgrounds & decorative surfaces
- 400-600 → interactive elements & primary actions
- 700-950 → text on light bg / inverted surfaces in dark mode
Ground - Zinc
Neutral foundation for backgrounds, surfaces, borders, text.
Available Shades: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950
Usage Rules:
- 50-300 → surfaces, cards, borders (light mode)
- 400-600 → text, icons, labels
- 700-950 → headings in light / become surfaces in dark
Semantic Colors
| Color | Shades | Use Case | MCP Token Access |
|---|---|---|---|
| Warning | 100-950 | Caution, alerts, pending states | get_design_tokens |
| Success | 100-950 | Confirmations, completed states | get_design_tokens |
| Error | 100-950 | Validation failures, critical alerts | get_design_tokens |
| Info | 100-950 | Informational content, help text | get_design_tokens |
Typography
Font Families
Access typography information through component metadata:
{
"name": "get_component_full",
"arguments": {
"name": "Typography"
}
}| Family | Font | Usage | Token |
|---|---|---|---|
| Primary | Oswald | Headings, labels, nav, badges | --font-primary |
| Secondary | Mulish | Body copy, descriptions, captions | --font-secondary |
| Tertiary | Geist Mono | Code blocks, kbd, technical values | --font-tertiary |
Type Scale
| Scale | Size | Usage | Token |
|---|---|---|---|
| H1 | 36px | Page-level hero titles | --text-h1 |
| H2 | 30px | Section headings | --text-h2 |
| H3 | 24px | Card / panel headings | --text-h3 |
| H4 | 20px | Subsection, dialog titles | --text-h4 |
| H5 | 18px | Sidebar labels, group headers | --text-h5 |
| H6 | 16px | Small labels, table headers | --text-h6 |
| Para | 14px | All body text, captions, hints | --text-para |
Spacing & Shape
Border Radius
Consistent 12px border radius across all components.
// Get design tokens
{
"name": "get_design_tokens",
"arguments": {
"name": "Card",
"overridableOnly": true
}
}Token: --radius: 12px
Shadows
Available shadow tokens for depth and hierarchy:
| Token | Use Case | Overridable |
|---|---|---|
--shadow-outer | Cards, modals, dropdowns, popovers | Yes |
--inset-shadow-inner | Pressed buttons, inputs (focused/active) | Yes |
--shadow-outer: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
--inset-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1);Transitions
Smooth transition timing functions for consistent animations:
| Transition | Duration | Easing | Use Case | Token |
|---|---|---|---|---|
| Fast | 150ms | ease-in-out | Hover states, tooltips, icon swaps | --transition-fast |
| Medium | 300ms | ease-in-out | Modals, dropdowns, sidebar expand/collapse | --transition-medium |
| Slow | 500ms | ease-in-out | Page transitions, onboarding overlays, banners | --transition-slow |
{
"name": "get_design_tokens",
"arguments": {
"name": "Button",
"overridableOnly": false
}
}Component Discovery
List All Components
Discover all available components and hooks:
{
"name": "list_components",
"arguments": {}
}Filters:
category: "action" | "input" | "layout" | "overlay" | "display" | "navigation" | "feedback" | "utility"type: "component" | "hook"
Find Components by Use Case
Search for components based on what you need:
{
"name": "find_component",
"arguments": {
"query": "countdown timer"
}
}Searches across:
- Component names
- Descriptions
- Categories
- Tags
- Variants
Component Props
Get Props with Types
Retrieve all props with TypeScript types and descriptions:
{
"name": "get_component_props",
"arguments": {
"name": "Button",
"includeDeprecated": false
}
}Response Structure:
{
"variant": {
"type": "\"solid\" | \"outline\" | \"ghost\"",
"required": false,
"default": "\"solid\"",
"description": "Visual style variant of the button"
},
"size": {
"type": "\"small\" | \"medium\" | \"large\"",
"required": false,
"default": "\"medium\"",
"description": "Size of the button"
}
}Component Examples
Get Ready-to-Use Examples
Retrieve copy-paste ready TSX code:
{
"name": "get_component_example",
"arguments": {
"name": "Button",
"variant": "loading"
}
}Available Examples: Varies by component
Response:
{
"code": "<Button variant=\"solid\" loading>Loading...</Button>",
"description": "Button with loading state"
}List Available Examples
Get all available example keys for a component:
{
"name": "get_component_example",
"arguments": {
"name": "Button"
}
}Accessibility
Get A11y Information
Retrieve accessibility data for components:
{
"name": "get_component_a11y",
"arguments": {
"name": "Button"
}
}Response Structure:
{
"role": "button",
"requiredAttrs": {
"aria-label": "Descriptive label when text content is not available"
},
"managedAttrs": ["aria-pressed", "aria-expanded"],
"keyboard": {
"Enter": "Activates the button",
"Space": "Activates the button"
},
"focusManagement": "Button receives focus when clicked"
}Anti-Patterns
Get common mistakes and anti-patterns:
{
"name": "get_component_doNot",
"arguments": {
"name": "Button",
"category": "a11y"
}
}Categories:
api- API usage mistakesa11y- Accessibility violationsstyling- Styling anti-patternsnesting- Incorrect nesting patternsperf- Performance issuesux- UX anti-patterns
Component States
Get Interactive States
Retrieve all visual and interactive states:
{
"name": "get_component_states",
"arguments": {
"name": "Button"
}
}Available States:
default- Normal statehover- Mouse hoverfocus- Keyboard focusactive- Mouse pressdisabled- Disabled stateloading- Loading stateerror- Error stateempty- Empty statechecked- Checked state (checkbox/radio)indeterminate- Indeterminate state
Response Structure:
{
"hover": {
"trigger": "Mouse hover",
"visualChange": "Background color darkens, elevation increases",
"ariaAttr": "None"
}
}Component Dependencies
Get Dependencies
Retrieve NPM and registry dependencies:
{
"name": "get_component_dependencies",
"arguments": {
"name": "Button"
}
}Response:
{
"npmDependencies": ["react", "clsx", "tailwind-merge"],
"registryDependencies": ["Label"],
"installCommand": "npx vayu-ui add button",
"targetPath": "src/components/ui/button.tsx"
}Get Peer Components
Find components frequently used together:
{
"name": "get_component_peer_components",
"arguments": {
"name": "Button"
}
}Composition Patterns
Get Compound Component Info
Retrieve composition data for compound components:
{
"name": "get_component_composition",
"arguments": {
"name": "Dialog"
}
}Response:
{
"parts": {
"Dialog.Trigger": "Button that opens the dialog",
"Dialog.Content": "Main dialog container",
"Dialog.Header": "Dialog header section",
"Dialog.Body": "Dialog body content",
"Dialog.Footer": "Dialog footer actions"
},
"example": "<Dialog>\n <Dialog.Trigger>Open</Dialog.Trigger>\n <Dialog.Content>\n <Dialog.Header>Title</Dialog.Header>\n <Dialog.Body>Content</Dialog.Body>\n </Dialog.Content>\n</Dialog>",
"partsRequired": false
}Component Variants
Get Available Variants
Retrieve visual variant options:
{
"name": "get_component_variants",
"arguments": {
"name": "Button"
}
}Response:
["solid", "outline", "ghost", "link"]Component Events
Get Event Handlers
Retrieve all event handlers with TypeScript signatures:
{
"name": "get_component_events",
"arguments": {
"name": "Button"
}
}Response Structure:
{
"onClick": {
"signature": "(event: MouseEvent<HTMLButtonElement>) => void",
"description": "Fired when the button is clicked",
"controlledBy": null
}
}Scaffold Component Usage
Generate Ready-to-Use Snippets
Generate copy-paste ready code with imports and state:
{
"name": "scaffold_component_usage",
"arguments": {
"name": "Dialog",
"variant": "default",
"withState": true
}
}Response:
{
"scaffold": "import { Dialog } from \"@/components/ui/dialog\";\n\nconst [open, setOpen] = React.useState(false);\n\n<Dialog open={open} onOpenChange={setOpen}>",
"installCommand": "npx vayu-ui add dialog"
}Dark Mode
Dark Mode Information
Access dark mode behavior through component metadata:
{
"name": "get_component_full",
"arguments": {
"name": "Button"
}
}Dark Mode Response:
{
"darkMode": {
"automatic": true,
"tokenSwaps": {
"--color-primary-500": "--color-primary-500"
}
}
}Dark Mode Inversion Pattern
| Light Mode | Dark Mode |
|---|---|
Background → ground-50/100 | ground-950/900 |
Surface → ground-100/200 | ground-900/800 |
Border → ground-200/300 | ground-700/800 |
Text body → ground-600/700 | ground-300/400 |
Text strong → ground-800/900 | ground-100/200 |
Text muted → ground-400/500 | ground-500/600 |
Design Tokens Reference
Token Categories
Design tokens are categorized by their scope and usage:
| Category | Description | MCP Access |
|---|---|---|
| Colors | Semantic color tokens | get_design_tokens |
| Spacing | Margin, padding, gap values | get_design_tokens |
| Typography | Font sizes, line heights, weights | get_design_tokens |
| Borders | Border radius, border width | get_design_tokens |
| Shadows | Elevation and depth | get_design_tokens |
| Transitions | Duration and easing functions | get_design_tokens |
Overridable Tokens
Filter to get only overridable tokens:
{
"name": "get_design_tokens",
"arguments": {
"name": "Button",
"overridableOnly": true
}
}Overridable tokens are safe to override in consumer CSS without breaking component behavior.
Component Categories
All components are organized into categories:
| Category | Description | Examples |
|---|---|---|
| Action | Interactive buttons and triggers | Button, Link, IconButton |
| Input | Form controls and data entry | TextInput, Select, Checkbox |
| Layout | Structural components | Card, Container, Grid |
| Overlay | Modal and overlay components | Dialog, Popover, Dropdown |
| Display | Content presentation | Avatar, Badge, Separator |
| Navigation | Navigation components | Navbar, Sidebar, Tabs |
| Feedback | Status and feedback components | Alert, Toast, Spinner |
| Utility | Helper components | Separator, AspectRatio |
AI Assistant Usage
Recommended Workflow for AI Assistants
When using the Vayu UI MCP server as an AI assistant:
- Discovery: Use
list_componentsorfind_componentto find the right component - Learn: Use
get_component_propsandget_component_a11yto understand the API - Examples: Use
get_component_exampleto see usage patterns - Scaffold: Use
scaffold_component_usageto generate code - Validate: Use
get_component_doNotto avoid anti-patterns
Example AI Assistant Flow
// 1. Find the component
{
"name": "find_component",
"arguments": {
"query": "modal dialog with overlay"
}
}
// 2. Get props
{
"name": "get_component_props",
"arguments": {
"name": "Dialog",
"includeDeprecated": false
}
}
// 3. Get example
{
"name": "get_component_example",
"arguments": {
"name": "Dialog",
"variant": "default"
}
}
// 4. Scaffold usage
{
"name": "scaffold_component_usage",
"arguments": {
"name": "Dialog",
"withState": true
}
}Accessibility Compliance
All components in the Vayu UI registry meet WCAG 2.1 AA standards:
- Color contrast: Minimum 4.5:1 for normal text, 3:1 for large text
- Keyboard navigation: All interactive elements are keyboard accessible
- Screen reader support: Proper ARIA roles and attributes
- Focus management: Clear focus indicators and logical focus flow
- Reduced motion: Respects
prefers-reduced-motionpreference
Best Practices
For MCP Clients
- Cache component lists: Call
list_componentsonce per session - Use specific tools: Prefer scoped tools over
get_component_full - Handle errors: Gracefully handle "not found" errors
- Validate props: Check
requiredflags in prop metadata - Respect deprecations: Avoid using deprecated props
For AI Assistants
- Search before assuming: Use
find_componentto locate appropriate components - Check anti-patterns: Use
get_component_doNotbefore generating code - Include accessibility: Always reference
get_component_a11yfor A11y requirements - Use examples: Reference
get_component_examplefor best practices - Scaffold with state: Use
scaffold_component_usagefor complete implementations
API Reference
Tool Parameters
All MCP tools follow a consistent parameter structure:
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Component/hook name (case-insensitive) |
slug | string | No | CLI identifier (case-sensitive) |
variant | string | No | Example variant key |
category | enum | No | Filter by category |
type | enum | No | Filter by type (component/hook) |
overridableOnly | boolean | No | Return only overridable tokens |
includeDeprecated | boolean | No | Include deprecated props |
withState | boolean | No | Wrap examples in useState |
Error Handling
All MCP tools return errors in a consistent format:
{
"content": [
{
"type": "text",
"text": "ERROR: Component not found. Use find_component() to search."
}
],
"isError": true
}Additional Resources
- Components - Explore all available components
- Hooks - Custom React hooks for common patterns
- Design System - Global CSS and design tokens
- Getting Started - Quick start guide for Vayu UI
- MCP Protocol - Learn about MCP