Magic Component Platform (MCP)
This server (Magic Component Platform/MCP) enables developers to:
Generate UI Components: Create React components (buttons, inputs, dialogs, tables, forms, banners, cards) using natural language descriptions via
/uicommandsSearch Logos: Find and integrate company logos in JSX, TSX, or SVG formats with support for multiple queries and light/dark themes
Find Component Inspiration: Fetch data and previews from the 21st.dev library without generating new code
Seamless Integration: Generated snippets are automatically integrated into the developer's codebase in customizable, developer-friendly formats with import instructions
Integration with Discord for accessing logo assets through the logo_search tool.
Integration with GitHub for accessing logo assets through the logo_search tool.
Requires Node.js as a runtime environment for the Magic AI Agent, supporting the component generation process.
Generates modern React UI components based on natural language descriptions, supporting customization and integration into existing React codebases.
Integration with SVG technology via SVGL for accessing and utilizing logo assets and brand icons in various formats including raw SVG markup.
Full TypeScript support for type-safe component development, with ability to generate TypeScript React components.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Magic Component Platform (MCP) create a responsive login form with dark mode toggle"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 | codexOr 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.
Related MCP server: 21st.dev Magic AI Agent
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 |
|
|
|
|
|
|
|
|
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 /pluginsSet 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_21STunder Plugins → Configure. Get a key at 21st.dev/mcp.Grok Build —
grok plugin install 21st --trust(from the official xAI marketplace), then exportAPI_KEY_21ST.Claude Code — the repo carries a
.claude-plugin/manifest:/plugin installit from any marketplace that lists this repo, or load locally withclaude --plugin-dir .and exportAPI_KEY_21ST.
The plugin config expects the API key in the API_KEY_21ST variable in every client.
Links
21st MCP setup & API keys: https://21st.dev/mcp
21st CLI on npm: https://www.npmjs.com/package/@21st-dev/cli
21st.dev — discover, publish, and generate UI components: https://21st.dev
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.
Available Tools
4 tools21st_magic_component_builderA
"Use this tool when the user requests a new UI component—e.g., mentions /ui, /21 /21st, or asks for a button, input, dialog, table, form, banner, card, or other React component. This tool ONLY returns the text snippet for that UI component. After calling this tool, you must edit or add files to integrate the snippet into the codebase."
Inputs: message (required), searchQuery (required), absolutePathToCurrentFile (required), absolutePathToProjectDirectory (required), +1 more.
21st_magic_component_inspirationA
"Use this tool when the user wants to see component, get inspiration, or /21st fetch data and previews from 21st.dev. This tool returns the JSON data of matching components without generating new code. This tool ONLY returns the text snippet for that UI component. After calling this tool, you must edit or add files to integrate the snippet into the codebase."
Inputs: message (required), searchQuery (required).
21st_magic_component_refinerA
"Use this tool when the user requests to re-design/refine/improve current UI component with /ui or /21 commands, or when context is about improving, or refining UI for a React component or molecule (NOT for big pages). This tool improves UI of components and returns redesigned version of the component and instructions on how to implement it."
Inputs: userMessage (required), absolutePathToRefiningFile (required), context (required).
logo_searchA
Search and return logos in specified format (JSX, TSX, SVG). Supports single and multiple logo searches with category filtering. Can return logos in different themes (light/dark) if available.
When to use this tool:
When user types "/logo" command (e.g., "/logo GitHub")
When user asks to add a company logo that's not in the local project
Example queries:
Single company: ["discord"]
Multiple companies: ["discord", "github", "slack"]
Specific brand: ["microsoft office"]
Command style: "/logo GitHub" -> ["github"]
Request style: "Add Discord logo to the project" -> ["discord"]
Format options:
TSX: Returns TypeScript React component
JSX: Returns JavaScript React component
SVG: Returns raw SVG markup
Each result includes:
Component name (e.g., DiscordIcon)
Component code
Import instructions
Inputs: queries (required), format (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The first three tools (builder, inspiration, refiner) have overlapping purposes focused on UI components, with unclear boundaries between generating new components and refining existing ones, which could cause misselection. The logo_search tool is distinct but adds to the confusion as it operates in a different domain (logos vs. general UI components), making the set feel disjointed rather than cohesive.
Naming is inconsistent: the first three tools use a verbose '21st_magic_component_' prefix with descriptive suffixes (builder, inspiration, refiner), while logo_search is a simple, unrelated snake_case name. This mixed pattern lacks a predictable convention, making the tool set harder to navigate and remember for agents.
With 4 tools, the count is reasonable and well-scoped for a platform focused on UI components and logos, avoiding bloat. However, the inclusion of logo_search alongside the component tools feels slightly mismatched, as it targets a specific niche (logos) rather than general UI components, slightly reducing appropriateness.
For UI components, there are notable gaps: the tools cover building, inspiration, and refining, but lack operations for updating, deleting, or managing component lifecycles (e.g., no update or delete tools). Logo_search is complete for its domain, but overall, the surface is incomplete for a comprehensive UI component platform, potentially causing agent workarounds.
Maintenance
Related MCP Connectors
UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.
Find UI components and themes, retrieve code, and generate with hosted 21st AI when enabled.
Build and manage your design system with AI: tokens, themes, components, icons, Figma and code.
Design your mobile app UI with AI, then have your coding agent build the real app from it.
Related MCP Servers
- AlicenseBqualityDmaintenanceAI-driven tool that helps developers create beautiful UI components instantly through natural language descriptions, integrating with popular IDEs like Cursor, Windsurf, and VSCode.32ISC
- -licenseAqualityNot gradedmaintenanceA powerful AI-driven tool that helps developers create beautiful, modern UI components instantly through natural language descriptions.412,988 npm-
- AlicenseBqualityDmaintenanceEnables developers to generate beautiful, modern UI components through natural language descriptions. Integrates with popular IDEs to instantly create and customize React components inspired by 21st.dev's component library.44 npmISC
- AlicenseAqualityDmaintenanceEnables AI-powered UI component generation from natural language descriptions, integrating with IDEs like Cursor, Windsurf, and VS Code.412,988 npmISC