Skip to content

shadcn/ui in GitHub Copilot CLI

Add an entry to ~/.copilot/mcp-config.json and Copilot CLI checks the registry before it changes your repo, then runs the install the server gives it. It comes with Pro.

Kind
Terminal agent
Goes in
~/.copilot/mcp-config.json
Connects
Over HTTP
Team config
No
Its docs
None

Add it to mcp-config.json

One entry in your user config reaches every copilot session on this machine. With Pro, the JSON beside these steps already carries your URL.

  1. Copy the entry

    Signed in with Pro, it holds your MCP URL, token included. Still need a token? Make one on your account page first.

  2. Merge it into the file

    Open ~/.copilot/mcp-config.json (create it if it's missing) and put shadcnio inside mcpServers. Keep "tools": ["*"]: a remote server's entry needs it.

  3. Or fill in /mcp add

    In a session, /mcp add asks for the same fields: name shadcnio, type HTTP, your URL, tools *. Ctrl+S saves it and connects, no restart.

  4. Start copilot and approve

    Run /mcp show shadcnio to see its 22 tools. Copilot asks before its first call: approve it for the session, or for the repository.

~/.copilot/mcp-config.json
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:

{
  "mcpServers": {
    "shadcnio": {
      "tools": [
        "*"
      ],
      "type": "http",
      "url": "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN"
    }
  }
}

Copilot CLI keeps the file in ~/.copilot (or $COPILOT_HOME), outside every repo. A project's .mcp.json wins over it when two servers share a name.

Where Copilot CLI reads servers from
SourceApplies toGood to know
~/.copilot/mcp-config.jsonEvery session on this machinecopilot mcp add and /mcp add write here
.mcp.json, from the working directory up to the repo rootThis checkoutLoads only in a folder you trust
.github/mcp.jsonEveryone who clones the repoCommitted, so never with a token in it
--additional-mcp-configOne sessionJSON or @file, ahead of a same-name server

See it in /mcp

/mcp opens the plugins dashboard with every server and its status, the built-in GitHub one included. /mcp show shadcnio opens just this one, with its tools.

  1. Start copilot in a project and trust the folder when it asks.
  2. Run /mcp show shadcnio: connected, with 22 tools.
  3. Outside a session, copilot mcp get shadcnio prints its type, status and tools.
  4. Type the prompt below at the copilot prompt and allow the tool when it asks. whoami answers with your account, your plan and this minute's remaining calls.
Prompt
use shadcnio to check which shadcn.io account this token belongs to

Three jobs in Copilot CLI

An issue, a planned settings page and a Svelte repo: the prompt, the calls Copilot makes, and what lands. Turn the MCP off to compare with what it guesses.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Take issue #87 about the blank projects page and fix it on a new branch.
  3. Agent step: Read issue #87 with the GitHub MCP serverReturns: Wants an illustration and a Create project button
  4. MCP call: search_blocks({ query: "empty state first project", category: "empty-state" })Returns: empty-state-first-project at the top
  5. MCP call: get_block({ name: "empty-state-first-project", include: ["install"] })Returns: Its npx shadcn add line, ready to run on a fresh branch
  6. Agent step: Ran npx shadcn add on a new branch (approved)Returns: The block in components, shown when the list is empty
  7. Your agent: Pushed fix/projects-empty-state and opened a pull request that closes #87, with the new empty state and its Create project button.

In your project

Empty state block

  • The issue's ask, built from a real block
  • A branch and a pull request that closes #87

1 prompt → 2 MCP calls

Prompts for your next session

Paste one at the copilot prompt. @ and a path adds that file as context, and naming shadcnio keeps Copilot on the registry.

01
use shadcnio to fix issue #42: the signup form needs an inline error under each field
02
use shadcnio to plan the onboarding flow as blocks, and wait for my go-ahead before writing code
03
use shadcnio to swap the inline SVGs in @src/components/Sidebar.tsx for Tabler icons
04
use shadcnio to look up what Popover's Positioner accepts, then fix the menu in @src/components/HelpMenu.tsx
05
use shadcnio to restyle the app after GitHub's DESIGN.md
06
use shadcnio to get this SvelteKit repo ready for shadcn.io components
07
use shadcnio to put a sortable orders table from its blocks on the admin page

Copilot CLI specifics

Approvals, modes, instructions and context: the parts of Copilot CLI that change how the MCP behaves.

  • Approve the server once

    Copilot CLI asks before every MCP call, read-only ones included. Answer with the session or repository option, or launch with the server allowed: --allow-tool takes a server's name for all its tools.

    $ copilot --allow-tool='shadcnio'
  • Plan the page first

    Shift+Tab cycles into plan mode. Ask for the page there, and the plan Copilot shows you is built from plan_page's blocks, so you approve real block names before a file changes.

  • Say it once in your instructions

    Copilot CLI merges AGENTS.md, .github/copilot-instructions.md and your personal ~/.copilot/copilot-instructions.md into each session. One line there and you can stop naming the server.

    For UI work, call the shadcnio MCP first and install with the command it returns; never write a component it already has.
  • Move the token to a header

    Cut ?token=… from the URL and add this to the shadcnio entry. Copilot CLI expands variables in headers, so the file holds no secret and the token comes from your shell.

    "headers": {
      "Authorization": "Bearer ${SHADCNIO_TOKEN}"
    }
  • Keep answers lean

    Every result lands in the context window, and tokens are AI credits. Ask for usage rather than source, check /context on long tasks, and run /compact when it fills.

  • Scripts with copilot -p

    Prompt mode can't stop to ask, so grant what the task needs up front: the server, npx, and file writes. -s prints the answer alone.

    $ copilot -p "use shadcnio to add a skeleton to the orders list" -s \
      --allow-tool='shadcnio, shell(npx:*), write'

When shadcnio won't connect

What Copilot CLI shows when the server misbehaves, and the fix. Other clients are in the troubleshooting guide.

/mcp doesn't list shadcnio at all.
Check ~/.copilot/mcp-config.json parses as JSON, with the entry inside mcpServers. A remote server needs type, url and tools: an entry without "tools": ["*"] isn't valid.
shadcnio won't connect, or its calls return 401 Unauthorized.
The URL carries a missing or old token, usually one from before you regenerated it. Run /mcp edit shadcnio and paste the URL from this page, or replace it in the file.
Calls come back 403, Pro required.
A 403 means the token is real but its account's Pro plan isn't active. Renew it on pricing, then start a new copilot session; mcp-config.json stays untouched.
Copilot says shadcnio was blocked by your enterprise.
Your enterprise enforces an MCP allowlist, and the CLI blocks any server not on it, failing closed when it can't check. Ask an admin to allow the server's URL: no local setting overrides it.
In copilot -p runs, a server from the repo's .mcp.json never starts.
Prompt mode can't ask you to trust the folder, so it skips workspace servers in untrusted ones. Pass --trust-folder, trust the folder once in an interactive session, or keep shadcnio in your user config, which always loads.
Copilot writes a component from memory instead.
Name the server (use shadcnio to…) or one of its tools in the prompt. A line in AGENTS.md or .github/copilot-instructions.md makes that the default.

Get the MCP for Copilot CLI 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 Copilot CLI: setup, limits, and the rest.

4.9 out of 5 from 150+ developers

Bring the registry to Copilot CLI

Components for four frameworks, 6,231 blocks and 294k icons, one approval away at the `copilot` prompt: part of every Pro plan.

Get Pro