get_registry_stats
Top-level counts across every surface on shadcn.io — blocks, ai, components, hooks, charts, etc., plus icon library and total icon counts. Module-cached for 10 minutes for near-zero-cost reads.
get_registry_stats is the "what's on shadcn.io?" bird's-eye view. It lets an agent answer that question in one call instead of enumerating surface by surface.
When to use
- Answering onboarding / marketing questions ("what can I build with shadcn.io?").
- Giving the user a coverage sense before a plan ("we have 56 block categories — here are the ones most relevant to your SaaS").
- Dashboards and internal tooling.
How it works
First call does real work; subsequent calls within 10 minutes are pure memory reads.
On cache miss:
- For each surface, run a lightweight
readdirSync(directory metadata only — no file contents read). For block categories andcomponents, walks the per-category subdirectories recursively. For flat surfaces (ai,charts, etc.), counts.tsxfiles directly. loadBlockCategories()readscontent/blocks/meta.json(already cached from the other tools).- Two aggregate queries against the icons DB:
library.count()andlibrary.aggregate({ _sum: { iconCount } }). - Sum the surface totals and return.
On cache hit: in-memory object read. Zero I/O.
Concurrent callers share one in-flight promise — no stampede: if 50 requests arrive simultaneously, exactly one does the scan.
Source: lib/mcp/stats.ts#getRegistryStats.
Arguments
None.
Response
{
"totalItems": 6524,
"surfaces": {
"blocks": { "total": 6120, "categories": 56 },
"ai": { "total": 48 },
"components": { "total": 82 },
"examples": { "total": 164 },
"hooks": { "total": 27 },
"charts": { "total": 18 },
"button": { "total": 12 },
"background": { "total": 14 },
"shaders": { "total": 9 },
"text": { "total": 16 },
"themes": { "total": 14 }
},
"icons": {
"libraries": 222,
"total": 285043
},
"computedAt": "2026-04-16T14:32:18.412Z",
"cacheTtlSeconds": 600
}computedAttells the agent how stale the snapshot is.cacheTtlSecondsdeclares the cache window — a well-behaved agent can choose to trust the numbers for that window without re-asking.
Example prompts
use shadcnio to give me a summary of everything availableuse shadcnio get_registry_stats and tell me how many pricing-category blocks I can pick fromuse shadcnio — how many icons total do I have access to?Manual invocation
curl -s -X POST "https://www.shadcn.io/api/mcp?token=YOUR_TOKEN" \
-H "content-type: application/json" -H "accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_registry_stats","arguments":{}}}' \
| sed -n 's/^data: //p' | jq '.result.content[0].text | fromjson'Tips + gotchas
- Counts, not premium/free split. This tool intentionally skips scanning file contents for
@premiumtags — that would require reading every file on cache miss, which we avoid. If you need the split, ask forlist_itemsand filter client-side, or wait for a dedicated tool. blocks.categoriescounts folder names fromcontent/blocks/meta.json, not the sum of blocks across categories (that'sblocks.total).totalforcomponentsis recursive becausepackages/components/is organized into subcategories. Forai,hooks, etc. it's a flat count.- Cache respects mtime indirectly. The 10-minute TTL catches any registry additions within that window. If you're in dev and just added a file, wait up to 10 minutes or restart the server.
Was this page helpful?
Sign in to leave feedback.
whoami
Self-inspection for the authenticated caller. Returns email, Pro status, rate-limit remaining, and server time. Useful for debugging and letting agents check quota before a burst of calls.
Claude Code
Connect Claude Code into the shadcn.io registry with one MCP URL — access every block, icon, and example in the catalog.