shadcn MCP Server for Claude Code and Cursor
shadcn/ui ships an official MCP server inside its CLI. Run npx shadcn@latest mcp init --client claude for Claude Code or --client cursor for Cursor, and your agent can browse, search, and install components from the registries in your components.json.
Set it up
The server runs locally through the CLI (npx shadcn@latest mcp), so there is no URL or API key. Restart your editor after running the command.
| Editor | Command | Writes |
|---|---|---|
| Claude Code | npx shadcn@latest mcp init --client claude | .mcp.json |
| Cursor | npx shadcn@latest mcp init --client cursor | .cursor/mcp.json |
| VS Code | npx shadcn@latest mcp init --client vscode | .vscode/mcp.json |
Give it more components to work with
The shadcn MCP server searches whatever registries your project has configured. Add Watermelon to components.json so your agent can find its blocks, dashboards, and animated components too:
"registries": { "@watermelon": "https://registry.watermelon.sh/r/{name}.json" }
Then ask your agent for something like "add a pricing section from @watermelon". More on this in the shadcn registry guide.
shadcn MCP vs Watermelon MCP
They work well together: use Watermelon MCP to find the right block, and the shadcn MCP server or CLI to install it.
| shadcn MCP | Watermelon MCP | |
|---|---|---|
| Runs | Locally, through the shadcn CLI | Hosted at https://mcp.watermelon.sh/mcp |
| Catalog | Registries in your components.json | The full Watermelon catalog, no setup |
| Good at | Installing from any registry you configure | Searching and comparing options, composing multi-section pages |
| Cost | Free | Free, no API key |
Add Watermelon MCP to Claude Code or Cursor
Full details are in the React component MCP server guide.
- Claude Code:
claude mcp add --transport http watermelon https://mcp.watermelon.sh/mcp(add--scope projectto share it through.mcp.json). - Cursor: add
"watermelon": { "url": "https://mcp.watermelon.sh/mcp" }undermcpServersin.cursor/mcp.json.
Frequently asked questions
Is the shadcn MCP server free?
Yes. It is part of the MIT licensed shadcn CLI and runs on your machine.
Does the shadcn MCP server work with third-party registries?
Yes. It reads the registries field in components.json, including private registries with auth headers.