OfficialDev & code hostinglocal stdio

shadcn MCP Server

Lets agents browse, search and install components from shadcn/ui and other shadcn-compatible registries.

Install

Claude Code

(writes .mcp.json)

npx shadcn@latest mcp init --client claude

Or add this to the project’s .mcp.json, restart Claude Code and run /mcp to check it shows Connected:

{
  "mcpServers": {
    "shadcn": {
      "command": "npx",
      "args": ["shadcn@latest", "mcp"]
    }
  }
}

Cursor

(writes .cursor/mcp.json; then enable the server in Cursor Settings)

npx shadcn@latest mcp init --client cursor

Manual .cursor/mcp.json:

{
  "mcpServers": {
    "shadcn": {
      "command": "npx",
      "args": ["shadcn@latest", "mcp"]
    }
  }
}

VS Code with GitHub Copilot

(writes .vscode/mcp.json; then click Start next to the shadcn server)

npx shadcn@latest mcp init --client vscode

Manual .vscode/mcp.json:

{
  "servers": {
    "shadcn": {
      "command": "npx",
      "args": ["shadcn@latest", "mcp"]
    }
  }
}

Codex

(the CLI cannot update ~/.codex/config.toml for you; add this by hand and restart Codex)

[mcp_servers.shadcn]
command = "npx"
args = ["shadcn@latest", "mcp"]

OpenCode

npx shadcn@latest mcp init --client opencode

Commands and configuration as given in the shadcn docs: the MCP Server page for the config files and the registry MCP page for the mcp init commands. Run them in your project.

The shadcn MCP server is shadcn/ui’s own server for browsing and installing registry components from a coding agent.

The shadcn MCP server lets an agent browse, search and install components from shadcn/ui and any other shadcn-compatible registry in plain language, for example “Add the button, dialog and card components to my project” (shadcn docs). It ships inside the shadcn CLI, runs locally over stdio as npx shadcn@latest mcp, and lives in the shadcn-ui/ui repository under the MIT license. This listing reflects shadcn version 4.21.4 in the repository’s package.json.

The standard shadcn/ui registry needs no configuration. Other registries, including private company libraries, are added under registries in the project’s components.json, and the docs pass private-registry tokens through environment variables in .env.local (shadcn docs). The server itself needs no API key.

Its tools, from the server source, are get_project_registries, list_items_in_registries, search_items_in_registries (fuzzy search), view_items_in_registries, get_item_examples_from_registries, get_add_command_for_items (returns the shadcn add command) and get_audit_checklist, a checklist for verifying new components once the work is done. Most of them need a components.json in the project.

Questions

Is the shadcn MCP server official?
Yes. It is documented on ui.shadcn.com and its source is in the shadcn-ui/ui repository, in the same shadcn package as the CLI.
Do I need an API key for the shadcn MCP server?
No. The server runs locally through npx shadcn@latest mcp. Only private registries that require authentication need a token, which the docs set as an environment variable in .env.local.
Can it use registries other than shadcn/ui?
Yes. It works with any registry that follows the shadcn registry specification, including third-party and private ones, once they are listed under registries in components.json with an @namespace.
What if the server shows “No tools or prompts”?
The docs suggest running npx clear-npx-cache, re-enabling the server in your MCP client and, in Cursor, reading the logs under View → Output with MCP: project-* selected.

Sources

Checked October 13, 2026.

Dev & code hosting

View all
Aftergradient

What are you looking for?

Search commands, errors, tools