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.
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.
Merge it into the file
Open
~/.copilot/mcp-config.json(create it if it's missing) and putshadcnioinsidemcpServers. Keep"tools": ["*"]: a remote server's entry needs it.Or fill in /mcp add
In a session,
/mcp addasks for the same fields: nameshadcnio, type HTTP, your URL, tools*. Ctrl+S saves it and connects, no restart.Start copilot and approve
Run
/mcp show shadcnioto see its 22 tools. Copilot asks before its first call: approve it for the session, or for the repository.
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.
| Source | Applies to | Good to know |
|---|---|---|
~/.copilot/mcp-config.json | Every session on this machine | copilot mcp add and /mcp add write here |
.mcp.json, from the working directory up to the repo root | This checkout | Loads only in a folder you trust |
.github/mcp.json | Everyone who clones the repo | Committed, so never with a token in it |
--additional-mcp-config | One session | JSON 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.
- Start
copilotin a project and trust the folder when it asks. - Run
/mcp show shadcnio: connected, with 22 tools. - Outside a session,
copilot mcp get shadcnioprints its type, status and tools. - Type the prompt below at the
copilotprompt and allow the tool when it asks.whoamianswers with your account, your plan and this minute's remaining calls.
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.
- shadcn.io MCP connected · 22 tools
Agent step: Read issue #87 with the GitHub MCP serverReturns: Wants an illustration and a Create project buttonMCP call: search_blocks({ query: "empty state first project", category: "empty-state" })Returns: empty-state-first-project at the topMCP call: get_block({ name: "empty-state-first-project", include: ["install"] })Returns: Its npx shadcn add line, ready to run on a fresh branchAgent step: Ran npx shadcn add on a new branch (approved)Returns: The block in components, shown when the list is empty
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.
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-tooltakes 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.mdand your personal~/.copilot/copilot-instructions.mdinto 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 theshadcnioentry. Copilot CLI expands variables inheaders, 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
usagerather thansource, check/contexton long tasks, and run/compactwhen 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.-sprints 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.
/mcpdoesn't list shadcnio at all.- Check
~/.copilot/mcp-config.jsonparses as JSON, with the entry insidemcpServers. A remote server needstype,urlandtools: 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 shadcnioand 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
copilotsession;mcp-config.jsonstays 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 -pruns, a server from the repo's.mcp.jsonnever 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 inAGENTS.mdor.github/copilot-instructions.mdmakes 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.
Nothing beyond a working Copilot CLI. If your seat comes from an organization or enterprise, an admin may enforce an MCP allowlist, and then shadcnio has to be on it. The shadcnio server is separate: it needs a shadcn.io Pro plan.
Yes. Inside a session, /mcp add asks for the same fields: the name shadcnio, type HTTP, your URL and tools *. Ctrl+S saves it to ~/.copilot/mcp-config.json and connects at once.
From ~/.copilot/mcp-config.json for every session, a .mcp.json between the working directory and the repo root in a folder you trust, .github/mcp.json for everyone who clones the repo, and --additional-mcp-config for one session. A project's .mcp.json wins over the user file when two servers share a name.
Choose the session or repository option when Copilot first asks, or launch with copilot --allow-tool='shadcnio', which takes a server's name for all its tools. Copilot asks before every MCP call, read-only ones included.
Yes. Press Shift+Tab to cycle into plan mode and ask for the page there. The plan is built from plan_page's blocks, so you approve real block names before a file changes.
Copilot CLI calls get_install_plan, which returns every file with its path and the packages to add. It writes the files and runs your package manager, asking before each write and command unless you've approved them. Vue and Solid repos go the same way; React gets one npx shadcn add command instead.
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.
Prompt mode can't stop to ask, so grant what the task needs up front: the server, npx and file writes, for example with --allow-tool='shadcnio, shell(npx:*), write'. Adding -s prints the answer alone.
It sits in plain text, inside the URL, in your Copilot home folder, which is outside your projects; set COPILOT_HOME and the file moves with it. If it ever leaks, regenerate it on your account page and the old one stops working.
Yes. Cut the token from the URL and add an Authorization header with Bearer and a SHADCNIO_TOKEN variable to the shadcnio entry. Copilot CLI expands variables in headers, so the file holds no secret and the token comes from your shell.
Check that ~/.copilot/mcp-config.json parses as JSON, with the entry inside mcpServers. A remote server needs type, url and tools: an entry without a tools list of * isn't valid.
A 401 means the URL carries a missing or old token; run /mcp edit shadcnio and paste the current URL. A 403 means the token is real but its account's Pro plan isn't active; renew it and start a new copilot session. A 429 means over 600 calls a minute, so wait for Retry-After.
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.
Using another agent too?
The same URL works in every MCP client: use it beside Copilot CLI, in your editor, your terminal or your chat app.
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