npx shadcn@latest mcp init --client claudeContent Kit MCP Server
The MCP Server 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 can:
- List all available components from the Content Kit registry
- Find specific components by name or functionality
- Add components using simple conversational prompts
- Access Content Kit components using the
@content-kitnamespace prefix
For example, you can ask your AI assistant to "build a landing page using components from the Content Kit registry."
Before You Start
Before you initialize an MCP client or try prompts that reference the Content Kit registry, add the Content Kit registry to your project so @content-kit/* components can be resolved.
Add the following to your components.json to configure the Content Kit registry:
Quick Start
Select your MCP client and follow the instructions to configure the shadcn MCP server. If you'd like to do it manually, see the Configuration section.
To initialize an MCP project for Claude using the shadCN CLI, run the following command:
You can then test that your installation has been successful by trying prompts, for example:
- 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 debug the MCP server.Configure MCP in Cursor
To configure MCP in Cursor, add the shadcn server to your project's .cursor/mcp.json configuration file:
After adding the configuration, enable the shadcn MCP server in Cursor Settings.
Once enabled, you should see a green dot next to the shadcn server in the MCP server list and a list of available tools.
See the Cursor MCP documentation for more details.
Example Prompts
Once the MCP server is configured, you can interact with the Content Kit registry with natural language, for example:
- Show me all available components in the Content Kit registry.
- What components are available from Content Kit?
- Find me a hero section from the Content Kit registry.
- Install @content-kit/button.
- Add button, card and alert from the Content Kit registry.
- Build a dashboard layout using Content Kit components
Troubleshooting
MCP Not Responding
If the MCP server isn't responding to prompts:
- Verify the MCP server is properly configured and enabled in Cursor Settings.
- Restart Cursor after configuration changes.
- In Cursor, view logs by clicking View, then click Output, and select
MCP: project-*in the dropdown.
Registry Access Issues
If components aren't loading from the Content Kit registry:
- Verify the
@content-kitregistry URL is correct - Ensure environment variables are set if using private registry
- Confirm the Content Kit registry is online and accessible
- Ensure namespace syntax is correct (
@content-kit/component-name)
No Tools or Prompts
If you see the No tools or prompts message:
- Run
npx clear-npx-cache - Try to re-enable the MCP server in Cursor Settings
- View → Output → select
MCP: project-*in the dropdown