MCP Server
Use the shadcn MCP server to browse, search, and install components from registries.
The shadcn MCP Server allows AI assistants to interact with items from registries. You can browse available components, search for specific ones, and install them directly into your project using natural language.
Registries are configured in your project's components.json file:
Quick Start
Select your MCP client and follow the instructions to configure the server:
Run the following command in your project:
Restart Claude Code and try these prompts:
- Show me all available components in the shadcn registry
- Add the button, dialog and card components to my project
- Create a contact form using components from the shadcn registry
/mcp command in Claude Code to check connected tools.What is MCP?
Model Context Protocol (MCP) is an open protocol that enables AI assistants to securely connect to external data sources and tools. With the shadcn MCP server, your AI assistant gains direct access to:
- Browse Components - List all available components, blocks, and templates from any configured registry
- Search Across Registries - Find specific components by name or functionality across multiple sources
- Install with Natural Language - Add components using simple conversational prompts like "add a login form"
- Support for Multiple Registries - Access public registries, private company libraries, and third-party sources
Configuring Registries
Configure additional registries in your components.json:
Authentication
For private registries requiring authentication, set environment variables in your .env.local:
Troubleshooting
MCP Not Responding
- Verify the MCP server is properly configured and enabled in your client settings.
- Restart your MCP client (Claude Code, Cursor) after making config changes.
- Ensure the
shadcnpackage is installed.
Registry Access Issues
- Confirm the registry URL matches the namespace in components.json.
- Ensure environment variables like
REGISTRY_TOKENare correctly set. - Verify that the private registry endpoint is online.