Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:21st dev Magic mcp shadcn registry add

From Leeroopedia
Knowledge Sources
Domains UI_Components, Build_Tooling
Last Updated 2026-10-19 16:40 GMT

Overview

Concrete external tool for installing a catalog component into a project via the shadcn registry add CLI, used when a `get_component` result instructs registry install.

Description

The shadcn registry add CLI command installs a component from a registry into the local project, writing files to the configured component folder and wiring the `cn` helper / Tailwind tokens. 21st.dev catalog components are shadcn-compatible, so a `get_component` result may instruct the agent to run `npx shadcn@latest add <registry-url>` (or the project's equivalent) rather than writing files manually.

This is an External Tool Doc: the CLI belongs to the user's project tooling, not to this repo or the 21st MCP server. The 21st MCP returns install instructions; the agent runs them in the host project.

Usage

Call `shadcn registry add` when a get_component result's `installInstructions` tell you to. If the result instead returns files directly, write those files to the project instead.

Code Reference

Source Location

Signature

# Install a component from a registry URL or specifier.
npx shadcn@latest add <registry-url-or-specifier>
# e.g. for a 21st.dev registry component:
npx shadcn@latest add "https://21st.dev/r/<component>.json"

Import

# Not imported. Run in the host project directory. Requires the project
# to be set up for shadcn (Tailwind config, cn helper, components.json).

I/O Contract

Inputs

Name Type Required Description
registry-url-or-specifier string Yes The registry URL/specifier from `get_component`'s install instructions
project setup files Yes Project must have shadcn config (Tailwind, `cn`, `components.json`)

Outputs

Name Type Description
files source files Component files written into the project's component folder

Usage Examples

Install per get_component instructions

# After get_component returns a registry-add instruction:
npx shadcn@latest add "https://21st.dev/r/pricing-table.json"
# Then import the component in the page and adapt tokens/props.

Related Pages

Implements Principle

Requires Environment

Notes

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment