← MCP servers · 21st-dev

Magic

SAFEgrade B · trust 89/100

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

21stclaudecursormcpmodel context protocolreacttailwindcssui components

Overview

From the repository's own README, as read at the audited commit.

# 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](https://21st.dev/mcp). This package remains published as a thin compatibility proxy so old configs keep working.## Install the 21st MCP (recommended)```bashnpx @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](https://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](https://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 accessBuilder 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 AIcredit balance. With AI off, use `search` and `get_component`, then adapt thecode with your own coding agent. Existing drafts remain readable.A cached or legacy generation call can return `ai_subscription_required`. Donot retry until AI is enabled. Refresh the client tool list or reconnect afterenabling AI. The proxy forwards

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.

claude-code
claude mcp add magic --env API_KEY=${API_KEY} --env API_KEY_21ST=${API_KEY_21ST} --env TWENTY_FIRST_API_KEY=${TWENTY_FIRST_API_KEY} -- npx -y @21st-dev/[email protected]
claude-desktop
{
  "mcpServers": {
    "magic": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/[email protected]"
      ],
      "env": {
        "API_KEY": "${API_KEY}",
        "API_KEY_21ST": "${API_KEY_21ST}",
        "TWENTY_FIRST_API_KEY": "${TWENTY_FIRST_API_KEY}"
      }
    }
  }
}

Details

Source
21st-dev/magic-mcp
npm
@21st-dev/magic@0.2.3
Transports
streamable-http
Credentials it reads
API_KEYAPI_KEY_21STTWENTY_FIRST_API_KEY
Tools
Registered at runtime; the list could not be read from source.
License
ISC
Stars
5,854 · pushed 3d ago

Trust audit

Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codePASS
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
declared (1 observation(s))
Shell
none-observed
Dependencies
not all pinned
Secrets in source
none-found

Findings (2)

LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
@types/node, shx, typescript
Why it matters. 3 dependency range(s) float
Fix. pin exact versions or ship a lockfile
LOWInventory / provenance · mcp.no_tools_extracted · CWE-1104
server.json
Why it matters. the tool list is enumerated at runtime by tools/list, not declared in source
Fix. the page says so rather than showing an empty table

Gates applied: no_behavioural_pass.

Audited 2026-09-13 · audit v0.4.0 · source sha c75f0aabca59 · full audit: observations/trust-audit/mcp-server/21st-dev__magic-1.json · Report an issue or request a re-scan

Audit history

DateSourceVerdictGradeScoreChange
2026-09-13c75f0aabca59SAFEB89first audit

Alternatives

Other servers in the same categories, safer ones first.

Questions

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

Is Magic safe to connect to an agent?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.

What credentials does Magic need?

It reads API_KEY, API_KEY_21ST and TWENTY_FIRST_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.

How does Magic run?

It speaks streamable-http, so it runs as a service you connect to over the network. It is published on npm as @21st-dev/magic at 0.2.3.

How current is this page?

The grade is for one exact copy of the source (c75f0aabca59), read on 2026-09-13. The repository is watched and re-audited when it changes.

Provenance: OBSERVED · read 2026-09-13 · job trust-audit-2026-09-13