Magic logo

Magic

OrganizationPopular
21st-dev

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

Publisher21st-dev
Repositorymagic-mcp
LanguageTypeScript
Forks
458
Stars
5.9K
Available tools
4
Transport typestdio
Categories
LicenseISC
Links
  • Connect tools to AI workflows

    Magic exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 4 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    5.9K stars and 458 forks from the linked repository.

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)

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

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

json
{
  "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 tool21st MCP tool
21st_magic_component_buildergenerate
21st_magic_component_inspirationget_inspiration
21st_magic_component_refinergenerate (new generation from the refinement prompt)
logo_searchsearch_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:

bash
# 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.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "@21st-dev/magic": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest",
        "API_KEY=\"your-api-key\""
      ]
    }
  }
}

Available Tools

  • 21st_magic_component_builder

    "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."

  • logo_search

    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:

    1. When user types "/logo" command (e.g., "/logo GitHub")
    2. 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
  • 21st_magic_component_inspiration

    "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."

  • 21st_magic_component_refiner

    "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."

Use Magic MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Magic is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Magic as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Magic MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "magic": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Magic MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Magic MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Magic to help me with this task?
Magic
Sure. I read it.
Here is what I found using Magic.

Frequently asked questions

What is the Magic MCP server used for?

Magic is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Magic MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Magic with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Magic MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Magic connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Magic MCP to TypingMind?

Magic runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Magic MCP provide in TypingMind?

Magic exposes 4 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Magic MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Magic requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇