21st.dev Magic AI Agent

21st.dev Magic AI Agent

Instantly create and enhance UI components through natural language in your IDE.

3,919
Stars
260
Forks
3,919
Watchers
17
Issues
21st.dev Magic AI Agent enables developers to generate, preview, and integrate modern UI components using natural language commands directly within popular IDEs. It leverages the Model Context Protocol for seamless interoperability, supporting automated installation and configuration across tools like VSCode, Cursor, Windsurf, and Cline. With a vast library based on 21st.dev assets and advanced features such as TypeScript support and real-time previews, it streamlines the UI development workflow. The solution also supports customization, enhancements, and integration of brand assets through SVGL.

Key Features

Natural language-powered UI component generation
Seamless integration with multiple IDEs (VSCode, Cursor, Windsurf, Cline)
Extensive modern UI component library
Real-time visual preview of components
Full TypeScript support for development
Automated installation via CLI and manual configuration options
Access to professional brand assets through SVGL
Component enhancement and animation capabilities (upcoming)
MCP-standardized configuration for cross-IDE compatibility
Customizable and ready-to-use components

Use Cases

Rapid prototyping of user interfaces within IDEs
Streamlining UI component creation during development
Integrating branded assets and logos into applications
Enhancing and customizing existing components
Reducing manual boilerplate in frontend projects
Providing teams with a professional component library
Automating component configuration across different tooling environments
Facilitating responsive UI design via natural language
Onboarding developers quickly to standardized component workflows
Accelerating feature iterations with instant component previews

README

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:

bash
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:

json
{
  "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):

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:

json
{
  "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.

Star History

Star History Chart

Repository Owner

21st-dev
21st-dev

Organization

Repository Details

Language TypeScript
Default Branch main
Size 2,325 KB
Contributors 5
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
90.48%
JavaScript
8.5%
Dockerfile
1.02%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Mindpilot MCP

    Mindpilot MCP

    Visualize and understand code structures with on-demand diagrams for AI coding assistants.

    Mindpilot MCP provides AI coding agents with the capability to visualize, analyze, and understand complex codebases through interactive diagrams. It operates as a Model Context Protocol (MCP) server, enabling seamless integration with multiple development environments such as VS Code, Cursor, Windsurf, Zed, and Claude Code. Mindpilot ensures local processing for privacy, supports multi-client connections, and offers robust configuration options for server operation and data management. Users can export diagrams and adjust analytics settings for improved user control.

    • ⭐ 61
    • MCP
    • abrinsmead/mindpilot-mcp
  • Bifrost

    Bifrost

    VSCode Dev Tools exposed via the Model Context Protocol for AI tool integration.

    Bifrost is a Visual Studio Code extension that launches a Model Context Protocol (MCP) server, enabling external AI coding assistants to access advanced code navigation, analysis, and manipulation features from VSCode. It exposes language server capabilities, symbol search, semantic code analysis, and refactoring tools through MCP-compatible HTTP and SSE endpoints. The extension is designed for seamless integration with AI assistants, supporting multi-project environments and configuration via JSON files.

    • ⭐ 184
    • MCP
    • biegehydra/BifrostMCP
  • kibitz

    kibitz

    The coding agent for professionals with MCP integration.

    kibitz is a coding agent that supports advanced AI collaboration by enabling seamless integration with Model Context Protocol (MCP) servers via WebSockets. It allows users to configure Anthropic API keys, system prompts, and custom context providers for each project, enhancing contextual understanding for coding tasks. The platform is designed for developers and professionals seeking tailored AI-driven coding workflows and provides flexible project-specific configuration.

    • ⭐ 104
    • MCP
    • nick1udwig/kibitz
  • Azure MCP Server

    Azure MCP Server

    Connect AI agents with Azure services through Model Context Protocol.

    Azure MCP Server provides a seamless interface between AI agents and Azure services by implementing the Model Context Protocol (MCP) specification. It enables integration with tools like GitHub Copilot for Azure and supports a wide range of Azure resource management tasks directly via conversational AI interfaces. Designed for extensibility and compatibility, it offers enhanced contextual capabilities for agents working with Azure environments.

    • ⭐ 1,178
    • MCP
    • Azure/azure-mcp
  • Inspektor Gadget MCP Server

    Inspektor Gadget MCP Server

    AI-powered Kubernetes troubleshooting via Model Context Protocol.

    Inspektor Gadget MCP Server provides an AI-powered debugging and inspection interface for Kubernetes clusters. Leveraging the Model Context Protocol, it enables intelligent output summarization, one-click deployment of Inspektor Gadget, and automated discovery of debugging tools from Artifact Hub. The server integrates seamlessly with VS Code for interactive AI commands, simplifying Kubernetes troubleshooting and monitoring workflows.

    • ⭐ 16
    • MCP
    • inspektor-gadget/ig-mcp-server
  • Biel.ai MCP Server

    Biel.ai MCP Server

    Seamlessly connect IDEs to your company’s product documentation using an MCP server.

    Biel.ai MCP Server enables AI tools such as Cursor, VS Code, and Claude Desktop to access and utilize a company’s product documentation and knowledge base through the Model Context Protocol. It provides a hosted RAG layer that makes documentation searchable and usable, supporting real-time, context-rich completion and answers for developers. The server can be used as a hosted solution or self-hosted locally or via Docker for advanced customization.

    • ⭐ 2
    • MCP
    • TechDocsStudio/biel-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results