Make your AI a shadcn expert

get_icon

Fetch one icon by library and name. Returns a ready-to-drop React component plus a token-embedded shadcn add install command.

get_icon resolves one icon to a full registry item: a ready-to-use React component (with size / color / strokeWidth props), plus an install command with your token pre-embedded. It's the retrieval companion to search_icons.

When to use it

  • The agent has a specific (library, name) pair (from search_icons or the user).
  • You want the React component source, not just the raw SVG.
  • You want an install command that lands the icon at components/icons/{library}-{name}.tsx.

Arguments

NameTypeRequiredNotes
librarystringLibrary ID from search_icons.results[].libraryId (e.g. lucide, heroicons)
namestringIcon name from search_icons.results[].name (e.g. arrow-right)

Example prompts

use shadcnio to add a Lucide arrow-right icon to my button component
use shadcnio to fetch the github brand icon from simple-icons and install it
use shadcnio and show me the source of heroicons magnifying-glass

Response shape

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "lucide-arrow-right",
"type": "registry:ui",
"title": "ArrowRight Icon",
"author": "lucide",
"description": "ArrowRight icon from lucide",
"homepage": "https://www.shadcn.io/icons/lucide",
"files": [
  {
    "type": "registry:ui",
    "path": "lucide-arrow-right.tsx",
    "content": "import * as React from \"react\";\n\nexport function ArrowRightIcon({ size = 24, color = \"currentColor\", strokeWidth = 2, className, ...props }) { return <svg ...>…</svg>; }",
    "target": "components/icons/lucide-arrow-right.tsx"
  }
],
"dependencies": [],
"registryDependencies": [],
"install": "npx shadcn@latest add \"https://www.shadcn.io/r/lucide-arrow-right.json?token=<your-token>\""
}

The generated component accepts size, color, strokeWidth, and className props — all optional. Default size: 24, color: "currentColor", strokeWidth: 2. Drop it in and style it like any other React component.

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_icon",
    "arguments": { "library": "lucide", "name": "arrow-right" }
  }
}' | jq -r '.result.content[0].text | fromjson | .install'

FAQ

Was this page helpful?

Sign in to leave feedback.