Skip to content

21st.dev Grid Notes

Community marketplace of React components, blocks, themes and shaders with a hosted MCP server (`https://21st.dev/api/mcp`) and per-component `shadcn add` commands.

Grid NotesVersion remote MCP + registryUI librariesChecked 2026-11-04
Setup & agent config

Install and prerequisites

What your agent should install or configure before writing code with this pack.
Terminal
npx shadcn@latest add "https://21st.dev/r/<author>/<component>"
Packages:shadcn

For the MCP server, create an API key at 21st.dev/mcp and set API_KEY_21ST in your environment (sent in the x-api-key header).

Framework setup

Production-ready wiring for React 19, Next.js App Router and Tailwind CSS v4.

Connecting the 21st.dev remote MCP server

Pass API_KEY_21ST via the x-api-key header in your agent's MCP config; never hard-code the key in a committed .mcp.json.

.mcp.json
{
  "mcpServers": {
    "21st-dev": {
      "type": "http",
      "url": "https://21st.dev/api/mcp",
      "headers": {
        "x-api-key": "${API_KEY_21ST}"
      }
    }
  }
}

Gotchas for agents

Real-world traps — version mismatches, licence boundaries, main-thread stalls and CSS layer rules — that trip AI agents up.
  1. Legacy Magic console keys no longer work

    Keys created in the older Magic MCP console are retired. Generate a fresh key at https://21st.dev/mcp and pass it in the x-api-key request header.

  2. Tool availability depends on account plan

    search and get_component work without paid AI credits; generate and iterate_generation only appear when the account has AI generation access enabled.

  3. Review community-contributed code before shipping

    Because 21st.dev is a multi-author community marketplace, inspect each installed component for hard-coded colours, external image URLs, missing aria-labels and Tailwind v3-only utilities before committing.

Accessibility and reduced motion

How to keep animations and interactive components accessible across keyboard, screen readers and prefers-reduced-motion.

Reduced motion

Community blocks rarely include prefers-reduced-motion guards out of the box; audit any motion or shader block against your project's reduced-motion rules before merging.

Keyboard and screen readers

Verify heading hierarchy (h1 → h2 → h3), focus outlines (focus-visible:outline-2) and AA contrast (4.5:1) on every imported community block.