shadcn/ui in Google's Gemini CLI
Add an httpUrl entry to ~/.gemini/settings.json and Gemini CLI can look up components, blocks and icons for your framework, then install them from your terminal. It needs shadcn.io Pro.
- Kind
- Terminal agent
- Goes in
~/.gemini/settings.json- Connects
- Over HTTP
- Team config
- No
Put shadcnio in ~/.gemini/settings.json
Gemini CLI keeps its servers in the mcpServers object of its settings file and reads it when a session starts. Signed in with Pro, the entry beside these steps already has your token in its URL.
Copy the entry
Signed in with Pro, you'll find your token at the end of its
httpUrl. If you don't have a token yet, make one on your account page first.Merge it into your user settings
Open
~/.gemini/settings.jsonand addshadcnioinsidemcpServers, next to any servers already there. KeephttpUrland theAcceptheader exactly as copied.Or add it with gemini mcp add
gemini mcp add --scope user --transport http shadcnio "<your URL>" --header "Accept: application/json, text/event-stream"adds the same server from a shell. Leave out--scope userand it lands in the current folder's.gemini/settings.json, token and all.Start a new session
The settings file is only read at startup, so leave with
/quitand rungeminiagain. Then/mcpshows whethershadcniois ready.
How it reads, with YOUR_TOKEN where your token goes:
{ "mcpServers": { "shadcnio": { "headers": { "Accept": "application/json, text/event-stream" }, "httpUrl": "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN" } } }
It sits in ~/.gemini/settings.json, in your home folder and outside every repo. The URL carries your token in plain text: regenerate it if the file is ever shared.
| Settings file | How it gets there | Who it reaches |
|---|---|---|
~/.gemini/settings.json | Pasted in, or gemini mcp add --scope user | You, in every folder |
.gemini/settings.json in a repo | gemini mcp add with no scope, its default | Anyone who runs gemini there, with your token |
/etc/gemini-cli/settings.json (Linux) | An admin | Every account on the machine; it wins over the others |
Check that shadcnio is Ready
/mcp in a session lists each server with its status: a connected one reads Ready, followed by its tool, prompt and resource counts. gemini mcp list runs the same check from a shell.
- Start
geminiin a project and run/mcp:shadcnioshould be marked Ready, with 22 tools and 7 prompts. - From a shell,
gemini mcp listshould print✓ shadcnio: … (http) - Connected. - Ask the prompt below and pick Allow once: Gemini CLI runs
whoamiand replies with your email, your plan and the calls left this minute.
What a Gemini CLI session looks like
Each tab follows one request: the prompt, what Gemini CLI reads and calls, the confirmations it asks for, and what it changed. Switch the MCP off and the same request is answered from the model's memory.
- shadcn.io MCP connected · 22 tools
Agent step: ReadFile mockups/weekly.pngReturns: Four figures, each with a weekly change and a small chartMCP call: search_blocks({ query: "four kpis with weekly change and area chart", category: "stats" })Returns: stats-connected-kpi-bar-with-trends, then two near variantsMCP call: get_block({ name: "stats-connected-kpi-bar-with-trends", include: ["install", "preview"] })Returns: An npx shadcn add command and a preview linkAgent step: Shell npx shadcn add (Allow once)Returns: The block, with Sliding Number and Guides
In your project
KPI bar with trends
- Four cells across, laid out like the mockup
- Fed by your weekly totals, not sample data
1 prompt → 2 MCP calls
Prompts for your next session
Paste one into gemini. Each starts by naming the server, so the model calls shadcnio rather than writing UI from what it remembers.
Gemini CLI features worth knowing
Approvals, the server's prompts and resources, GEMINI.md and headless runs: the parts of Gemini CLI that change how shadcnio behaves.
Trust the server, not each call
The 22 tools only look things up, so
"trust": trueon theshadcnioentry is a safe way to skip the confirmation. The commands they hand back, such asnpx shadcn add, still go through Shell and ask as usual."shadcnio": { "httpUrl": "…", "trust": true }
Server prompts as slash commands
Gemini CLI turns the server's seven prompts into commands:
/page,/block,/add,/form,/icons,/setupand/design. Pass their arguments by name or in order./form --fields="name, email and a plan picker" --library="react-hook-form"
A brand's DESIGN.md through @
Type
@and the completion menu shows the server's resources beside your files: each brand's DESIGN.md and each guide. Gemini CLI reads the one you pick into the message before it goes out.restyle the pricing page after @shadcnio://design/vercel
One line in GEMINI.md
Gemini CLI loads
GEMINI.mdinto every session, so one line there saves you naming the server each time. After you edit it,/memory refreshreloads it without a restart.When you build UI, search the shadcnio MCP first and install with the command it returns, not from memory.
Scripts and CI with gemini -p
A headless run can't stop to ask, so any call that needs a confirmation is refused. Allow the server with a policy file in
~/.gemini/policies/, then pass your prompt togemini -p.[[rule]] mcpName = "shadcnio" decision = "allow" priority = 200
Reconnect without quitting
If
shadcniodropped, after a network change or once you've renewed Pro,/mcp reloadreloads every server and fetches its tools again. Run/mcpafterwards to see it back at Ready./mcp reload
When shadcnio won't connect
What /mcp and gemini mcp list show when something is off, and the change that fixes it. The troubleshooting guide covers the server's side.
/mcpshows shadcnio as Disconnected and says itrequires authentication using: /mcp auth shadcnio.- That is a 401: the token in
httpUrlis missing, cut short or regenerated. shadcn.io has no OAuth, so/mcp authcan't help: copy the entry again, replace the old one, then/quitand startgeminiagain. - Calls reach shadcnio and come back with a 403.
- The server knows the token, but the account behind it has no active Pro plan. Renew it and the same entry works again.
gemini mcp listshowsshadcnio: … (sse) - Disconnected.- The entry is being read as SSE: a bare
urlin an older release, or"type": "sse". Switch tohttpUrl, or paste the entry from this page again. - shadcnio works in one repo and is missing from every other.
gemini mcp adddefaults to project scope, so it wrote.gemini/settings.jsonin that folder, with your token in it. Rungemini mcp remove shadcniothere, then add it again with--scope user.gemini mcp listshows shadcnio as Disabled, under a warning that the folder is untrusted.- With folder trust on, an untrusted folder gets no MCP servers, your user ones included. Run
/permissionsin a session and trust the folder or its parent. - A
gemini -prun answers without calling shadcnio. - Headless runs refuse any call that would wait for a confirmation. Add an allow rule with
mcpName = "shadcnio"to a file in~/.gemini/policies/, then run it again.
Get the MCP for Gemini 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 Gemini CLI: setup, limits, and the rest.
httpUrl tells Gemini CLI to talk Streamable HTTP, the transport the shadcn.io server uses, and old and new releases read it the same way. Older releases took a bare url as an SSE address, so an entry copied from another client may never connect. Recent releases also accept url with "type": "http", which is what gemini mcp add --transport http writes.
Leave it as copied. It tells the server that Gemini CLI can take either kind of answer it sends back: a single JSON reply or an event stream.
Your user settings, ~/.gemini/settings.json, so it works in every folder and the token stays out of your repositories. A project's .gemini/settings.json only applies in that folder and is easy to commit by mistake. Keep in mind that gemini mcp add writes to the project file unless you pass --scope user.
No. Settings are read when a session starts, so the one you have open won't see the new entry. Type /quit, run gemini again, and /mcp should list shadcnio as Ready.
By default, yes: the first call shows "Allow execution of MCP tool … from server shadcnio?". Pick Allow all server tools for this session, or add "trust": true to the entry to stop the question for good. The tools only read the registry, and the install commands they return still go through the Shell tool's own confirmation.
Each of the server's seven prompts turns into a slash command, from /add and /block to /page, /form, /icons, /setup and /design. Arguments go in by name or in order, so /page --brief="landing page for a habit tracker" plans a page from blocks. /mcp lists them under Prompts.
Yes. Type @ and the completion menu lists the server's resources next to your files, for example shadcnio://design/stripe. The one you pick is read into the message when you send it, so the model works from that brand's tokens and not from memory.
The model decides when to call a tool, and a vague request looks answerable without one. Name the server, say which component or page you mean, and put a line in GEMINI.md so every session starts with the rule. Check /mcp as well: a server that is still starting has no tools to offer yet.
It reads your package.json first. React gets one shadcn add command to run in the shell. Vue, Svelte and Solid get get_install_plan: every file with its path and the packages to add, which Gemini CLI writes with WriteFile and installs through Shell, asking you first as it normally does.
Yes, wherever Gemini CLI still answers you. Since June 18, 2026 it serves paid Gemini API keys, Gemini Enterprise Agent Platform keys and Gemini Code Assist Standard or Enterprise licenses, but no longer free personal accounts or Google AI Pro and Ultra. If you moved to Antigravity CLI, set shadcnio up there instead: its own page on this site has the steps.
No, they are separate. Google AI Pro is Google's subscription. shadcn.io Pro is the plan behind the token in your shadcnio URL, and it is the only plan the server checks, whichever way Gemini CLI signs in to Google.
Not as it is. Antigravity reads its servers from ~/.gemini/config/mcp_config.json rather than from Gemini CLI's settings.json, so add shadcnio there once and its app, IDE and CLI all see it. Your token works in both.
It is stored as plain text in your home folder, like other CLI credentials, and ~/.gemini/settings.json sits outside your repositories. Watch for output that repeats it: gemini mcp list prints the whole URL, token included. If it leaks, regenerate it from your account page and paste the new URL in.
Only each call: the tool's name and its inputs, such as a component name, a framework or a search phrase. Gemini CLI reads your files on your own machine and never sends them to the server. Every shadcnio tool looks things up in the registry, and none of them changes your project.
That is how it reports a 401: the server turned the token down. shadcn.io has no OAuth sign-in, so /mcp auth won't fix it. The token in httpUrl is missing, cut short or was regenerated: copy the entry from this page again, replace the old one and start a new session.
The token is valid, but the shadcn.io account it belongs to has no active Pro plan. Renew it and the next call goes through; nothing in settings.json has to change.
Either it was switched off with /mcp disable shadcnio, which /mcp enable shadcnio undoes, or folder trust is on and this folder isn't trusted. In an untrusted folder Gemini CLI starts no MCP servers at all, even the ones in your user settings: run /permissions in a session and trust it.
In headless mode there is nobody to answer a confirmation, so a call that would ask is refused. Allow the server before the run, with a rule in ~/.gemini/policies/ that sets mcpName = "shadcnio" and decision = "allow", or with "trust": true on its entry.
Using another agent too?
The same URL works in every MCP client: use it beside Gemini CLI, in your editor, your terminal or your chat app.
4.9 out of 5 from 150+ developers
Give Gemini CLI the real registry
Components for React, Vue, Svelte and Solid, 6,231 blocks and 294k icons, ready in your next Gemini CLI session with shadcn.io Pro.
Get Pro