Skip to content

shadcn/ui in Zed's Agent Panel

Add a context_servers entry and Zed's agent can find components, blocks and icons for your framework and install them in the open project. It's included with Pro.

Kind
Editor
Goes in
~/.config/zed/settings.json
Connects
Through mcp-remote
Team config
Yes

Add it to settings.json

One entry under context_servers in your user settings, and the Zed Agent has the registry in every project. Signed in with Pro, the entry beside the steps already holds your URL.

  1. Copy the entry

    It starts mcp-remote with npx: a small bridge from npm that carries Zed's local connection to your MCP URL, token included. No token yet? Create one on your account.

  2. Open your settings file

    Run zed: open settings file from the command palette (cmd-alt-, on macOS, ctrl-alt-, on Linux). The file takes // comments, so a note beside the entry is fine.

  3. Paste it under context_servers

    If the file already has a context_servers object, put shadcnio inside it instead of adding a second one. Save: Zed starts the server, and the first start downloads mcp-remote, so give it a few seconds.

  4. Look for the green dot

    Run agent: open settings and open MCP Servers: shadcnio gets a green dot whose tooltip reads Server is active. It needs Node.js for npx; an error under its row says what went wrong.

  5. Ask in the Agent Panel

    Start a thread in the Write profile, Zed's default, and begin with use shadcnio… the first few times so the agent picks its tools.

~/.config/zed/settings.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:

{
  "context_servers": {
    "shadcnio": {
      "args": [
        "-y",
        "mcp-remote",
        "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN"
      ],
      "command": "npx",
      "source": "custom"
    }
  }
}

Zed reads it from your user settings.json, outside every repo. The switch beside shadcnio on the MCP Servers page turns it off without deleting the entry; if the URL's token leaks, regenerate it.

Where Zed reads it from
ScopeFileWho gets it
User, macOS and Linux~/.config/zed/settings.jsonYou, in every project
User, Windows%APPDATA%\Zed\settings.jsonYou, in every project
Project.zed/settings.json at the rootEveryone who opens the repo, once they trust it

Commit it in .zed/settings.json

Commit .zed/settings.json with the entry below: it holds ${SHADCNIO_TOKEN} where the token goes, and each teammate exports that variable in their shell profile, which Zed reads when it launches. Zed opens a fresh clone in Restricted Mode, so each person trusts the folder once before its servers start. Seats on a shadcn.io Team or Organization plan each come with Pro, so every teammate exports a token of their own.

.zed/settings.json
{
  "context_servers": {
    "shadcnio": {
      "args": [
        "-y",
        "mcp-remote",
        "https://www.shadcn.io/api/mcp?token=${SHADCNIO_TOKEN}"
      ],
      "command": "npx",
      "source": "custom"
    }
  }
}

Each teammate sets SHADCNIO_TOKEN to their own token (from their MCP URL), so no token is committed.

Check it's running

Zed lists every context server under Settings → AI → MCP Servers, each with a status dot: green, with the tooltip Server is active, means shadcnio is running.

  1. Run agent: open settings and open MCP Servers: shadcnio has a green dot.
  2. Run agent: manage profiles, pick Write, then Configure MCP Tools: 22 tools sit under shadcnio.
  3. In a new thread, ask the prompt below. Zed shows a card for whoami, waits for Allow, then answers with your account and the calls left this minute.
Prompt
use shadcnio to check my account and how many calls I have left

What it looks like in Zed

Three jobs from inside the editor: the prompt, the calls the Zed Agent makes, and what lands in Review Changes. Turn the MCP off and the same thread runs on the model's memory, so its guesses are what lands in the diff.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Make the selected country dropdown a searchable combobox.
  3. Agent step: Read package.jsonReturns: React 19, @base-ui/react, a pnpm lockfile
  4. MCP call: search_components({ query: "searchable select" })Returns: combobox first, then select and command
  5. MCP call: get_component({ name: "combobox", include: ["install", "usage"], packageManager: "pnpm" })Returns: Its pnpm dlx shadcn add command, and how Input, Content and List nest
  6. Agent step: Ran pnpm dlx shadcn add (allowed on its terminal card)Returns: combobox, button and input-group in components/ui
  7. Your agent: The country field in checkout-form.tsx is a Combobox now, filtered as you type; the diff is in Review Changes.

In your project

Combobox

  • Typing filters the countries
  • Same field name, same form value

1 prompt → 2 MCP calls

Prompts for the Agent Panel

Each names the server, so the Zed Agent reaches for its tools over its training. Select code first, or @-mention a file, to aim it.

01
use shadcnio to add a resizable split between the file list and the preview in this layout
02
use shadcnio to replace the toasts in @notify.ts with Sonner
03
use shadcnio to plan a changelog page from blocks, then add it at app/changelog
04
use shadcnio to show an empty state on the projects page when there are no projects yet
05
use shadcnio to add a Kbd shortcut hint to every item in this menu
06
use shadcnio to theme this SvelteKit app after Vercel's DESIGN.md
07
use shadcnio to set up this Vue project for shadcn components
08
use shadcnio to show me Tree View's props before you build the docs sidebar

Good to know in Zed

The parts of Zed that change how the MCP behaves: permissions, profiles, slash commands and instructions.

  • Stop the approval cards

    Zed asks before tool actions by default, MCP calls included. Pick Always for the tool on its card, or allow the read-only tools you lean on by their mcp:shadcnio:<tool> keys; terminal commands keep asking.

    {
      "agent": {
        "tool_permissions": {
          "tools": {
            "mcp:shadcnio:search_components": { "default": "allow" },
            "mcp:shadcnio:get_component": { "default": "allow" },
            "mcp:shadcnio:get_icon": { "default": "allow" }
          }
        }
      }
    }
  • Four prompts as slash commands

    Type / in the message editor: /page, /icons, /design and /setup are the server's prompts, and the words after one are its argument. Zed lists only prompts with one argument or none, so ask for the others in words.

    /page a landing page for a form builder
  • Plan in Ask, with the registry

    The built-in Ask profile leaves context servers off, and Minimal has no tools at all. Run agent: manage profiles, fork Ask, and turn on shadcnio under Configure MCP Tools to plan a page without edits.

  • One line in AGENTS.md

    The Zed Agent reads ~/.config/zed/AGENTS.md (macOS, Linux) in every project, and in a repo only the first file it finds from a list that starts with .rules and .cursorrules and includes AGENTS.md and CLAUDE.md. Put the line in the one your repo already uses.

    For UI, call the shadcnio MCP before writing a component, and install with the command it returns.
  • Or skip Node with a remote entry

    Zed connects to remote servers itself: give the entry a url and the token in headers. No Node.js, and the token stays off any command line. Use your MCP URL without ?token=; a wrong token then shows as a 401 under the server's row.

    "shadcnio": {
      "url": "…/api/mcp",
      "headers": { "Authorization": "Bearer YOUR_TOKEN" }
    }
  • External Agents get it too

    Zed may forward context_servers to External Agents such as Claude Agent and Codex over ACP. If shadcnio is missing in one, add it in that agent's own config: Claude Code, Codex.

When shadcnio won't answer

What Zed shows when shadcnio misbehaves, and how to fix it. The troubleshooting guide covers the server itself.

An error shows under shadcnio right after you save.
Zed couldn't start npx. Install Node.js, quit and reopen Zed so it reads your shell's PATH again, and save settings.json once more. zed: open log shows the line where shadcnio failed to start.
A tool call fails with 401, or shadcnio errors after a new token.
The token in the entry is old or missing: after a regenerate, your settings still hold the previous one. Copy the entry from this page again, replace yours and save. With a shared file, check that Zed launched with SHADCNIO_TOKEN set.
Tool calls come back with a 403.
The server accepted the token but found no active Pro plan on its shadcn.io account. Renew the plan and the same entry works again: nothing in Zed to change.
A teammate's project server never appears.
The folder is in Restricted Mode, so Zed ignores its .zed/settings.json. Click the exclamation mark in the title bar, or run workspace: toggle worktree security, and trust it.
The agent says it has no shadcnio tools.
The thread is in the Ask or Minimal profile, which leave MCP tools off. Switch to Write from the profile selector (cmd-i on macOS), or turn shadcnio on for that profile.
The agent answers from memory instead of calling shadcnio.
Check the model first: a warning icon by the model selector means it can't use some of the server's tools. Then name the server in the prompt, or add the line to AGENTS.md.

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

4.9 out of 5 from 150+ developers

Put the registry in Zed's agent

Search, read and install from the whole registry without leaving the file you're editing, with any Pro plan.

Get Pro