Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Add, manage, and compose shadcn/ui components with correct patterns, styling, and CLI workflows.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
mcp.md
1# shadcn MCP Server23The CLI includes an MCP server that lets AI assistants search, browse, view, and install components from registries.45---67## Setup89```bash10shadcn mcp # start the MCP server (stdio)11shadcn mcp init # write config for your editor12```1314Editor config files:1516| Editor | Config file |17|--------|------------|18| Claude Code | `.mcp.json` |19| Cursor | `.cursor/mcp.json` |20| VS Code | `.vscode/mcp.json` |21| OpenCode | `opencode.json` |22| Codex | `~/.codex/config.toml` (manual) |2324---2526## Tools2728> **Tip:** MCP tools handle registry operations (search, view, install). For project configuration (aliases, framework, Tailwind version), use `npx shadcn@latest info` — there is no MCP equivalent.2930### `shadcn:get_project_registries`3132Returns registry names from `components.json`. Errors if no `components.json` exists.3334**Input:** none3536### `shadcn:list_items_in_registries`3738Lists all items from one or more registries.3940**Input:** `registries` (string[]), `limit` (number, optional), `offset` (number, optional)4142### `shadcn:search_items_in_registries`4344Fuzzy search across registries.4546**Input:** `registries` (string[]), `query` (string), `limit` (number, optional), `offset` (number, optional)4748### `shadcn:view_items_in_registries`4950View item details including full file contents.5152**Input:** `items` (string[]) — e.g. `["@shadcn/button", "@shadcn/card"]`5354### `shadcn:get_item_examples_from_registries`5556Find usage examples and demos with source code.5758**Input:** `registries` (string[]), `query` (string) — e.g. `"accordion-demo"`, `"button example"`5960### `shadcn:get_add_command_for_items`6162Returns the CLI install command.6364**Input:** `items` (string[]) — e.g. `["@shadcn/button"]`6566### `shadcn:get_audit_checklist`6768Returns a checklist for verifying components (imports, deps, lint, TypeScript).6970**Input:** none7172---7374## Configuring Registries7576Registries are set in `components.json`. The `@shadcn` registry is always built-in.7778```json79{80"registries": {81"@acme": "https://acme.com/r/{name}.json",82"@private": {83"url": "https://private.com/r/{name}.json",84"headers": { "Authorization": "Bearer ${MY_TOKEN}" }85}86}87}88```8990- Names must start with `@`.91- URLs must contain `{name}`.92- `${VAR}` references are resolved from environment variables.9394Community registry index: `https://ui.shadcn.com/r/registries.json`95