Magic

Developer toolsDesign and media

It's like v0, but in your Cursor / Claude Code / Windsurf: search 10,000+ React/Tailwind components, generate new UI with AI, and publish your own, right from your editor. Magic MCP is now the 21st MCP; this package keeps old configs working. Setup: 21st.dev/mcp.

Your AI app calls the Magic MCP server, which does the developer tools and design and media work and sends the result back to the chat.

About Magic

Magic is the official MCP server from 21st-dev, filed in our directory under developer tools and design and media. It's like v0, but in your Cursor / Claude Code / Windsurf: search 10,000+ React/Tailwind components, generate new UI with AI, and publish your own, right from your editor. Magic MCP is now the 21st MCP; this package keeps old configs working. Setup: 21st.dev/mcp.

Magic runs on your own machine: your AI app starts it with the command npx -y @21st-dev/cli and talks to it over standard input and output.

At a glance

Publisher
21st-dev, the company behind the product
Runs
Locally on your machine
Install from
Node.js package on npm: @21st-dev/cli
Written in
TypeScript
License
ISC
GitHub stars
6,733

How to set up Magic

  1. Install Node.js on the machine that runs your AI app, because Magic starts with npx and downloads its package on first run.
  2. Check the Magic README for keys or settings; the registry lists none that Magic requires.
  3. Add Magic to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Magic tools to confirm the connection.
  5. Run one read-only task with Magic first, and keep your app asking before each tool call until the results look right.

Magic compared with similar servers

  • Gemini Notebook MCP CLI by jacob-bd has fewer GitHub stars than Magic (6.7k against 6.7k); Magic is official while Gemini Notebook MCP CLI is a community server, and both run locally.
  • Godot by Coding-Solo has more GitHub stars than Magic (6.9k against 6.7k); Magic is official while Godot is a community server, and both run locally.
  • Jscpd by kucherenko has fewer GitHub stars than Magic (6.7k against 6.7k); Magic is official while Jscpd is a community server, and both run locally.

Before you connect Magic

  • Give Magic its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Magic tool call until you trust what it does with them.
  • Treat text that Magic fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Magic on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Magic

How marketing and sales teams put Magic to work, by company size. Pick the size closest to yours and start Magic on one use case.

Small business

  • A small business with a developer can use Magic to ship site and tracking fixes faster, with the AI reading the code it changes.
  • Technical founders can ask Magic to explain and fix a marketing site issue without context switching between tools.
  • A small business can use Magic to resize and adapt one design for every channel instead of hiring for each version.
  • Magic runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Growth engineers can use Magic to build landing pages, tracking and integrations in fewer cycles, with reviews kept in the normal flow.
  • Marketing ops engineers can connect Magic to keep scripts and automations documented and versioned as they change.
  • Creative teams can connect Magic so agents produce variants for testing while designers keep control of the master files.
  • Start Magic on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise engineering teams can roll out Magic with repo scopes and audit logs, so agents work only where they are allowed.
  • Platform teams can standardize on Magic so web and marketing engineering share one reviewed way of working with AI.
  • Enterprises can use Magic with brand rules and approved assets only, so generated work stays inside the brand system.
  • Because Magic comes from 21st-dev, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Magic README

From 21st-dev/magic-mcp on GitHub, shared under its ISC license. Images are left out; the original has them.

README.md

Magic MCP → 21st MCP

Magic MCP is now the 21st MCP. The Magic MCP server (@21st-dev/magic) has been replaced by the unified 21st MCP, installed via the 21st CLI, setup at 21st.dev/mcp. This package remains published as a thin compatibility proxy so old configs keep working.

Install the 21st MCP (recommended)

npx @21st-dev/cli@latest init --client cursor   # or: claude | vscode | windsurf | codex

Or add it manually, it is a plain HTTP MCP server:

{
  "mcpServers": {
    "21st": {
      "url": "https://21st.dev/api/mcp",
      "headers": { "x-api-key": "YOUR_21ST_API_KEY" }
    }
  }
}

Get an API key at 21st.dev/mcp.

Old Magic API keys were reset. Keys issued by the old Magic console no longer work anywhere. Generate a fresh key at 21st.dev/mcp.

What this package does now (v0.2.0+)

npx -y @21st-dev/magic@latest API_KEY="..." still works: since v0.2.0 it is a small stdio proxy that forwards every MCP message to the 21st MCP server. Existing mcp.json entries that reference @21st-dev/magic keep functioning, but they now speak to the same server as the 21st CLI, with the tools available to the authenticated account.

The API key is accepted in all the historical forms: positional API_KEY="...", --API_KEY=..., /API_KEY:..., -API_KEY ..., or the TWENTY_FIRST_API_KEY / API_KEY_21ST environment variables.

AI access

Builder component access does not enable hosted 21st AI. The server lists generate and iterate_generation only when AI access is enabled. Check get_usage.aiGenerationEnabled; this reports access, not the remaining AI credit balance. With AI off, use search and get_component, then adapt the code with your own coding agent. Existing drafts remain readable.

A cached or legacy generation call can return ai_subscription_required. Do not retry until AI is enabled. Refresh the client tool list or reconnect after enabling AI. The proxy forwards discovery to the server, so existing proxy versions receive this behavior without an npm update.

server.json mirrors the official dev.21st/mcp registry listing. The registry version is independent of this compatibility package version.

Old tool names → new tool names

The 21st MCP still accepts the legacy Magic tool names and translates them, so agents that remember the old names keep working. Prefer the new names:

Legacy Magic tool 21st MCP tool
21st_magic_component_builder generate
21st_magic_component_inspiration get_inspiration
21st_magic_component_refiner generate (new generation from the refinement prompt)
logo_search search_logo (one query per call)

The current server exposes much more than the old four tools: catalog search across components/themes/templates, paid code retrieval, bookmarks, team libraries, UI generation with variants, profile management, and more. Connect and call tools/list to see the tools available to your account.

Install as a plugin

This repository is also packaged as an agent plugin (MCP server + a UI skill). You don't need to wait for any store, this repo IS a marketplace, add it directly:

# Claude Code
claude plugin marketplace add 21st-dev/magic-mcp   # then: /plugin install 21st

# Grok Build
grok plugin marketplace add 21st-dev/magic-mcp && grok plugin install 21st --trust

# Codex CLI
codex plugin marketplace add 21st-dev/magic-mcp    # then install "21st" from /plugins

Set your API key in the API_KEY_21ST variable (free key at 21st.dev/mcp).

Store listings:

  • Cursor / Grok Bot, install "21st" from the Cursor Marketplace, then set your API_KEY_21ST under Plugins → Configure. Get a key at 21st.dev/mcp.
  • Grok Build, grok plugin install 21st --trust (from the official xAI marketplace), then export API_KEY_21ST.
  • Claude Code, the repo carries a .claude-plugin/ manifest: /plugin install it from any marketplace that lists this repo, or load locally with claude --plugin-dir . and export API_KEY_21ST.

The plugin config expects the API key in the API_KEY_21ST variable in every client.

Links

FAQ

Why did my old Magic MCP stop working? The Magic backend (magic.21st.dev) was superseded by the unified 21st MCP, and all old API keys were reset for security. Update to a fresh key from 21st.dev/mcp, your existing @21st-dev/magic config will then work again through this compatibility proxy, though we recommend switching to npx @21st-dev/cli@latest init.

Is /ui still a thing? Use natural language: ask your agent to search 21st for components (search), or use hosted UI generation (generate) when AI is enabled. The old /ui, /21 trigger phrases were a convention of the legacy tools' descriptions, not the protocol.

Questions about Magic

What is the Magic MCP server?

It's like v0, but in your Cursor / Claude Code / Windsurf: search 10,000+ React/Tailwind components, generate new UI with AI, and publish your own, right from your editor. Magic MCP is now the 21st MCP; this package keeps old configs working. Setup: 21st.dev/mcp. Magic is published by 21st-dev, the company behind the product, on GitHub at 21st-dev/magic-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Magic MCP server?

Add Magic to your AI app's MCP config with the command npx -y @21st-dev/cli. In Claude Code, run claude mcp add --transport stdio magic -- npx -y @21st-dev/cli. To run Magic this way you need Node.js installed.

Does Magic need an API key?

The registry lists no required keys for Magic. Check the Magic README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Magic an official MCP server?

Yes. Magic is published by 21st-dev, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is Magic under?

Magic is released under the ISC license, according to its GitHub repository. The license covers the code of Magic; the service it connects to has its own terms.