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 items 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. Registries can be configured39namespaces such as `@acme`, public GitHub sources such as `owner/repo`, or40registry catalog URLs. Omit `registries` to list from every registry configured41in `components.json`.4243**Input:** `registries` (string[], optional — omit for all configured), `types` (string[], optional — e.g. `["ui", "block"]`), `limit` (number, optional, defaults to 100), `offset` (number, optional)4445### `shadcn:search_items_in_registries`4647Fuzzy search across registries. Registries can be configured namespaces, public48GitHub sources, or registry catalog URLs. Omit `registries` to search every49registry configured in `components.json` — e.g. "find me a hero" across all50configured registries.5152**Input:** `registries` (string[], optional — omit for all configured), `query` (string), `types` (string[], optional — e.g. `["ui", "block"]`), `limit` (number, optional, defaults to 100), `offset` (number, optional)5354### `shadcn:view_items_in_registries`5556View item details including full file contents.5758**Input:** `items` (string[]) — e.g.59`["@shadcn/button", "@shadcn/card", "owner/repo/item"]`6061### `shadcn:get_item_examples_from_registries`6263Find usage examples and demos with source code. Omit `registries` to search64every registry configured in `components.json`.6566**Input:** `registries` (string[], optional — omit for all configured), `query` (string) — e.g. `"accordion-demo"`, `"button example"`6768### `shadcn:get_add_command_for_items`6970Returns the CLI install command.7172**Input:** `items` (string[]) — e.g. `["@shadcn/button"]`7374### `shadcn:get_audit_checklist`7576Returns a checklist for verifying components (imports, deps, lint, TypeScript).7778**Input:** none7980---8182## Configuring Registries8384Namespaced and authenticated registries are set in `components.json`. The85`@shadcn` registry is always built-in. Public GitHub registries can also be used86directly as `owner/repo` registry sources when the repository has a root87`registry.json`; they do not need `components.json` configuration.8889```json90{91"registries": {92"@acme": "https://acme.com/r/{name}.json",93"@private": {94"url": "https://private.com/r/{name}.json",95"headers": { "Authorization": "Bearer ${MY_TOKEN}" }96}97}98}99```100101- Names must start with `@`.102- URLs must contain `{name}`.103- `${VAR}` references are resolved from environment variables.104105Community registry index: `https://ui.shadcn.com/r/registries.json`106