shadcn/ui with Copilot in VS Code
Save a .vscode/mcp.json and Copilot can search the registry and install a component into the file you're editing, in React, Vue, Svelte or Solid. It's included with Pro.
- Kind
- Editor
- Goes in
.vscode/mcp.json- Connects
- Over HTTP
- Team config
- Yes
- Its docs
- VS Code MCP (opens in a new tab)
Add it to your workspace
Save the config beside these steps as .vscode/mcp.json, and Copilot can reach the server from your next message. Signed in with Pro, it already holds your token.
Copy the config, or click Add to VS Code
With Pro, the file carries your token in an
Authorizationheader. Add to VS Code (or Insiders) hands the same entry to VS Code through its install link instead. No token yet: create one on your account.Save it as .vscode/mcp.json
Put it at the root of the folder you open, under
.vscode. VS Code gives IntelliSense for theserversformat while you paste, so a missing comma shows up at once.Trust the folder
Workspace servers follow Workspace Trust: in a trusted folder,
shadcniostarts without a separate prompt; in Restricted Mode, it doesn't start at all.Ask Copilot for a component
In the Chat view, pick Agent and name the server (
use shadcnio…). Sending the message startsshadcnioand loads its 22 tools.
How it reads, with YOUR_TOKEN where your token goes:
{ "servers": { "shadcnio": { "headers": { "Authorization": "Bearer YOUR_TOKEN" }, "type": "http", "url": "https://www.shadcn.io/api/mcp" } } }
Many repositories commit .vscode/: add .vscode/mcp.json to .gitignore, or share the team file below instead. If the token ever leaks, regenerate it.
| File | Open it with | Who it reaches |
|---|---|---|
.vscode/mcp.json (this config) | MCP: Open Workspace Folder MCP Configuration | This folder, in Local and Copilot sessions |
Your user mcp.json | MCP: Open User Configuration | Every folder you open, and Settings Sync |
~/.copilot/mcp-config.json | MCP: Add Server, then Global and Copilot Global | VS Code and Copilot CLI, keyed mcpServers |
The remote host's mcp.json | MCP: Open Remote User Configuration | Each folder on that SSH, WSL or container host |
Commit it with the repo
Commit .vscode/mcp.json with ${input:shadcnio-token} where the token was. The first time the server starts, VS Code asks each teammate for theirs (what follows ?token= in their MCP URL) and stores it securely, never in the file. Inputs work in Local harness sessions: Copilot harness sessions, the default since VS Code 1.143, skip servers that need one, so pick Local for UI work or keep a personal copy in your user configuration. Each teammate's token answers only while their account has Pro, so a shadcn.io Team or Organization plan that covers every seat is the simple way to give it.
{ "inputs": [ { "description": "shadcn.io MCP token", "id": "shadcnio-token", "password": true, "type": "promptString" } ], "servers": { "shadcnio": { "headers": { "Authorization": "Bearer ${input:shadcnio-token}" }, "type": "http", "url": "https://www.shadcn.io/api/mcp" } } }
VS Code asks each teammate for their token once (what follows ?token= in their MCP URL) and keeps it in its secret storage, so no token is committed.
See it running in VS Code
MCP: List Servers lists every server VS Code knows with its state, and opens one to start, stop or read its output.
- Open the Command Palette (
⇧⌘P, orCtrl+Shift+Pon Windows and Linux) and run MCP: List Servers:shadcnioshould be running. - If it isn't, select it and choose Show Output: the server's log names the error, a 401 or 403 included.
- In the Chat view, pick Agent, send the prompt below and expand the tool call: it's
whoamifromshadcnio, with your account and the calls left this minute.
Three edits from the Chat view
Three edits made from the Chat view, with the file open beside it: the request, each tool call Copilot shows in the conversation, and what changed. Turn the MCP off to see the same request answered without it.
- shadcn.io MCP connected · 22 tools
Agent step: Read app/orders/page.tsx (attached with #file)Returns: A plain table mapped over ordersMCP call: search_blocks({ query: "sortable table with pagination", category: "tables" })Returns: tables-sortable, then tables-paginationMCP call: get_block({ name: "tables-sortable", include: ["install", "source"] })Returns: Its install command, and the code to adaptAgent step: Ran npx shadcn@latest add (you selected Allow)Returns: The block and the components it uses
In your project
Sortable table
- Sort buttons on each header, page controls below
- Your columns and formatting kept
1 prompt → 2 MCP calls
Prompts for the Chat view
Send one with Agent picked in the Chat view. Each names the server, so Copilot calls its tools before writing UI from memory.
What changes how Copilot uses it
Approvals, instructions, tool limits and context: the VS Code features that decide how often Copilot reaches for the registry.
No prompt per lookup
Every
shadcniotool is marked read-only, and VS Code runs read-only tools without a confirmation. If your session asks anyway, run Chat: Manage Tool Approval and tick the server's top-level box to pre-approve all 22.Let the install run
The install is a terminal command, and those ask before they run. A rule in
chat.tools.terminal.autoApprovelets the shadcn CLI through while every other command still asks.{ "chat.tools.terminal.autoApprove": { "/^npx shadcn@latest add /": true } }
A rule for your components folder
An instructions file in
.github/instructionswith anapplyToglob is attached whenever the agent creates or edits a matching file, so UI work starts with the registry.--- description: 'Use when adding or changing UI.' applyTo: 'src/components/**' --- Search the shadcnio MCP before writing a component, and install it with the command it returns.
Stay under 128 tools
A chat request takes at most 128 tools, and
shadcniobrings 22. With many servers installed, untick what a task doesn't need: Chat: Open Customizations → Tools in Copilot sessions, Configure Tools in Local ones.Attach a brand, or run a prompt
Add Context → MCP Resources attaches a brand's DESIGN.md or a guide on forms, styling, colors or RTL as is. Type
/in chat for the server's seven prompts, from add and form to page and design.Add it from a shell
code --add-mcpwrites the server to your user configuration, for every folder you open. Use the MCP URL from your dashboard: it carries the token as?token=, so no header is needed.$ code --add-mcp '{"name":"shadcnio","type":"http","url":"YOUR_MCP_URL"}'
When shadcnio won't start or answer
What VS Code shows, and the fix. The troubleshooting guide has the rest, for every client.
shadcnionever starts in a repository you just cloned.- The folder opened in Restricted Mode, and workspace servers follow Workspace Trust. Review the repository, run Workspaces: Manage Workspace Trust to trust it, then start
shadcniofrom MCP: List Servers. - Show Output for
shadcniologs a 401. - The token in
.vscode/mcp.jsonis missing or out of date, usually after you regenerated it. Copy the config from this page again, replace theAuthorizationline, and restart the server from the actions above its entry. - Calls come back with a 403.
- VS Code reached the server and the token was accepted, but the shadcn.io account behind it has let Pro lapse. Renew it on pricing: the same
.vscode/mcp.jsonworks again with nothing to edit. - The shared file's server is missing from a Copilot session.
- Servers that need an input aren't forwarded to Copilot harness sessions. The harness name sits before the chat title: start a Local session for this file, or keep a personal copy without the input in your user configuration.
- On a work account, no MCP server shows up in chat.
- Copilot Business and Enterprise keep MCP off until an admin enables the MCP servers in Copilot policy, and an MCP allowlist can block servers that aren't on it. Local settings can't override either, so ask your admin.
shadcniois running, but Copilot answers from memory.- Check Agent is picked, then run Developer: Show Chat Debug View and look for the
shadcniotools among the tool definitions. Present: name the server and the tool in your prompt. Absent: tick them in the tool list.
Get the MCP for VS 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 VS Code: setup, limits, and the rest.
The workspace file .vscode/mcp.json reaches one folder. Your user mcp.json, opened with MCP: Open User Configuration, reaches every folder and syncs. The Copilot Global file ~/.copilot/mcp-config.json is shared with Copilot CLI, and a remote host has its own user file. For one project, the workspace file is the simplest.
Yes. The code command takes --add-mcp with a JSON object holding name, type http and your MCP URL. It writes the server to your user configuration, so every folder you open has it. Use the URL from your dashboard, which carries the token as ?token=, so no header is needed.
Yes. shadcnio is an HTTP server, so where its config lives only decides which windows see it, not where it runs. A workspace .vscode/mcp.json travels with the remote folder, MCP: Open Remote User Configuration covers every folder on that host. Keep any token out of files you commit.
Only from your user configuration: the user mcp.json is the one that reaches Settings Sync, while a workspace file stays with its folder. The token travels with a synced entry, so treat your synced profile like anywhere else that holds a key.
Yes. shadcnio answers for the framework in your package.json. For Vue, Svelte and Solid, get_install_plan returns every file with its path plus the packages, which Copilot writes in the editor and installs from the terminal once you allow it.
Every shadcnio tool is marked read-only, so VS Code runs them without a confirmation; if your session asks anyway, run Chat: Manage Tool Approval and tick the server's top-level box. The install is a terminal command, which asks first. A rule in chat.tools.terminal.autoApprove can let the shadcn CLI through while other commands still ask.
A chat request takes at most 128 tools, and shadcnio brings 22 of them. With many servers installed, untick what a task doesn't need: Chat: Open Customizations, then Tools in Copilot sessions, or Configure Tools in Local ones.
On Copilot Business and Copilot Enterprise, an admin has to turn on the MCP servers in Copilot policy, which is off by default, and an MCP allowlist can block servers that aren't on it. Separately, the server needs Pro on the shadcn.io account whose token you use.
Each token gets 600 requests a minute, well beyond what one session usually makes. Past that, the server replies 429 with a Retry-After header, and calls succeed again once it passes. Ask Copilot to run whoami to see how many calls are left this minute.
Commit .vscode/mcp.json with an input reference where the token was. The first time the server starts, VS Code asks each teammate for theirs, which is what follows ?token= in their MCP URL, and stores it securely, never in the file. Each token only answers while its account has Pro, so a Team or Organization plan that covers every seat is the simple way to give it.
Servers that need an input aren't forwarded to Copilot harness sessions, the default since VS Code 1.143. Start a Local session for UI work, or keep a personal copy without the input in your user configuration.
It sits in the file as plain text, and plenty of repositories commit the .vscode folder, so add .vscode/mcp.json to .gitignore or keep the server in your user configuration. The team version holds no token at all: VS Code asks each person for theirs and stores it securely. A leaked token is fixed by regenerating it on your account page, which cuts off the old one.
It receives the tool calls and nothing else: which tool Copilot called, and with what, like a component name or a framework. The workspace itself never leaves your machine, and each tool is read-only. Installs are commands VS Code runs locally, behind its own approvals.
The folder opened in Restricted Mode, and workspace servers follow Workspace Trust. Review the repository, run Workspaces: Manage Workspace Trust to trust it, then start shadcnio from MCP: List Servers.
A 401 in Show Output means the token in .vscode/mcp.json is missing or old, usually after a regenerate: copy the config again. A 403 means the account has no active Pro, and the same file works once it is renewed. A 429 means you went past the limit of 600 calls a minute for one token, and Retry-After tells you when to try again.
Using another agent too?
The same URL works in every MCP client: use it beside VS Code, in your editor, your terminal or your chat app.
4.9 out of 5 from 150+ developers
Give Copilot in VS Code the registry
One file gives Copilot every component on four frameworks, plus 6,231 blocks and 294k icons, with any Pro plan.
Get Pro