SuperAPI AI Directory

magic-mcp

Create UI components inspired by 21st.dev design engineers.

Open website

About this tool

21st MCP (formerly Magic MCP) is a UI component-related MCP server positioned as "like v0, but running inside your Cursor / Claude Code / Windsurf." It can search 10,000+ React/Tailwind components within the editor, generate new UI with AI, and publish your own components.

Purpose and Background Magic MCP has been renamed to 21st MCP. The original Magic MCP server (@21st-dev/magic) has been replaced by the unified 21st MCP, which is installed via the 21st CLI, with the configuration entry point at 21st.dev/mcp. The package in this repository is still published as a "thin compatibility proxy" so that old configurations continue to work.

Main Capabilities

  • Component retrieval: search across the components, themes, and templates catalog (search), and also fetch specific components (get_component).
  • AI generation: when AI access is enabled, the server provides generation capabilities such as generate and iterate_generation, allowing you to generate UI and variants with AI.
  • Catalog and account features: the current server exposes far more capabilities than the old four tools, including paid code retrieval, bookmarks, team libraries, profile management, and more.
  • Legacy tool name compatibility: 21st MCP still accepts the old Magic tool names and translates them, so agents that remember the old names can still work; the official recommendation is to prefer the new names.

Usage It is recommended to install 21st MCP via the 21st CLI; see 21st.dev/mcp for configuration. It can also be added manually—it is an ordinary HTTP MCP server. The API key must be obtained at 21st.dev/mcp; old Magic API keys have been reset, and keys issued by the old console are no longer usable and must be regenerated.

Legacy configuration compatibility: npx -y @21st-dev/magic@latest API_KEY="..." still works as of v0.2.0; it is a small stdio proxy that forwards every MCP message to the 21st MCP server. Existing mcp.json entries can continue to run, but they actually connect to the same server as the 21st CLI, and the available tools depend on the authenticated account.

Accepted forms of the API key include: positional argument API_KEY="...", --API_KEY=..., /API_KEY:..., -API_KEY ..., as well as the environment variables TWENTY_FIRST_API_KEY or API_KEY_21ST.

It can also be installed as a plugin: the repository itself is a marketplace (MCP server + one UI skill), so there is no need to wait for any store—you can add it directly. The API key must be set in the API_KEY_21ST variable (a free key is available at 21st.dev/mcp). Installation methods for the relevant clients:

  • Cursor / Grok Bot: install "21st" from the Cursor Marketplace, then set API_KEY_21ST in Plugins → Configure.
  • Grok Build: grok plugin install 21st --trust (from the official xAI marketplace), then export API_KEY_21ST.
  • Claude Code: the repository includes a .claude-plugin/ manifest, so you can run /plugin install from any marketplace that lists the repository, or load it locally with claude --plugin-dir ., then export API_KEY_21ST. Plugin configuration across all clients expects the API key to be in the API_KEY_21ST variable.

Use Cases Suitable for use in MCP-supporting editors or agent clients such as Cursor, Claude Code, Windsurf, Grok Bot, and Grok Build, to retrieve, generate, and reuse React/Tailwind UI components while writing code, or to publish your own components.

Limitations and Notes

  • Builder component access does not enable hosted 21st AI. Only when AI access is enabled will the server list generate and iterate_generation. You can use get_usage.aiGenerationEnabled to check whether AI access is enabled; this field reflects access permission, not remaining AI quota.
  • When AI is not enabled,You can use search and get_component, then rewrite the code with your own coding agent; existing drafts can still be read.
  • Cached or older-generation calls may return ai_subscription_required; do not retry before enabling AI; after enabling AI, refresh the client tool list or reconnect. Because the proxy forwards discovery requests to the server, existing proxy versions can get this behavior without an npm update.
  • server.json corresponds to the official dev.21st/mcp registry entry; the registry version and this compatibility package version are independent of each other.
  • Regarding the old /ui and /21 trigger phrases: that was only a convention in the old tool description, not part of the protocol; natural language should now be used, letting the agent search for 21st components (search), or use hosted UI generation (generate) when AI is enabled.

Links

  • 21st MCP setup and API key:https://21st.dev/mcp
  • 21st CLI(npm):https://www.npmjs.com/package/@21st-dev/cli
  • 21st.dev:https://21st.dev