Skip to main content
The mcp command starts the shadcn MCP server or helps you configure MCP clients.

Usage

Start the MCP server:
Initialize MCP for a specific client:

Options

string
The MCP client to configure. Available options:
  • claude - Claude Code
  • cursor - Cursor
  • vscode - VS Code
  • codex - Codex
  • opencode - OpenCode
string
The working directory. Defaults to the current directory.

Examples

Start MCP server

This command starts the MCP server that AI assistants can connect to for browsing and installing components.

Initialize for Claude Code

Creates .mcp.json with configuration for Claude Code.

Initialize for Cursor

Creates .cursor/mcp.json with configuration for Cursor.

Initialize for VS Code

Creates .vscode/mcp.json with configuration for VS Code with GitHub Copilot.

What it does

When you run mcp init:
  1. Detects configuration - Checks for existing MCP configuration
  2. Creates config file - Adds shadcn MCP server configuration
  3. Installs dependencies - Optionally installs shadcn package
  4. Provides instructions - Shows next steps for your specific client
When you run mcp without arguments:
  1. Starts MCP server - Launches the Model Context Protocol server
  2. Loads registries - Reads component registries from components.json
  3. Exposes tools - Makes browsing, searching, and installation tools available to AI assistants

Configuration

The MCP server reads registry configuration from components.json:
components.json

Learn more