shadcn/ui components in Claude Code
Run claude mcp add once and Claude Code can search the registry and install components for your framework, right from the terminal. It's included with Pro.
- Kind
- Terminal agent
- Goes in
Terminal- Connects
- Over HTTP
- Team config
- Yes
Add it from your terminal
One command registers the server for every project on your machine. Signed in with Pro, the command beside the steps already holds your token.
Copy the command
With Pro, the command holds your token in its
Authorizationheader, so the URL stays clean. Without a token yet, create one on your account.Run it in any terminal
claude mcp addwrites the server to~/.claude.json. No restart: the next session you start picks it up.Open a session and run /mcp
You want
shadcnioconnected with its 22 tools. Claude Code asks once before it first calls one of them.Ask for a component
Name the server in your prompt (
use shadcnio…) the first few times, so Claude Code reaches for it instead of answering from memory.
How it reads, with YOUR_TOKEN where your token goes:
$ claude mcp add --transport http --scope user shadcnio "https://www.shadcn.io/api/mcp" --header "Authorization: Bearer YOUR_TOKEN"
--scope user keeps it in ~/.claude.json, out of every repo. Your token is a key: regenerate it if it ever leaks.
| Scope | Stored in | Who gets it |
|---|---|---|
--scope user | ~/.claude.json | You, in every project on this machine |
--scope project | .mcp.json at the repo's root | Everyone who clones the repo (commit it) |
--scope local (the default) | ~/.claude.json, under this project | You, in this project only |
Share it with the repo
Commit .mcp.json at the root and every teammate gets the server when they open the project. The file reads the token from SHADCNIO_TOKEN in each person's shell, so no one commits theirs, and Claude Code asks each of them once before it starts a project's servers. A Team or Organization plan gives every member their own Pro access.
{ "mcpServers": { "shadcnio": { "headers": { "Authorization": "Bearer ${SHADCNIO_TOKEN}" }, "type": "http", "url": "https://www.shadcn.io/api/mcp" } } }
Each teammate sets SHADCNIO_TOKEN to their own token (from their MCP URL), so no token is committed.
Check it's connected
/mcp in a session lists every server with its status, and opens one to reconnect or see its tools.
- Start
claudein a project and run/mcp. - Find
shadcniomarked connected, with 22 tools. - From a shell,
claude mcp get shadcnioprints the config it resolved. - Ask the prompt below: Claude Code calls
whoamiand answers with your account and the calls you have left this minute.
What it looks like in Claude Code
Three tasks, start to finish: the prompt, the calls Claude Code makes, and what lands in your repo. Switch the MCP off to see the same prompt without it.
- shadcn.io MCP connected · 22 tools
Agent step: Read package.jsonReturns: Next.js, React 19, @base-ui/react, pnpmMCP call: search_components({ query: "date picker" })Returns: date-picker, the closest matchMCP call: get_component({ name: "date-picker", include: ["install", "usage"], packageManager: "pnpm" })Returns: pnpm dlx shadcn add …/r/date-picker.json, and its usageAgent step: Ran pnpm dlx shadcn add (you approved)Returns: date-picker, calendar and popover, in components/ui
In your project
Date Picker
- Its real props, from its docs
- Installed with your package manager
1 prompt → 2 MCP calls
Prompts to start with
Paste one into a session. Each names the server, so Claude Code reaches for it over what it remembers.
Good to know in Claude Code
The parts of Claude Code that make the MCP faster: permissions, slash commands, resources and limits.
Allow its tools once
All 22 tools only read. Add
mcp__shadcnioto your allow list and Claude Code stops asking for each call; the commands it runs, likenpx shadcn add, still ask.{ "permissions": { "allow": ["mcp__shadcnio"] } }
Seven slash commands
The server's prompts show up as commands:
/mcp__shadcnio__add,__block,__form,__setup,__page,__iconsand__design. Each is a task with the fewest calls that do it.Attach a brand's look with @
Type
@and pick ashadcnioresource: a brand's DESIGN.md, or a guide on forms, dark mode or RTL, read into the conversation as context.Make it the default in CLAUDE.md
One line in
CLAUDE.md, and you can stop naming the server: Claude Code reads it at the start of every session.For UI, use the shadcnio MCP: search before writing a component, and install it with the command it returns.
Big answers, on purpose
A component's whole source or every docs section can pass Claude Code's output warning. Ask for fewer sections, or raise the limit for the session.
$ MAX_MCP_OUTPUT_TOKENS=50000 claude
Headless, in scripts and CI
claude -puses the same servers. Pre-approve the tools with--allowedTools, so nothing waits for a click.$ claude -p "use shadcnio to add a toast after save" --allowedTools "mcp__shadcnio"
When it doesn't connect
What Claude Code shows, and what fixes it. The troubleshooting guide covers every client.
/mcpshows shadcnio as failed.- Run
claude mcp get shadcnioand compare the URL and header with the command on this page. A typo or a cut-off token is the usual cause:claude mcp remove shadcnio, then add it again. - Calls fail with 401.
- The token in the header is missing or old: after you regenerate it, your config still holds the previous one. Copy the command again and re-add the server.
- Calls fail with 403.
- The token is right, but the account has no active Pro plan. Renew it, and the same config works again: nothing to reinstall.
- A teammate's project server never starts.
- They declined Claude Code's prompt for the project's
.mcp.json.claude mcp reset-project-choicesasks again on the next start. ${SHADCNIO_TOKEN}reaches the server as written.- The variable isn't set in the shell that started
claude. Export it in your shell profile, open a new terminal, and start the session again. - Claude Code answers from memory instead.
- Check
/mcpshows it connected, then name it:use shadcnio to…. A line inCLAUDE.mdmakes that the default.
Get the MCP for Claude Code with Pro
The MCP comes with every Pro plan, with every block and premium template, for you or your whole team. Monthly, yearly or lifetime.
4.9/5 out of 5 · 150+ reviewsfrom 150+ founders and developers.
- Secure checkout via Stripe
- Code lives in your repo
- Keep what you've shipped if you cancel
- License terms
Frequently asked questions
The shadcn MCP in Claude Code: setup, limits, and the rest.
User scope, for yourself: one command and it works in every project, with the token in ~/.claude.json and out of every repo. Project scope is for a team: commit .mcp.json with the token read from each person's SHADCNIO_TOKEN. Local scope, the default without --scope, limits it to the current project.
No. The command on this page passes the token in an Authorization header and leaves the URL plain. claude mcp add then writes the server to ~/.claude.json, and the next session you start picks it up without a restart.
Run /mcp in a session: shadcnio should show as connected with its 22 tools. From a shell, claude mcp get shadcnio prints the config it resolved. Asking it to use shadcnio and say who you're connected as calls whoami and returns your account and calls left.
Allow the server once: add mcp__shadcnio to the allow list in /permissions or in your settings.json. Every tool on the server only reads the registry, so this is safe; the install commands Claude Code runs afterwards still ask, as any shell command does.
Claude Code lists the server's seven prompts as slash commands, covering adding a component, a block, a form, setup, a page, icons and a brand's design. Each is a task written with the calls that do it, so /mcp__shadcnio__form builds a form with your form library in the fewest steps.
It picks tools from your prompt, and a vague prompt looks answerable without one. Name the server, be specific about the component or the page, and add a line to CLAUDE.md telling it to use the shadcnio MCP for UI.
Yes. Claude Code reads your package.json and the tools answer for your framework. In React the install is one shadcn command; in Vue, Svelte and Solid the server returns every file with its path and the packages to add, and Claude Code writes them.
Commit .mcp.json at the repo's root with the token read from SHADCNIO_TOKEN, and every teammate gets the server when they open the project. Each person sets the variable in their own shell, and Claude Code asks them once before it starts a project's servers. A Team or Organization plan gives each member their own token.
Yes. Headless runs use the same configured servers. Pass --allowedTools "mcp__shadcnio" so the calls don't wait for approval, and keep the token in an environment variable or a secret, never in the script.
They probably declined the prompt for the project's .mcp.json. Running claude mcp reset-project-choices makes Claude Code ask again on its next start. Also check that SHADCNIO_TOKEN is exported in the shell that starts claude.
It's stored as plain text in your home directory, like any CLI credential, and user scope keeps it out of your repositories. Share configs only through SHADCNIO_TOKEN, and if a token leaks, regenerate it on your account page: the old one stops working within a few minutes.
Only the tool calls: their names and inputs, such as a component's name or a search. Claude Code reads your files on your machine and the server never does. Every tool only reads the registry, and the commands that change your project run on your side.
Run claude mcp get shadcnio and compare the URL and header with the command on this page. A typo or a cut-off token is the usual cause: claude mcp remove shadcnio, then add it again.
A 401 means the token in the header is missing or old, as it is after you regenerate it. A 403 means the token is right but the account has no active Pro plan. A 429 means you passed 600 calls a minute on one token; wait for the Retry-After time.
No. A component's full source, or its docs with every section, can pass the warning threshold. Ask for fewer sections or the usage only, or start Claude Code with MAX_MCP_OUTPUT_TOKENS raised, for example to 50000.
Using another agent too?
The same URL works in every MCP client: use it beside Claude Code, in your editor, your terminal or your chat app.
4.9 out of 5 from 150+ developers
Give Claude Code the whole registry
Every component, 6,231 blocks and 294k icons, a prompt away in your terminal: in every Pro plan.
Get Pro