Skip to content

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.

  1. Copy the command

    With Pro, the command holds your token in its Authorization header, so the URL stays clean. Without a token yet, create one on your account.

  2. Run it in any terminal

    claude mcp add writes the server to ~/.claude.json. No restart: the next session you start picks it up.

  3. Open a session and run /mcp

    You want shadcnio connected with its 22 tools. Claude Code asks once before it first calls one of them.

  4. 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.

Terminal
Sign in to get your config
Sign in with a Pro account, and this holds your MCP URL, ready to paste.

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.

Where Claude Code keeps it, by scope
ScopeStored inWho gets it
--scope user~/.claude.jsonYou, in every project on this machine
--scope project.mcp.json at the repo's rootEveryone who clones the repo (commit it)
--scope local (the default)~/.claude.json, under this projectYou, 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.

.mcp.json
{
  "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.

  1. Start claude in a project and run /mcp.
  2. Find shadcnio marked connected, with 22 tools.
  3. From a shell, claude mcp get shadcnio prints the config it resolved.
  4. Ask the prompt below: Claude Code calls whoami and answers with your account and the calls you have left this minute.
Prompt
use shadcnio to tell me who I'm connected as

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.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Add a date picker to the booking form.
  3. Agent step: Read package.jsonReturns: Next.js, React 19, @base-ui/react, pnpm
  4. MCP call: search_components({ query: "date picker" })Returns: date-picker, the closest match
  5. MCP call: get_component({ name: "date-picker", include: ["install", "usage"], packageManager: "pnpm" })Returns: pnpm dlx shadcn add …/r/date-picker.json, and its usage
  6. Agent step: Ran pnpm dlx shadcn add (you approved)Returns: date-picker, calendar and popover, in components/ui
  7. Your agent: Added the Date Picker to BookingForm, wired to your checkIn field with past dates disabled.

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.

01
use shadcnio to add a date picker to the booking form
02
use shadcnio to build the pricing page from blocks, with a monthly and yearly toggle
03
use shadcnio to rebuild the signup form with React Hook Form and Zod, one field per row
04
use shadcnio to replace the hand-drawn SVGs in components/icons with Lucide icons
05
use shadcnio to check which props Dialog's Content takes before you edit the modal
06
use shadcnio to theme the app after Linear's DESIGN.md
07
use shadcnio to set up this new Vite project for shadcn components

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__shadcnio to your allow list and Claude Code stops asking for each call; the commands it runs, like npx 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, __icons and __design. Each is a task with the fewest calls that do it.

  • Attach a brand's look with @

    Type @ and pick a shadcnio resource: 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 -p uses 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.

/mcp shows shadcnio as failed.
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.
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-choices asks 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 /mcp shows it connected, then name it: use shadcnio to…. A line in CLAUDE.md makes 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.

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