/ Directorio / Playground / 21st.dev Magic MCP
● Oficial 21st-dev ⚡ Instantáneo

21st.dev Magic MCP

por 21st-dev · 21st-dev/magic-mcp

Generate beautiful React components inline — like v0, but inside your editor.

Magic MCP is 21st.dev's component generator: ask in plain English, get a production-quality React + Tailwind component returned inline. Works in Cursor, Claude Code, Windsurf — anywhere MCP runs.

Por qué usarlo

Características clave

Demo en vivo

Cómo se ve en la práctica

magic-mcp.replay ▶ listo
0/0

Instalar

Elige tu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ]
    }
  }
}

Abre Claude Desktop → Settings → Developer → Edit Config. Reinicia después de guardar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ]
    }
  }
}

Cursor usa el mismo esquema mcpServers que Claude Desktop. La configuración del proyecto prevalece sobre la global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ]
    }
  }
}

Haz clic en el icono MCP Servers de la barra lateral de Cline y luego en "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ]
    }
  }
}

Mismo formato que Claude Desktop. Reinicia Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "magic-mcp",
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ]
    }
  ]
}

Continue usa un array de objetos de servidor en lugar de un mapa.

~/.config/zed/settings.json
{
  "context_servers": {
    "magic-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@21st-dev/magic@latest"
        ]
      }
    }
  }
}

Añádelo a context_servers. Zed recarga en caliente al guardar.

claude mcp add magic-mcp -- npx -y @21st-dev/magic@latest

Un solo comando. Verifica con claude mcp list. Quita con claude mcp remove.

Casos de uso

Usos del mundo real: 21st.dev Magic MCP

Generate a polished landing-page hero in under a minute

👤 Frontend engineers shipping fast ⏱ ~15 min intermediate

Cuándo usarlo: You need a hero section right now and don't want to start from a blank file.

Requisitos previos
  • Server/skill installed and authenticated — See repo README
Flujo
  1. Search for inspiration
    Search 21st for hero sections that mix gradient + product screenshot.✓ Copiado
    → 5–10 starter components
  2. Generate the final one
    Create a Hero component: dark gradient bg, headline 'Ship faster.' subhead 'AI for serious teams.' a primary CTA + secondary CTA, social proof row.✓ Copiado
    → A complete tsx file using shadcn primitives

Resultado: A real production-shape component in one prompt.

Errores comunes
  • Generated components assume shadcn primitives are installed — Generated components assume shadcn primitives are installed — run npx shadcn add button card first.
Combinar con: filesystem · flyonui-mcp

Combinaciones

Combínalo con otros MCPs para multiplicar por 10

magic-mcp + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ Copiado
magic-mcp + flyonui-mcp

Pair with flyonui-mcp for complementary capabilities

Use this server together with flyonui-mcp to complete a multi-step task.✓ Copiado

Herramientas

Lo que expone este MCP

HerramientaEntradasCuándo llamarCoste
create_component description, framework Need a new UI component 21st credits
refine_component component_code, instruction Tweak an existing component 21st credits
search_components query Find a pre-made starting point 1 API call

Coste y límites

Lo que cuesta ejecutarlo

Cuota de API
See provider docs for rate limits
Tokens por llamada
Varies by tool
Monetario
See repo README for pricing details
Consejo
Cache tool results and avoid repeated identical calls.

Seguridad

Permisos, secretos, alcance

Almacenamiento de credenciales: Use environment variables; never commit secrets
Salida de datos: Tool calls go to the provider's API as documented

Resolución de problemas

Errores comunes y soluciones

API key invalid

Get a key at 21st.dev/settings/api and set TWENTY_FIRST_API_KEY.

Verificar: search_components returns results
component uses missing shadcn import

Run npx shadcn add <component> for each unresolved import.

Verificar: Vite/Next builds cleanly

Alternativas

21st.dev Magic MCP vs otros

AlternativaCuándo usarlaContrapartida
v0.devYou prefer the v0 web UIOutside your editor; different style

Más

Recursos

📖 Lee el README oficial en GitHub

🐙 Ver issues abiertas

🔍 Ver todos los 400+ servidores MCP y Skills