Skip to content

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

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.

  1. Copy the config, or click Add to VS Code

    With Pro, the file carries your token in an Authorization header. 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.

  2. Save it as .vscode/mcp.json

    Put it at the root of the folder you open, under .vscode. VS Code gives IntelliSense for the servers format while you paste, so a missing comma shows up at once.

  3. Trust the folder

    Workspace servers follow Workspace Trust: in a trusted folder, shadcnio starts without a separate prompt; in Restricted Mode, it doesn't start at all.

  4. Ask Copilot for a component

    In the Chat view, pick Agent and name the server (use shadcnio…). Sending the message starts shadcnio and loads its 22 tools.

.vscode/mcp.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:

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

Where VS Code reads it from
FileOpen it withWho it reaches
.vscode/mcp.json (this config)MCP: Open Workspace Folder MCP ConfigurationThis folder, in Local and Copilot sessions
Your user mcp.jsonMCP: Open User ConfigurationEvery folder you open, and Settings Sync
~/.copilot/mcp-config.jsonMCP: Add Server, then Global and Copilot GlobalVS Code and Copilot CLI, keyed mcpServers
The remote host's mcp.jsonMCP: Open Remote User ConfigurationEach 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.

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

  1. Open the Command Palette (⇧⌘P, or Ctrl+Shift+P on Windows and Linux) and run MCP: List Servers: shadcnio should be running.
  2. If it isn't, select it and choose Show Output: the server's log names the error, a 401 or 403 included.
  3. In the Chat view, pick Agent, send the prompt below and expand the tool call: it's whoami from shadcnio, with your account and the calls left this minute.
Prompt
use the shadcnio whoami tool and tell me which account this workspace is signed in as

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.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Make the orders table in this file sortable, 20 rows per page.
  3. Agent step: Read app/orders/page.tsx (attached with #file)Returns: A plain table mapped over orders
  4. MCP call: search_blocks({ query: "sortable table with pagination", category: "tables" })Returns: tables-sortable, then tables-pagination
  5. MCP call: get_block({ name: "tables-sortable", include: ["install", "source"] })Returns: Its install command, and the code to adapt
  6. Agent step: Ran npx shadcn@latest add (you selected Allow)Returns: The block and the components it uses
  7. Your agent: The orders table now sorts from every header and shows 20 rows per page, using the columns you already had.

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.

01
use shadcnio to turn the selected markup into a Card with a header, body and footer
02
use shadcnio to show a toast in the open file when the settings form saves
03
use shadcnio to plan a landing page for a developer tool, then install the blocks it picks
04
use shadcnio to look up the props Popover's Content accepts before you touch this component
05
use shadcnio to replace every icon in the open file with its Tabler equivalent
06
use shadcnio to restyle this app after Vercel's DESIGN.md and save that file at the root
07
use shadcnio to get this SvelteKit project ready for its components, then render a button to prove it
08
use shadcnio to find an empty state for the invoices list and drop it in where the list is empty

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 shadcnio tool 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.autoApprove lets 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/instructions with an applyTo glob 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 shadcnio brings 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-mcp writes 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.

shadcnio never 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 shadcnio from MCP: List Servers.
Show Output for shadcnio logs a 401.
The token in .vscode/mcp.json is missing or out of date, usually after you regenerated it. Copy the config from this page again, replace the Authorization line, 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.json works 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.
shadcnio is running, but Copilot answers from memory.
Check Agent is picked, then run Developer: Show Chat Debug View and look for the shadcnio tools 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.

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