Cover image

It's like v0 but in your Cursor/WindSurf/Cline. 21st dev Magic MCP server for working with your frontend like Magic

3 years

Works with Finder

7

Github Watches

90

Github Forks

1.2k

Github Stars

21st.dev Magic AI Agent

MCP Banner

Magic Component Platform (MCP) is a powerful AI-driven tool that helps developers create beautiful, modern UI components instantly through natural language descriptions. It integrates seamlessly with popular IDEs and provides a streamlined workflow for UI development.

🌟 Features

  • AI-Powered UI Generation: Create UI components by describing them in natural language
  • Multi-IDE Support:
  • Modern Component Library: Access to a vast collection of pre-built, customizable components inspired by 21st.dev
  • Real-time Preview: Instantly see your components as you create them
  • TypeScript Support: Full TypeScript support for type-safe development
  • SVGL Integration: Access to a vast collection of professional brand assets and logos
  • Component Enhancement: Improve existing components with advanced features and animations (Coming Soon)

🎯 How It Works

  1. Tell Agent What You Need

    • In your AI Agent's chat, just type /ui and describe the component you're looking for
    • Example: /ui create a modern navigation bar with responsive design
  2. Let Magic Create It

    • Your IDE prompts you to use Magic
    • Magic instantly builds a polished UI component
    • Components are inspired by 21st.dev's library
  3. Seamless Integration

    • Components are automatically added to your project
    • Start using your new UI components right away
    • All components are fully customizable

🚀 Getting Started

Prerequisites

  • Node.js (Latest LTS version recommended)
  • One of the supported IDEs:
    • Cursor
    • Windsurf
    • VSCode (with Cline extension)

Installation

  1. Generate API Key

  2. Choose Installation Method

Method 1: CLI Installation (Recommended)

One command to install and configure MCP for your IDE:

npx @21st-dev/cli@latest install <client> --api-key <key>

Supported clients: cursor, windsurf, cline, claude

Method 2: Manual Configuration

If you prefer manual setup, add this to your IDE's MCP config file:

{
  "mcpServers": {
    "@21st-dev/magic": {
      "command": "npx",
      "args": ["-y", "@21st-dev/magic@latest", "API_KEY=\"your-api-key\""]
    }
  }
}

Config file locations:

  • Cursor: ~/.cursor/mcp.json
  • Windsurf: ~/.codeium/windsurf/mcp_config.json
  • Cline: ~/.cline/mcp_config.json
  • Claude: ~/.claude/mcp_config.json

Method 3: VS Code Installation

For one-click installation, click one of the install buttons below:

Install with NPX in VS Code Install with NPX in VS Code Insiders

Manual VS Code Setup

First, check the install buttons above for one-click installation. For manual setup:

Add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON):

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "apiKey",
        "description": "21st.dev Magic API Key",
        "password": true
      }
    ],
    "servers": {
      "@21st-dev/magic": {
        "command": "npx",
        "args": ["-y", "@21st-dev/magic@latest"],
        "env": {
          "API_KEY": "${input:apiKey}"
        }
      }
    }
  }
}

Optionally, you can add it to a file called .vscode/mcp.json in your workspace:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "apiKey",
      "description": "21st.dev Magic API Key",
      "password": true
    }
  ],
  "servers": {
    "@21st-dev/magic": {
      "command": "npx",
      "args": ["-y", "@21st-dev/magic@latest"],
      "env": {
        "API_KEY": "${input:apiKey}"
      }
    }
  }
}

❓ FAQ

How does Magic AI Agent handle my codebase?

Magic AI Agent only writes or modifies files related to the components it generates. It follows your project's code style and structure, and integrates seamlessly with your existing codebase without affecting other parts of your application.

Can I customize the generated components?

Yes! All generated components are fully editable and come with well-structured code. You can modify the styling, functionality, and behavior just like any other React component in your codebase.

What happens if I run out of generations?

If you exceed your monthly generation limit, you'll be prompted to upgrade your plan. You can upgrade at any time to continue generating components. Your existing components will remain fully functional.

How soon do new components get added to 21st.dev's library?

Authors can publish components to 21st.dev at any time, and Magic Agent will have immediate access to them. This means you'll always have access to the latest components and design patterns from the community.

Is there a limit to component complexity?

Magic AI Agent can handle components of varying complexity, from simple buttons to complex interactive forms. However, for best results, we recommend breaking down very complex UIs into smaller, manageable components.

🛠️ Development

Project Structure

mcp/
├── app/
│   └── components/     # Core UI components
├── types/             # TypeScript type definitions
├── lib/              # Utility functions
└── public/           # Static assets

Key Components

  • IdeInstructions: Setup instructions for different IDEs
  • ApiKeySection: API key management interface
  • WelcomeOnboarding: Onboarding flow for new users

🤝 Contributing

We welcome contributions! Please join our Discord community and provide feedback to help improve Magic Agent. The source code is available on GitHub.

👥 Community & Support

⚠️ Beta Notice

Magic Agent is currently in beta. All features are free during this period. We appreciate your feedback and patience as we continue to improve the platform.

📝 License

MIT License

🙏 Acknowledgments

  • Thanks to our beta testers and community members
  • Special thanks to the Cursor, Windsurf, and Cline teams for their collaboration
  • Integration with 21st.dev for component inspiration
  • SVGL for logo and brand asset integration

For more information, join our Discord community or visit 21st.dev/magic.

相关推荐

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • Beria Joey
  • 你的职业规划师,不走弯路就问我。Sponsor:小红书“ ItsJoe就出行 ”

  • Benedikt Ess
  • FindetundanalysiertOnlineProdukteeinschlielichAmazonnachVolumenBewertungenundPreis

  • pontusab
  • The Cursor & Windsurf community, find rules and MCPs

  • av
  • Effortlessly run LLM backends, APIs, frontends, and services with one command.

  • GeyserMC
  • A library for communication with a Minecraft client/server.

  • 1Panel-dev
  • 🔥 1Panel provides an intuitive web interface and MCP Server to manage websites, files, containers, databases, and LLMs on a Linux server.

  • awslabs
  • AWS MCP Servers — specialized MCP servers that bring AWS best practices directly to your development workflow

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(数据处理、模型训练、模型部署、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

  • appcypher
  • Awesome MCP Servers - A curated list of Model Context Protocol servers

  • GLips
  • MCP server to provide Figma layout information to AI coding agents like Cursor

  • Byaidu
  • PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

  • n8n-io
  • Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

  • activepieces
  • AI Agents & MCPs & AI Workflow Automation • (280+ MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

    Reviews

    5 (1)
    Avatar
    user_PX0TYMZE
    2025-04-17

    As a dedicated user of the magic-mcp application by 21st-dev, I am thoroughly impressed with its functionality and user experience. Whether you're looking for a versatile tool for your projects or need efficiency, magic-mcp delivers exceptional performance. The seamless integration and intuitive interface make it easy to use right out of the box. I highly recommend checking it out at https://github.com/21st-dev/magic-mcp for anyone in need of a reliable and effective solution.