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 like Cursor, Windsurf, and VSCode, providing a streamlined workflow for UI development through AI-powered UI generation based on simple text prompts.
Tell Agent What You Need
/ui
followed by your component description/ui create a modern navigation bar with responsive design
Let Magic Create It
Seamless Integration
npx -y @smithery/cli@latest run @21st-dev/magic-mcp --config "{\"TWENTY_FIRST_API_KEY\":\"your-api-key\"}"
Add to ~/.codeium/windsurf/mcp_config.json
:
{
"mcpServers": {
"magic": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"install",
"@21st-dev/magic-mcp",
"--client",
"windsurf"
],
"env": {
"TWENTY_FIRST_API_KEY": "your-api-key"
}
}
}
}
Add to Cline's MCP configuration:
{
"mcpServers": {
"magic": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"install",
"@21st-dev/magic-mcp",
"--client",
"cline"
],
"env": {
"TWENTY_FIRST_API_KEY": "your-api-key"
}
}
}
}
Magic AI Agent only writes or modifies files related to the components it generates. It follows your project's code style and structure, integrating seamlessly with your existing codebase without affecting other parts of your application.
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.
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.
Magic AI Agent can handle components of varying complexity, from simple buttons to complex interactive forms. For best results, it's recommended to break down very complex UIs into smaller, manageable components.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.