Make your AI a shadcn expert

get_install_command

Build a ready-to-run `shadcn add` command for any registry item, with your token pre-embedded in the URL. The zero-config install handoff.

This is the tool that makes the whole MCP setup pay off. The agent calls it, gets back a fully-formed shadcn add command (URL includes your token), emits it in chat, and runs it in your shell. shadcn add hits /r/{name}.json?token=… directly — no further MCP roundtrip, no token prompts, no copy-paste.

When to use it

  • The agent has picked a component and is ready to install.
  • The user says "install X" or "add X to my project".
  • You want the agent to end a reasoning chain with an actionable shell command.

Arguments

NameTypeRequiredDefaultNotes
namestringRegistry slug
client"npx" | "bun" | "pnpm" | "yarn""npx"Package runner to use — the response also includes all four variants

Example prompts

use shadcnio and install pricing-grouped-comparison-table into my project
use shadcnio to install hero-announcement using bun
use shadcnio to install every block I picked in the last step, one by one

Response shape

{
"name": "pricing-grouped-comparison-table",
"client": "npx",
"command": "npx shadcn@latest add \"https://www.shadcn.io/r/pricing-grouped-comparison-table.json?token=<your-token>\"",
"allClients": {
  "npx":  "npx shadcn@latest add \"…\"",
  "bun":  "bunx --bun shadcn@latest add \"…\"",
  "pnpm": "pnpm dlx shadcn@latest add \"…\"",
  "yarn": "yarn dlx shadcn@latest add \"…\""
}
}

allClients is included on every response, so the agent can pick based on a package-lock.json / bun.lock / pnpm-lock.yaml / yarn.lock it sees in your repo — no second tool call needed.

Manual invocation

curl -s -X POST "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN" \
-H "content-type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_install_command",
    "arguments": { "name": "pricing-grouped-comparison-table", "client": "bun" }
  }
}' | jq -r '.result.content[0].text | fromjson | .command'

FAQ

Was this page helpful?

Sign in to leave feedback.