Use 21st in your agent

Search 12,000+ components, install them, generate UI and publish your own work, from the terminal or any MCP client

Install & sign in

  1. 01

    Install and sign in

    Login opens the browser and saves a token on your machine

    npm i -g @21st-dev/cli 21st login
  2. 02

    Find a piece and add it

    21st search "pricing table" 21st add shaban/pricing
  3. 03

    In CI and scripts

    Skip login and pass --api-key $API_KEY_21ST (or set the env var)

21st login saves a token on your machine, no key to paste

Then just ask your agent

Once 21st is set up, say what you need in your agent's chat. The 21st skills tell it what to run
1Give your agent the skills, once
2Ask for what you need

What it looks like in your agent

An example run: it asks 21st, picks a real piece from the library, writes it into your project and checks the build

> add a pricing table with a monthly/yearly toggle from 21st

21st · search "pricing table monthly yearly"

→Pricing · Shaban618 saves

Dark Gradient Pricing · Vaibhav Kumar Singh733 saves

Modal Pricing · Kokonut UI877 saves

21st · get_component shaban/pricing

· Writing components/ui/pricing.tsx

· Installing the dependencies it lists

· Swapping hardcoded colours for your tokens

✓ Typecheck and build pass. It is on /pricing

Building the page…
Pricing by Shaban

Builder, from

$6

a month, billed yearly

See plans
  • Search from your agent, free on every plan
  • Free accounts install 2 a day across web, MCP and CLI
  • Unlimited installs via MCP and CLI on any paid plan
  • 21st AI from your agent with Builder + AI credits

Questions about the setup

Claude Code, Claude Desktop, Codex, Cursor and Lovable have their own setup above. Any other client that speaks streamable HTTP (VS Code, Windsurf, Cline and more) connects to https://21st.dev/api/mcp with the same key

Most clients send it as an x-api-key header (Authorization: Bearer works too). Claude Desktop and Lovable sign in with OAuth, no key. The CLI saves a token when you run 21st login. Sign in and this page puts your key in every command

Search is free. A free account gets 2 component-code retrievals a day across the web, MCP and the CLI. Any paid plan installs without limits

Yes. It drafts variants from a prompt with the generate tool, or 21st generate "a pricing table" --variants 3 in the terminal. It spends AI credits from Builder + AI

For Claude Code: /plugin marketplace add 21st-dev/claude-code-plugin, then /plugin install 21st@21st. For Codex: codex plugin marketplace add 21st-dev/codex-plugin. Both bundle the server with the 21st skills

Yes, under its new name, 21st MCP. Configs that still use the @21st-dev/magic package keep working: it passes every call to the same server

Let your agent shop the library

Join for free, get your key and ask for the piece you need