Skip to content

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.

  1. 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.

  2. Merge it into your user settings

    Open ~/.gemini/settings.json and add shadcnio inside mcpServers, next to any servers already there. Keep httpUrl and the Accept header exactly as copied.

  3. 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 user and it lands in the current folder's .gemini/settings.json, token and all.

  4. Start a new session

    The settings file is only read at startup, so leave with /quit and run gemini again. Then /mcp shows whether shadcnio is ready.

~/.gemini/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:

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

Where Gemini CLI looks for shadcnio
Settings fileHow it gets thereWho it reaches
~/.gemini/settings.jsonPasted in, or gemini mcp add --scope userYou, in every folder
.gemini/settings.json in a repogemini mcp add with no scope, its defaultAnyone who runs gemini there, with your token
/etc/gemini-cli/settings.json (Linux)An adminEvery 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.

  1. Start gemini in a project and run /mcp: shadcnio should be marked Ready, with 22 tools and 7 prompts.
  2. From a shell, gemini mcp list should print ✓ shadcnio: … (http) - Connected.
  3. Ask the prompt below and pick Allow once: Gemini CLI runs whoami and replies with your email, your plan and the calls left this minute.
Prompt
use shadcnio to check which account and plan my token is on

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.

Your agent
  1. shadcn.io MCP connected · 22 tools
  2. You: Build the KPI row in @mockups/weekly.png at the top of the store dashboard.
  3. Agent step: ReadFile mockups/weekly.pngReturns: Four figures, each with a weekly change and a small chart
  4. MCP call: search_blocks({ query: "four kpis with weekly change and area chart", category: "stats" })Returns: stats-connected-kpi-bar-with-trends, then two near variants
  5. MCP call: get_block({ name: "stats-connected-kpi-bar-with-trends", include: ["install", "preview"] })Returns: An npx shadcn add command and a preview link
  6. Agent step: Shell npx shadcn add (Allow once)Returns: The block, with Sliding Number and Guides
  7. Your agent: The dashboard now opens on the KPI bar, each cell reading from your weekly totals with its change on the week before.

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.

01
use shadcnio to build the screen in @mockups/settings.png from components we already have in components/ui
02
use shadcnio to turn the three onboarding pages into one stepper with Back and Next buttons
03
use shadcnio to compare the Combobox and Autocomplete APIs and pick one for the city field
04
use shadcnio to swap every hand-drawn SVG in src/components for icons from the set in package.json
05
use shadcnio to restyle the dashboard after Vercel's DESIGN.md, in light and dark mode
06
use shadcnio to set up this SolidStart app for shadcn components, then add a date picker to the booking page
07
use shadcnio to plan a docs landing page for our CLI and install every block it picks in one command

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": true on the shadcnio entry is a safe way to skip the confirmation. The commands they hand back, such as npx 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, /setup and /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.md into every session, so one line there saves you naming the server each time. After you edit it, /memory refresh reloads 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 to gemini -p.

    [[rule]]
    mcpName = "shadcnio"
    decision = "allow"
    priority = 200
  • Reconnect without quitting

    If shadcnio dropped, after a network change or once you've renewed Pro, /mcp reload reloads every server and fetches its tools again. Run /mcp afterwards 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.

/mcp shows shadcnio as Disconnected and says it requires authentication using: /mcp auth shadcnio.
That is a 401: the token in httpUrl is missing, cut short or regenerated. shadcn.io has no OAuth, so /mcp auth can't help: copy the entry again, replace the old one, then /quit and start gemini again.
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 list shows shadcnio: … (sse) - Disconnected.
The entry is being read as SSE: a bare url in an older release, or "type": "sse". Switch to httpUrl, or paste the entry from this page again.
shadcnio works in one repo and is missing from every other.
gemini mcp add defaults to project scope, so it wrote .gemini/settings.json in that folder, with your token in it. Run gemini mcp remove shadcnio there, then add it again with --scope user.
gemini mcp list shows 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 /permissions in a session and trust the folder or its parent.
A gemini -p run 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.

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