/ Diretório / 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 que usar

Principais recursos

Demo ao vivo

Como fica na prática

magic-mcp.replay ▶ pronto
0/0

Instalar

Escolha seu 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"
      ]
    }
  }
}

Abra Claude Desktop → Settings → Developer → Edit Config. Reinicie após salvar.

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

Cursor usa o mesmo esquema mcpServers que o Claude Desktop. Config de projeto vence a global.

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

Clique no ícone MCP Servers na barra lateral do Cline, depois "Edit Configuration".

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

Mesmo formato do Claude Desktop. Reinicie o Windsurf para aplicar.

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

O Continue usa um array de objetos de servidor em vez de um map.

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

Adicione em context_servers. Zed recarrega automaticamente ao salvar.

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

Uma linha só. Verifique com claude mcp list. Remova com claude mcp remove.

Casos de uso

Usos do mundo real: 21st.dev Magic MCP

Generate a polished landing-page hero in under a minute

👤 Frontend engineers shipping fast ⏱ ~15 min intermediate

Quando usar: You need a hero section right now and don't want to start from a blank file.

Pré-requisitos
  • Server/skill installed and authenticated — See repo README
Fluxo
  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.

Armadilhas
  • Generated components assume shadcn primitives are installed — Generated components assume shadcn primitives are installed — run npx shadcn add button card first.
Combine com: filesystem · flyonui-mcp

Combinações

Combine com outros MCPs para 10× de alavancagem

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

Ferramentas

O que este MCP expõe

FerramentaEntradasQuando chamarCusto
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

Custo e limites

O que custa rodar

Cota de API
See provider docs for rate limits
Tokens por chamada
Varies by tool
Monetário
See repo README for pricing details
Dica
Cache tool results and avoid repeated identical calls.

Segurança

Permissões, segredos, alcance

Armazenamento de credenciais: Use environment variables; never commit secrets
Saída de dados: Tool calls go to the provider's API as documented

Solução de problemas

Erros comuns e correções

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. outros

AlternativaQuando usarTroca
v0.devYou prefer the v0 web UIOutside your editor; different style

Mais

Recursos

📖 Leia o README oficial no GitHub

🐙 Ver issues abertas

🔍 Ver todos os 400+ servidores MCP e Skills