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
- Its docs
- Zed MCP (opens in a new tab)
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.
Copy the entry
It starts
mcp-remotewithnpx: 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.Open your settings file
Run
zed: open settings filefrom the command palette (cmd-alt-,on macOS,ctrl-alt-,on Linux). The file takes//comments, so a note beside the entry is fine.Paste it under context_servers
If the file already has a
context_serversobject, putshadcnioinside it instead of adding a second one. Save: Zed starts the server, and the first start downloadsmcp-remote, so give it a few seconds.Look for the green dot
Run
agent: open settingsand open MCP Servers:shadcniogets a green dot whose tooltip reads Server is active. It needs Node.js fornpx; an error under its row says what went wrong.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.
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.
| Scope | File | Who gets it |
|---|---|---|
| User, macOS and Linux | ~/.config/zed/settings.json | You, in every project |
| User, Windows | %APPDATA%\Zed\settings.json | You, in every project |
| Project | .zed/settings.json at the root | Everyone 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.
{ "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.
- Run
agent: open settingsand open MCP Servers:shadcniohas a green dot. - Run
agent: manage profiles, pick Write, then Configure MCP Tools: 22 tools sit undershadcnio. - 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.
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.
- shadcn.io MCP connected · 22 tools
Agent step: Read package.jsonReturns: React 19, @base-ui/react, a pnpm lockfileMCP call: search_components({ query: "searchable select" })Returns: combobox first, then select and commandMCP call: get_component({ name: "combobox", include: ["install", "usage"], packageManager: "pnpm" })Returns: Its pnpm dlx shadcn add command, and how Input, Content and List nestAgent step: Ran pnpm dlx shadcn add (allowed on its terminal card)Returns: combobox, button and input-group in components/ui
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.
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,/designand/setupare 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 onshadcniounder 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.rulesand.cursorrulesand includesAGENTS.mdandCLAUDE.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
urland the token inheaders. 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_serversto External Agents such as Claude Agent and Codex over ACP. Ifshadcniois 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
shadcnioright after you save. - Zed couldn't start
npx. Install Node.js, quit and reopen Zed so it reads your shell'sPATHagain, and savesettings.jsononce more.zed: open logshows the line whereshadcniofailed to start. - A tool call fails with 401, or
shadcnioerrors 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_TOKENset. - 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 runworkspace: 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-ion macOS), or turnshadcnioon 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.
The entry starts mcp-remote, a small npm package that runs on your machine, speaks stdio to Zed and HTTPS to your MCP URL. It only needs Node.js. Zed can also connect to a remote server itself, with a url and an Authorization header, which needs no Node at all.
Run zed: open settings file. It is ~/.config/zed/settings.json on macOS and Linux, and %APPDATA%\Zed\settings.json on Windows. Put shadcnio inside the context_servers object, save, and check for a green dot under MCP Servers in the agent settings.
Yes: put the same entry in .zed/settings.json at the project's root, which zed: open project settings creates for you. Zed only starts servers from a project file once you trust the folder.
Yes, until you say otherwise: Zed asks before tool actions by default. Choose Always for the tool on its card, or allow the shadcnio tools you use in settings. They all only read the registry, and the terminal commands the agent runs afterwards still ask.
The built-in Ask profile leaves context servers off, and Minimal has no tools at all. Switch the thread to Write, Zed's default, or fork Ask in agent: manage profiles and turn shadcnio on under Configure MCP Tools to plan a page without edits.
Type a slash 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.
An @-mentioned docs URL is one page of prose, for one component, usually in React, and it fills the thread. The MCP answers for your framework and base, hands back the install command, and also reaches 6,231 blocks and 294k icons in a few short calls.
No. Context servers are part of the editor itself, so the agent calls shadcnio the same way whichever model runs it. What the MCP needs is a shadcn.io Pro plan, which is a separate thing.
Yes, if the model can call tools. Zed shows a warning icon by the model selector when a model can't use some of a server's tools. The registry itself is online, so the machine still needs a connection.
Zed may forward the servers in context_servers to an External Agent over ACP, and those agents can also read their own MCP config. If the tools don't show up in a Claude Agent or Codex thread, add shadcnio in that agent's own config.
Commit .zed/settings.json with the token replaced by an environment variable, and have each teammate export it in their shell profile, which Zed reads when it launches. On a Team or Organization plan every seat has Pro, so each person exports a token of their own.
Zed opens a fresh clone in Restricted Mode and ignores its .zed/settings.json. They click the exclamation mark in the title bar, or run workspace: toggle worktree security, and trust the folder once.
In your user settings.json, in plain text, inside the URL the entry passes to mcp-remote. No repository holds that file, but while the server runs the URL is on mcp-remote's command line, where other processes on your machine can read it. A remote entry with the token in a header avoids that; if it leaks, regenerate it on your account page.
Only the tool calls: their names and inputs, such as a component name or a search for a date picker. Your files and the buffers open in Zed stay on your machine, and no tool writes anything there.
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. The command zed: open log shows the line where shadcnio failed to start.
A 401 means the entry's token is old or missing, often after a regenerate; with a shared file, check Zed launched with the variable set. A 403 means no active Pro on the account behind it. A 429 means the token used up its 600 calls for the minute; give it the time Retry-After states.
Using another agent too?
The same URL works in every MCP client: use it beside Zed, in your editor, your terminal or your chat app.
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