Magic MCP
ποΈ 21st-dev/magic-mcp β an MCP server that brings v0-style AI UI generation directly into the coding agent: type /ui plus a natural-language description in Cursor, Windsurf, Cline, or Claude Code, and Magic drops a polished, fully editable React component into your project. Components are inspired by the community library at 21st.dev. MIT-licensed, beta (free during beta, monthly generation limits on paid plans).

Links
Description
π§© What it does:
- AI-powered UI generation β describe a component in natural language (
/ui create a modern navigation bar with responsive design), get working code in your project. - Multi-IDE support β Cursor, Windsurf, VSCode + Cline, Claude; one MCP server config per client.
- 21st.dev component library β generations draw on a community library of pre-built, customizable components; authors publish, Magic gets immediate access.
- Real-time preview β see the component as itβs created.
- TypeScript-first β full type-safe output.
- SVGL integration β professional brand assets/logos from svgl.app.
- Scoped writes β only touches files related to the generated component, follows existing project code style.
Download or use
API key from 21st.dev Magic Console, then one-command install:
npx @21st-dev/cli@latest install <client> --api-key <key>
Clients: cursor, windsurf, cline, claude. Manual alternative β add to the clientβs MCP config (~/.cursor/mcp.json, ~/.codeium/windsurf/mcp_config.json, ~/.cline/mcp_config.json, ~/.claude/mcp_config.json):
{
"mcpServers": {
"@21st-dev/magic": {
"command": "npx",
"args": ["-y", "@21st-dev/magic@latest", "API_KEY=\"your-api-key\""]
}
}
}VS Code also supports workspace-level .vscode/mcp.json with a prompted API key input.
Reasoning for
The βv0 inside your IDEβ pitch: instead of context-switching to a hosted builder like v0 or Lovable and pasting code back, the component generator lives in the agent chat where the codebase context already is. Candidate for shadcn-ui-style component scaffolding in Next.js/React projects β worth testing against plain Claude Code + UI UX Pro Max prompting, which needs no API key or per-generation quota.
Alternatives considered
- v0 β hosted, broader scope (whole apps), tied to Vercel/Next.js output; Magic is IDE-embedded and component-scoped.
- Lovable β full-stack app builder, not a per-component tool.
- Plain agent + shadcn-ui β Claude Code already writes shadcn/Tailwind components well; Magicβs edge is the curated 21st.dev library and instant preview, its cost is an API key + generation limits.
Resources
- π Repo: github.com/21st-dev/magic-mcp
- π Platform source: github.com/serafimcloud/21st
- π Console: 21st.dev/magic/console Β· Site: 21st.dev/magic
- π SVGL: svgl.app
- π Related: v0 Β· shadcn-ui Β· Cursor Β· Claude Code Β· Lovable Β· UI UX Pro Max
Template: tool