Magic
MCP server by 21st-dev Verified · npm:@21st-dev
21st MCP gives AI assistants access to 21st.dev for searching UI components and generating new ones. The Magic MCP package is now a compatibility proxy that forwards to the same server, for people with older Magic configs.
Install Magic
Built from the published package, never by AI.
claude mcp add magic -- npx -y @21st-dev/magicRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"magic": {
"args": [
"-y",
"@21st-dev/magic"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
{
"mcpServers": {
"magic": {
"args": [
"-y",
"@21st-dev/magic"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"magic": {
"args": [
"-y",
"@21st-dev/magic"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add magic -- npx -y @21st-dev/magic{
"mcpServers": {
"magic": {
"args": [
"-y",
"@21st-dev/magic"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
gemini mcp add magic npx -y @21st-dev/magicGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the magic block.
About
The Magic MCP server has been replaced by the 21st MCP, a plain HTTP MCP server installed through the 21st CLI. The source says the old @21st-dev/magic npm package remains published as a small stdio proxy that forwards every MCP message to the 21st MCP server, so existing configs keep working. The API key can be passed in several historical forms or through environment variables.
The 21st MCP exposes catalog search across components, themes and templates, component retrieval, UI generation, logo search and account tools. Hosted generation tools appear only when AI access is enabled on the account. The source is written for developers who use AI coding assistants such as Cursor, Claude Code, VS Code, Windsurf or Codex.
Written from the project's README and checked against it.
Tools it gives your assistant
searchSearches the 21st catalog of components, themes and templates.get_componentRetrieves a component so the agent can adapt its code with your own tools.generateGenerates UI components with hosted AI when AI access is enabled.iterate_generationRefines an existing generation when AI access is enabled.get_usageReports whether AI generation is enabled for the account.get_inspirationReplaces the legacy component inspiration tool.search_logoSearches for logos, one query per call.
What you need
- A 21st.dev API key from 21st.dev/mcp
- AI access on the account for generate and iterate_generation
Try asking
- Search 21st for a pricing table component
- Use get_usage to check whether AI generation is enabled
- Find a logo for my project using search_logo
Good to know
- Old Magic API keys were reset and no longer work, so a new key is needed.
- Generation tools are listed only when AI access is enabled.
- Cached or legacy generation calls can return ai_subscription_required until AI is enabled.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to Magic
All alternatives →Oh My Posh Validator is listed as an MCP server, but the source is the README for oh-my-posh, a cross platform prompt theme engine. It does not describe an MCP server, tools, or schema validation.
Sim is a workspace for building, deploying and managing AI agents and workflows. Its MCP server lets Claude, Claude Code, Codex or another MCP client manage workspaces, workflows, tables, knowledge bases, files and logs.
Omnara deploys durable AI agents on any model and any machine. It is an open-source, self-hostable managed agent platform under Apache 2.0, with a REST API, TypeScript SDK, CLI, and MCP server.
Strata is an MCP server from Klavis AI for progressive tool usage, described as a way to optimize the AI agent's context window. The repository is deprecated, but it remains public for reference and for local or hosted use.
VoiceMode is an MCP server that adds voice conversations to Claude Code and other MCP capable agents. It uses speech-to-text and text-to-speech. It suits people whose hands or eyes are busy.
Gives an AI agent access to the skills, plugins, MCP connections, and Google Workspace and Microsoft 365 capabilities assigned to you by your OpenWork organization, through one OAuth MCP URL. Intended for people and teams who want to reuse the same setup across agents, tools, and machines.
Compare with Oh My Posh Validator, Sim or Omnara
Magic: common questions
Why did my old Magic MCP stop working?
The source says the Magic backend was superseded by the unified 21st MCP and all old API keys were reset. A fresh key from 21st.dev/mcp is needed.
Do I still need the @21st-dev/magic package?
The source says it remains published as a compatibility proxy for old configs, and it recommends switching to npx @21st-dev/cli@latest init for new setups.
Does the 21st MCP include AI generation?
Builder component access does not enable hosted AI. The generate and iterate_generation tools appear only when AI access is enabled.
How do I install Magic?
In Claude Code run claude mcp add magic -- npx -y @21st-dev/magic. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is Magic the official server?
Magic is published by npm:@21st-dev from its verified domain in the official MCP Registry.
Is Magic free?
The code is published under the ISC licence. The service it connects to may have its own pricing.
Is Magic safe to use?
It scores 89 of 100. Grades: maintenance B, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to Magic?
Similar MCP servers: Oh My Posh Validator, Sim, Omnara, strata.
Does Magic work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
