/ الدليل / الملعب / 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 مصفوفة من كائنات الخادم بدلاً من خريطة.

~/.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