Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

MCP

Pi

Add the shadcn MCP server to Pi with a single terminal command. Signed in, the command on this page already holds your URL.

Kind
Terminal agent
Goes in
Terminal
Connects
Over HTTP
Team config
Yes

Install

Terminal
Sign in to get your config
Sign in with a Pro account, and this holds your MCP URL, ready to paste.

Run it in a terminal. Pi has MCP built in from version 0.99.0: run pi update first if pi mcp isn't there.

The command saves the server to ~/.pi/agent/mcp.json, for every project. --exposure direct gives the model the tools at once, without a lookup first. Add --local to save it to the project's .pi/mcp.json instead, for a project you trust.

Keep the token out of the config

Pi can read the token from an environment variable and send it as a header, so the saved config holds only the endpoint:

Terminal
pi mcp add shadcnio --url "https://kit.dev/api/mcp" --bearer-token-env-var SHADCNIO_TOKEN --exposure direct

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

Export SHADCNIO_TOKEN in your shell before starting Pi.

Check it

Run pi mcp list: you want shadcnio listed. In a session that was already open, run /reload, then /mcp to see its tools. Then ask:

Prompt
use shadcnio to tell me who I'm connected as

Pi calls whoami and answers with your account and how many calls you have left this minute.

Your first component

Prompt
use shadcnio to add a combobox to the country field

What Pi does, in order:

  1. search_components({ query: "combobox" }) finds combobox.
  2. get_component({ name: "combobox" }) reads its parts, demos and dependencies, for your framework and base (from your package.json: Base UI unless the project uses Ark UI, Radix or React Aria).
  3. get_install_command({ name: "combobox" }) returns npx shadcn@latest add "…/r/combobox.json?token=…", your token in the URL, and Pi runs it in your shell.
  4. get_demo gives it a working example to adapt to your field.

In a Vue, Svelte or Solid project, step 3 is get_install_plan: every file with its path and the packages to install, which Pi writes itself.

Name the server (use shadcnio…) when several MCP servers are configured, or Pi may answer from memory instead.

Manage the connection

CommandWhat it does
pi mcp listEvery configured server and its status
/reloadReloads the servers in an open session
/mcpThe servers and their tools, in a session

To change the URL after you regenerate your token, run the install command again with your new URL.

FAQ

pi mcp isn't a command

MCP is built into Pi from version 0.99.0. Run pi update, then the install command again.

The tools don't show in my session

A session reads its servers when it starts: run /reload in it, or start a new one. Without --exposure direct, the model looks the tools up when it needs them, so name the server in your prompt.

Why is it still giving generic answers?

Name the server in your prompt, check /mcp lists shadcnio, and be specific: a component's name, your framework, or a category. Vague prompts fall back on what the model remembers.

Next

Other clients