/ Verzeichnis / Playground / 21st.dev Magic MCP
● Offiziell 21st-dev ⚡ Sofort

21st.dev Magic MCP

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

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

magic-mcp.replay ▶ bereit
0/0

Installieren

Wählen Sie Ihren Client

~/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"
      ]
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

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

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

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

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

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

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

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

Continue nutzt ein Array von Serverobjekten statt einer Map.

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

In context_servers hinzufügen. Zed lädt beim Speichern neu.

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

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: 21st.dev Magic MCP

Generate a polished landing-page hero in under a minute

👤 Frontend engineers shipping fast ⏱ ~15 min intermediate

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

Voraussetzungen
  • Server/skill installed and authenticated — See repo README
Ablauf
  1. Search for inspiration
    Search 21st for hero sections that mix gradient + product screenshot.✓ Kopiert
    → 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.✓ Kopiert
    → A complete tsx file using shadcn primitives

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

Fallstricke
  • Generated components assume shadcn primitives are installed — Generated components assume shadcn primitives are installed — run npx shadcn add button card first.
Kombinieren mit: filesystem · flyonui-mcp

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

magic-mcp + filesystem

Pair with filesystem for complementary capabilities

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

Pair with flyonui-mcp for complementary capabilities

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

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
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

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
See provider docs for rate limits
Tokens pro Aufruf
Varies by tool
Kosten in €
See repo README for pricing details
Tipp
Cache tool results and avoid repeated identical calls.

Sicherheit

Rechte, Secrets, Reichweite

Credential-Speicherung: Use environment variables; never commit secrets
Datenabfluss: Tool calls go to the provider's API as documented

Fehlerbehebung

Häufige Fehler und Lösungen

API key invalid

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

Prüfen: search_components returns results
component uses missing shadcn import

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

Prüfen: Vite/Next builds cleanly

Alternativen

21st.dev Magic MCP vs. andere

AlternativeWann stattdessenKompromiss
v0.devYou prefer the v0 web UIOutside your editor; different style

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen