VayuUI

MCP Support

Connect the Vayu UI MCP server to your AI coding tools for intelligent component discovery, props lookup, scaffolding, and design token access.

The Vayu UI MCP server exposes 17 tools that let AI assistants understand your component library — search components, get props and variants, scaffold code, access design tokens, and more. It runs via stdio, so it works with any MCP-compatible tool.

Quick Setup

The fastest way is using the CLI. All configurations are written at the project level (workspace root):

# Interactive — prompts which tools to configure
npx vayu-ui-cli@latest install-mcp

# Configure specific tools
npx vayu-ui-cli@latest install-mcp --tool claude
npx vayu-ui-cli@latest install-mcp --tool claude,cursor,opencode

This writes the correct config to each tool's settings file in your project root. Restart your AI tool after running it.

FlagDescription
--toolComma-separated: claude, cursor, opencode
--dry-runPreview changes without writing
--forceOverwrite existing entries

Note: The CLI auto-configures Claude Code, Cursor, and OpenCode. For Codex, Antigravity, and Windsurf, use the manual setup below.

Manual Setup

If you prefer to add the config manually, add the JSON (or TOML) below to the correct file for your tool.

File: .mcp.json (project root)

{
  "mcpServers": {
    "vayu-ui": {
      "command": "npx",
      "args": ["-y", "vayu-ui-mcp"]
    }
  }
}

If the file already exists, merge the vayu-ui entry into the existing mcpServers, mcp, or mcp_servers object — don't overwrite other entries.

Project-Level Setup

All MCP configurations managed by this CLI are project-scoped. This means:

  • Config files are created in your project root, not your home directory.
  • The MCP server is only active when the AI tool is working inside this project.
  • Other projects are unaffected.

If you need the same MCP server in multiple projects, run install-mcp in each project directory.

Available Tools

Once connected, the following 17 tools are available to your AI assistant:

ToolDescription
list_componentsList all components and hooks with optional filters
find_componentFuzzy search by natural language query
get_component_summaryLightweight identity card (name, category, tags)
get_component_propsAll props with types, defaults, and descriptions
get_component_variantsAvailable visual variants and sizes
get_component_statesInteractive states (loading, disabled, hover, etc.)
get_component_eventsEvent handlers with TypeScript signatures
get_component_a11yARIA roles, keyboard navigation, focus management
get_component_dependenciesNPM deps, registry deps, install command
get_component_peer_componentsFrequently co-used components
get_component_compositionCompound component structure and sub-components
get_component_exampleReady-to-paste TSX code examples
get_component_do_notAnti-patterns and common mistakes
get_hook_detailsFull hook API (signature, params, return values)
scaffold_component_usageGenerate working code with imports and state
get_install_guideCLI commands and import paths for installation
get_design_tokensCSS design tokens with Tailwind classes

Usage Guide

  1. Discover — find_component (or list_components for broad browsing), then get_component_summary
  2. Inspect — get_component_props, get_component_variants, get_component_states, and get_component_events
  3. A11y + composition — get_component_composition and get_component_a11y for overlays/forms/keyboard paths
  4. Scaffold + validate — scaffold_component_usage, then get_component_do_not
  5. Install/import verification — get_install_guide before sharing commands/import paths

Example: Finding and Using a Component

{
  "name": "find_component",
  "arguments": { "query": "modal dialog with overlay" }
}

Common Tool Parameters

ParameterTypeRequiredDescription
namestringYesComponent/hook name (case-insensitive)
slugstringNoCLI slug identifier
variantstringNoExample variant key
categoryenumNoFilter: inputs, overlay, state, etc.
typeenumNoFilter: component or hook
withStatebooleanNoWrap scaffold in useState

Design Tokens via MCP

Use get_design_tokens to access the full design system:

{
  "name": "get_design_tokens",
  "arguments": { "name": "Button" }
}

Token Categories

CategoryWhat's Included
ColorsSemantic tokens: brand, surface, elevated, success, warning, destructive, info, muted (each with content variant)
Radiusrounded-control, rounded-surface, rounded-overlay
Shadowsshadow-control, shadow-surface, shadow-elevated
Structuralborder, field, focus tokens

Pass overridableOnly: true to get only tokens that are safe to override without breaking component behavior.

Component Categories

CategoryDescriptionExamples
inputsForm controls and data entryButton, TextInput, Checkbox, Select
feedbackStatus and feedbackAlert, Spinner, Toast
overlayModal and overlay UIModal, Tooltip, Popover
layoutStructural componentsCard, Container, Grid
data-displayContent presentationAvatar, Badge, Separator
navigationNavigation componentsNavbar, Sidebar, Tabs
animationAnimated componentsAnimatedContainer, FadeIn
stateState management hooksuseLocalStorage, useDebounce
sensorBrowser sensor hooksuseMediaQuery, useResizeObserver
domDOM interaction hooksuseClickOutside, useFocusTrap

Best Practices

  • Use find_component before assuming — the AI should search for the right component rather than guessing
  • Check anti-patterns — always run get_component_do_not before generating code
  • Include accessibility — reference get_component_a11y for ARIA and keyboard requirements
  • Use the scaffold tool — scaffold_component_usage generates complete code with imports and state
  • Cache component lists — call list_components once per session, not per request

Project setup and import accuracy

npx vayu-ui-cli@latest install-mcp --tool claude,cursor,opencode,vscode,codex --force

Setup merges the Vayu entry with existing server settings. It supports JSON comments for VS Code and TOML for Codex. --dry-run previews changes; malformed configuration stops setup before any selected file is modified.

ClientProject configuration
Claude Code.mcp.json
Cursor.cursor/mcp.json
OpenCodeopencode.json
VS Code.vscode/mcp.json
Codex.codex/config.toml

Restart or reload your client after setup. Codex loads project MCP configuration in trusted projects; see the official Codex MCP documentation. VS Code uses a servers object with type: "stdio", as described in its MCP documentation.

Before requesting generated usage, read vayu-ui.config.json. Pass its uiPath, paths, and aliases as config, and pass the target source filename as fromFile, to get_install_guide or scaffold_component_usage. Their default is CLI-copied sources. Use mode: "package" only when the application installs the vayu-ui npm package.

Scaffolding uses registry examples with valid compound nesting and returns the slugs used by the snippet. Application headings and paragraphs use Typography. Overlay titles retain Modal.Title / Drawer.Title so their accessible IDs stay connected.

On this page