shadcn MCP Server
Lets agents browse, search and install components from shadcn/ui and other shadcn-compatible registries.
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?
shadcn package as the CLI.Do I need an API key for the shadcn MCP server?
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?
registries in components.json with an @namespace.What if the server shows “No tools or prompts”?
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
- shadcn docs: MCP Server
- shadcn docs: MCP for registries
- Repository: shadcn-ui/ui
- MCP server source (tools)
- package.json (version 4.21.4, MIT)
Checked October 13, 2026.
Dev & code hosting
View all- GitHub MCP ServerLets agents read repos and manage issues, pull requests, Actions and security alerts on GitHub.Official
- Hugging Face MCP ServerConnects agents to the Hugging Face Hub to search models, datasets, papers and Spaces and to call Gradio apps.Official
- Next DevTools MCPConnects agents to a running Next.js 16+ dev server for live errors, routes, logs and Server Actions.Official
- Postman MCP ServerConnects agents to Postman workspaces, collections, specs and environments, and generates API client code.Official
