/ Каталог / Песочница / 21st.dev Magic MCP
● Официальный 21st-dev ⚡ Сразу

21st.dev Magic MCP

автор 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.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

magic-mcp.replay ▶ готово
0/0

Установка

Выберите клиент

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

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

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

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

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

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

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

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

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

Continue использует массив объектов серверов, а не map.

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

Добавьте в context_servers. Zed перезагружается автоматически.

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

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: 21st.dev Magic MCP

Generate a polished landing-page hero in under a minute

👤 Frontend engineers shipping fast ⏱ ~15 min intermediate

Когда использовать: You need a hero section right now and don't want to start from a blank file.

Предварительные требования
  • Server/skill installed and authenticated — See repo README
Поток
  1. Search for inspiration
    Search 21st for hero sections that mix gradient + product screenshot.✓ Скопировано
    → 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.✓ Скопировано
    → A complete tsx file using shadcn primitives

Итог: A real production-shape component in one prompt.

Подводные камни
  • Generated components assume shadcn primitives are installed — Generated components assume shadcn primitives are installed — run npx shadcn add button card first.
Сочетать с: filesystem · flyonui-mcp

Комбинации

Сочетайте с другими MCP — эффект x10

magic-mcp + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ Скопировано
magic-mcp + flyonui-mcp

Pair with flyonui-mcp for complementary capabilities

Use this server together with flyonui-mcp to complete a multi-step task.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
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

Стоимость и лимиты

Во что обходится

Квота API
See provider docs for rate limits
Токенов на вызов
Varies by tool
Деньги
See repo README for pricing details
Совет
Cache tool results and avoid repeated identical calls.

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: Use environment variables; never commit secrets
Исходящий трафик: Tool calls go to the provider's API as documented

Устранение неполадок

Частые ошибки и исправления

API key invalid

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

Проверить: search_components returns results
component uses missing shadcn import

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

Проверить: Vite/Next builds cleanly

Альтернативы

21st.dev Magic MCP в сравнении

АльтернативаКогда использоватьКомпромисс
v0.devYou prefer the v0 web UIOutside your editor; different style

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills