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. - AI-Powered UI Generation: Create UI components by describing them in natural language - Multi-IDE Support: - Cursor IDE integrati
Add this skill
npx mdskills install 21st-dev/magic-mcpWell-documented MCP server for AI-powered UI component generation with excellent multi-IDE setup instructions
1# 21st.dev Magic AI Agent2345Magic 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.67## ๐ Features89- **AI-Powered UI Generation**: Create UI components by describing them in natural language10- **Multi-IDE Support**:11 - [Cursor](https://cursor.com) IDE integration12 - [Windsurf](https://windsurf.ai) support13 - [VSCode](https://code.visualstudio.com/) support14 - [VSCode + Cline](https://cline.bot) integration (Beta)15- **Modern Component Library**: Access to a vast collection of pre-built, customizable components inspired by [21st.dev](https://21st.dev)16- **Real-time Preview**: Instantly see your components as you create them17- **TypeScript Support**: Full TypeScript support for type-safe development18- **SVGL Integration**: Access to a vast collection of professional brand assets and logos19- **Component Enhancement**: Improve existing components with advanced features and animations (Coming Soon)2021## ๐ฏ How It Works22231. **Tell Agent What You Need**2425 - In your AI Agent's chat, just type `/ui` and describe the component you're looking for26 - Example: `/ui create a modern navigation bar with responsive design`27282. **Let Magic Create It**2930 - Your IDE prompts you to use Magic31 - Magic instantly builds a polished UI component32 - Components are inspired by 21st.dev's library33343. **Seamless Integration**35 - Components are automatically added to your project36 - Start using your new UI components right away37 - All components are fully customizable3839## ๐ Getting Started4041### Prerequisites4243- Node.js (Latest LTS version recommended)44- One of the supported IDEs:45 - Cursor46 - Windsurf47 - VSCode (with Cline extension)4849### Installation50511. **Generate API Key**5253 - Visit [21st.dev Magic Console](https://21st.dev/magic/console)54 - Generate a new API key55562. **Choose Installation Method**5758#### Method 1: CLI Installation (Recommended)5960One command to install and configure MCP for your IDE:6162```bash63npx @21st-dev/cli@latest install <client> --api-key <key>64```6566Supported clients: cursor, windsurf, cline, claude6768#### Method 2: Manual Configuration6970If you prefer manual setup, add this to your IDE's MCP config file:7172```json73{74 "mcpServers": {75 "@21st-dev/magic": {76 "command": "npx",77 "args": ["-y", "@21st-dev/magic@latest", "API_KEY=\"your-api-key\""]78 }79 }80}81```8283Config file locations:8485- Cursor: `~/.cursor/mcp.json`86- Windsurf: `~/.codeium/windsurf/mcp_config.json`87- Cline: `~/.cline/mcp_config.json`88- Claude: `~/.claude/mcp_config.json`8990#### Method 3: VS Code Installation9192For one-click installation, click one of the install buttons below:9394[](https://insiders.vscode.dev/redirect/mcp/install?name=%4021st-dev%2Fmagic&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%4021st-dev%2Fmagic%40latest%22%5D%2C%22env%22%3A%7B%22API_KEY%22%3A%22%24%7Binput%3AapiKey%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apiKey%22%2C%22description%22%3A%2221st.dev+Magic+API+Key%22%2C%22password%22%3Atrue%7D%5D) [](https://insiders.vscode.dev/redirect/mcp/install?name=%4021st-dev%2Fmagic&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%4021st-dev%2Fmagic%40latest%22%5D%2C%22env%22%3A%7B%22API_KEY%22%3A%22%24%7Binput%3AapiKey%7D%22%7D%7D&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apiKey%22%2C%22description%22%3A%2221st.dev+Magic+API+Key%22%2C%22password%22%3Atrue%7D%5D&quality=insiders)9596##### Manual VS Code Setup9798First, check the install buttons above for one-click installation. For manual setup:99100Add 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)`:101102```json103{104 "mcp": {105 "inputs": [106 {107 "type": "promptString",108 "id": "apiKey",109 "description": "21st.dev Magic API Key",110 "password": true111 }112 ],113 "servers": {114 "@21st-dev/magic": {115 "command": "npx",116 "args": ["-y", "@21st-dev/magic@latest"],117 "env": {118 "API_KEY": "${input:apiKey}"119 }120 }121 }122 }123}124```125126Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace:127128```json129{130 "inputs": [131 {132 "type": "promptString",133 "id": "apiKey",134 "description": "21st.dev Magic API Key",135 "password": true136 }137 ],138 "servers": {139 "@21st-dev/magic": {140 "command": "npx",141 "args": ["-y", "@21st-dev/magic@latest"],142 "env": {143 "API_KEY": "${input:apiKey}"144 }145 }146 }147}148```149150## โ FAQ151152### How does Magic AI Agent handle my codebase?153154Magic 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.155156### Can I customize the generated components?157158Yes! 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.159160### What happens if I run out of generations?161162If 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.163164### How soon do new components get added to 21st.dev's library?165166Authors 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.167168### Is there a limit to component complexity?169170Magic 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.171172## ๐ ๏ธ Development173174### Project Structure175176```177mcp/178โโโ app/179โ โโโ components/ # Core UI components180โโโ types/ # TypeScript type definitions181โโโ lib/ # Utility functions182โโโ public/ # Static assets183```184185### Key Components186187- `IdeInstructions`: Setup instructions for different IDEs188- `ApiKeySection`: API key management interface189- `WelcomeOnboarding`: Onboarding flow for new users190191## ๐ค Contributing192193We welcome contributions! Please join our [Discord community](https://discord.gg/Qx4rFunHfm) and provide feedback to help improve Magic Agent. The source code is available on [GitHub](https://github.com/serafimcloud/21st).194195## ๐ฅ Community & Support196197- [Discord Community](https://discord.gg/Qx4rFunHfm) - Join our active community198- [Twitter](https://x.com/serafimcloud) - Follow us for updates199200## โ ๏ธ Beta Notice201202Magic 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.203204## ๐ License205206MIT License207208## ๐ Acknowledgments209210- Thanks to our beta testers and community members211- Special thanks to the Cursor, Windsurf, and Cline teams for their collaboration212- Integration with [21st.dev](https://21st.dev) for component inspiration213- [SVGL](https://svgl.app) for logo and brand asset integration214215---216217For more information, join our [Discord community](https://discord.gg/Qx4rFunHfm) or visit [21st.dev/magic](https://21st.dev/magic).218
Full transparency โ inspect the skill content before installing.