Skip to main content
mcpSource-backed

Magic MCP Server for Claude

Magic MCP by 21st.dev lets Claude generate polished, production-ready UI components from natural language, returning React and Tailwind code you can drop straight into a project.

by 21st.dev · submitted by glorydavid03023·added 2026-06-03·5,129 source repo stars·
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://github.com/21st-dev/magic-mcp, https://21st.dev
Safety notes
Generates UI code that is inserted into your project; review the output before committing or shipping it., Makes outbound network requests to the 21st.dev Magic service to produce components.
Privacy notes
The component descriptions and prompts you provide are sent to the 21st.dev Magic service to generate code, so avoid embedding secrets in them., The Magic API key is a credential; store it securely and do not commit it to source control.
Author
21st.dev
Submitted by
glorydavid03023
Claim status
unclaimed
Last verified
2026-06-03

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

CLI install

Copy-ready — paste the snippet to get started.

3 minutes

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Prerequisite readiness

Prerequisite readiness

4 prerequisites to line up before setup. Have accounts and credentials ready first.

0/4 ready
Account & credentials1Install & runtime1Network & hosting1General13 minutes

Safety & privacy surface

Safety & privacy surface

2 safety and 2 privacy notes across 3 risk areas. Review closely: credentials & tokens, network access.

3 areas
  • SafetyGeneralGenerates UI code that is inserted into your project; review the output before committing or shipping it.
  • SafetyNetwork accessMakes outbound network requests to the 21st.dev Magic service to produce components.
  • PrivacyCredentials & tokensThe component descriptions and prompts you provide are sent to the 21st.dev Magic service to generate code, so avoid embedding secrets in them.
  • PrivacyCredentials & tokensThe Magic API key is a credential; store it securely and do not commit it to source control.

Safety notes

  • Generates UI code that is inserted into your project; review the output before committing or shipping it.
  • Makes outbound network requests to the 21st.dev Magic service to produce components.

Privacy notes

  • The component descriptions and prompts you provide are sent to the 21st.dev Magic service to generate code, so avoid embedding secrets in them.
  • The Magic API key is a credential; store it securely and do not commit it to source control.

Prerequisites

  • Node.js 18+ and npx available (verify with: npx --version)
  • A 21st.dev Magic API key (create one at https://21st.dev/magic/console)
  • Claude Code or Claude Desktop with MCP support
  • Internet access so the server can reach the 21st.dev Magic service

Schema details

Install type
cli
Troubleshooting
Yes
Source repository stats
Scope
Source repo
Stars
5,129 source repo stars
Forks
368
Updated
2026-06-15T08:47:47Z
Collection metadata
Estimated setup
3 minutes
Difficulty
beginner
Tool listing metadata
Full copyable content
{
  "magic": {
    "command": "npx",
    "args": ["-y", "@21st-dev/magic@latest"],
    "env": {
      "API_KEY": "${API_KEY}"
    }
  }
}

About this resource

Content

Magic turns natural-language descriptions into polished UI components without leaving your editor. Ask for a pricing table, a sign-in form, or a navigation bar, and the server returns modern React and Tailwind code ready to paste into a project. It is aimed at speeding up frontend work: instead of hand-writing boilerplate markup and styles, you describe the component you want and refine the generated result. The server exposes generation as an MCP tool, so Claude can call it as part of a normal coding conversation.

Features

  • Generate production-ready UI components from plain-language descriptions.
  • Returns React and Tailwind code you can drop directly into a project.
  • Covers common building blocks like buttons, forms, cards, and layouts.
  • Keeps you in the editor rather than copying snippets from a separate site.
  • Runs as a standard stdio MCP server that installs into Claude Code and Claude Desktop with one command.
  • Maintained by 21st.dev as the official Magic integration.

Use Cases

  • Scaffold a new component quickly instead of writing boilerplate by hand.
  • Produce a first-draft layout to iterate on with Claude.
  • Generate consistent Tailwind markup for repetitive UI elements.
  • Prototype a page section during early frontend development.
  • Hand Claude a design description and get usable code back in the same conversation.

Installation

Claude Code

  1. Make sure Node.js 18+ is installed (verify with npx --version).
  2. Create a Magic API key at https://21st.dev/magic/console.
  3. Run: claude mcp add magic --env API_KEY=your-api-key -- npx -y @21st-dev/magic@latest
  4. Verify the server is registered: claude mcp list

Claude Desktop

  1. Create a Magic API key at https://21st.dev/magic/console.
  2. Open your Claude Desktop configuration file.
  3. Add the Magic server to the mcpServers section using the configuration below, with API_KEY set from your environment or replaced by your key in the env object.
  4. Restart Claude Desktop and confirm the server appears.

Configuration

{
  "magic": {
    "command": "npx",
    "args": ["-y", "@21st-dev/magic@latest"],
    "env": {
      "API_KEY": "${API_KEY}"
    }
  }
}

Examples

Generate a component

Describe what you want and let Magic produce the code.

"Create a responsive pricing section with three tiers using React and Tailwind."

Build a form

Ask for a specific input layout.

"Generate a sign-in form with email and password fields, a remember-me checkbox, and a submit button."

Iterate on a result

Refine the generated component in the same conversation.

"Take that card component and add a hover state and a small badge in the top-right corner."

Security

  • Magic generates code that is inserted into your project. Always review the output before committing or shipping it, just as you would review any generated code.
  • The server makes outbound requests to the 21st.dev Magic service; the prompts and component descriptions you provide are sent there to generate results.
  • The Magic API key is a credential. Keep it out of source control and shared configs, and rotate it if it may have been exposed.
  • Avoid placing secrets or private data in component descriptions, since they are transmitted to the service.

Troubleshooting

Authentication or invalid API key errors

Confirm the API key from https://21st.dev/magic/console is correct and active, and that it is set via --env API_KEY=... or the configuration env object. Regenerate the key if needed.

npx cannot resolve the package

Verify Node.js 18+ and npx are installed (npx --version). Networks that block the npm registry will prevent npx -y @21st-dev/magic@latest from resolving.

Generation requests fail or time out

Check internet access to the 21st.dev Magic service. Transient rate limiting can also cause failures; retry after a short wait and review your plan limits.

Server not listed in Claude Code

Re-run the claude mcp add magic ... command, then claude mcp list. Confirm the API_KEY environment value was included and that the server was added to the scope (project versus user) you are running in.

Source citations

Add this badge to your README

Show that Magic MCP Server for Claude is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/mcp/magic-mcp-server.svg)](https://heyclau.de/entry/mcp/magic-mcp-server)

How it compares

Magic MCP Server for Claude side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

1 trust signal differ across this comparison (Submitter).

Field

Magic MCP by 21st.dev lets Claude generate polished, production-ready UI components from natural language, returning React and Tailwind code you can drop straight into a project.

Open dossier

Browse and install Magic UI animated React components from Claude — search the library by name or keyword, retrieve full installation details for any entry, and get guided setup instructions — with the official Magic UI MCP server.

Open dossier

MCP server that gives Claude access to shadcn/ui component source, demos, blocks, metadata, and multi-framework implementations.

Open dossier

Storybook MCP addon that lets Claude and other MCP clients inspect component documentation, generate stories, preview UI states, and run Storybook tests against a local Storybook project.

Open dossier
Next steps
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceSource-backedSource-backedSource-backedSource-backed
SubmitterDiffersglorydavid03023oktofeesh1oktofeesh1
Install riskReview firstReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
Brand
Categorymcpmcpmcpmcp
SourceSource-backedSource-backedSource-backedSource-backed
Author21st.devMagic UIJpisniceStorybook
Added2026-06-032026-06-182026-06-052026-06-03
Platforms
Harness
Source repo5.1k repo stars
Safety notesGenerates UI code that is inserted into your project; review the output before committing or shipping it. Makes outbound network requests to the 21st.dev Magic service to produce components.The server is read-only — it queries the Magic UI registry but does not install files into your project automatically. Installation of components into your project is guided by Claude based on retrieved specs — you apply the changes.shadcn/ui MCP Server retrieves component source, demos, blocks, metadata, dependencies, and repository structures from upstream component repositories. Generated component suggestions can add UI dependencies, copy code, or change frontend architecture when acted on by an agent. Review copied component code, dependency additions, styling choices, accessibility behavior, and framework-specific assumptions before committing changes. SSE and Docker deployment modes need normal network, CORS, and host binding review before multi-client or production use.Storybook's MCP server and AI manifests are preview capabilities, and Storybook states that the API may change in future releases. The MCP server can guide an agent to generate components, write stories, preview states, and run tests. Review generated UI, stories, tests, and source changes before committing or shipping them. Storybook docs and stories are project-controlled input. Treat component docs, story text, examples, and addon output as untrusted context that can contain stale guidance or prompt-injection-like instructions. `run-story-tests` can execute interaction tests and browser-based component code. Do not run untrusted stories or tests with secrets, production credentials, or privileged browser sessions available. The default MCP endpoint is local to the Storybook dev server. Do not expose the local Storybook MCP endpoint or equivalent Storybook preview URLs to networks or tunnels unless access control and data exposure have been reviewed. When multiple Storybooks or MCP servers are configured, use descriptive server names so the model does not confuse design systems, toolsets, or component libraries.
Privacy notesThe component descriptions and prompts you provide are sent to the 21st.dev Magic service to generate code, so avoid embedding secrets in them. The Magic API key is a credential; store it securely and do not commit it to source control.Registry queries and component names are sent to the Magic UI registry API. No personal data or project content is sent externally.Component names, framework choices, GitHub API tokens, prompts, tool arguments, and generated UI code may be visible to the MCP client and model provider. UI prompts can reveal unreleased product workflows, internal design systems, customer-facing screens, or implementation plans. Treat GitHub personal access tokens as secrets and avoid pasting them into prompts, logs, screenshots, or shared configuration snippets.Storybook MCP tool results can expose component names, props, examples, docs, stories, design-system conventions, theme tokens, UI states, test results, accessibility findings, and story preview links. Storybook stories and previews can contain mock customer data, screenshots, private workflows, unreleased product UI, internal brand details, or business logic visible through component examples. Test output, accessibility reports, browser console logs, agent transcripts, screenshots, and generated summaries can retain Storybook content outside the normal repository and design-system access controls. Composed Storybooks can aggregate documentation and stories from multiple component libraries, so verify which composed sources are exposed before connecting an agent. Keep secrets, real user records, internal API tokens, and production credentials out of stories, play functions, test fixtures, and local Storybook environments used by AI agents.
Prerequisites
  • Node.js 18+ and npx available (verify with: npx --version)
  • A 21st.dev Magic API key (create one at https://21st.dev/magic/console)
  • Claude Code or Claude Desktop with MCP support
  • Internet access so the server can reach the 21st.dev Magic service
  • Node.js with `npx` available.
  • A React project using Tailwind CSS (Magic UI components are Tailwind-based).
  • An MCP client such as Claude Code or Claude Desktop.
  • Node.js and npx available to the MCP client runtime.
  • Optional GitHub personal access token for higher GitHub API rate limits.
  • A selected framework target such as React, Svelte, Vue, or React Native.
  • A project where copied component code and dependencies can be reviewed before use.
  • React Storybook project, because Storybook documents the MCP server and manifests as preview AI capabilities currently limited to React projects.
  • Node.js package manager access for installing `@storybook/addon-mcp`.
  • Running Storybook dev server, with the local MCP endpoint captured as `STORYBOOK_LOCAL_MCP_URL`.
  • MCP-compatible agent or editor that can connect to local HTTP MCP servers, such as Claude Code, Gemini CLI, OpenAI Codex, VS Code Copilot, or another compatible client.
Install
claude mcp add magic --env API_KEY=your-api-key -- npx -y @21st-dev/magic@latest
npx @magicuidesign/cli@latest install claude
npx @jpisnice/shadcn-ui-mcp-server
npx storybook add @storybook/addon-mcp
Config
{
  "mcpServers": {
    "magic": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "${API_KEY}"
      },
      "type": "stdio"
    }
  }
}
{
  "mcpServers": {
    "magic-ui": {
      "command": "npx",
      "args": ["-y", "@magicuidesign/mcp@latest"]
    }
  }
}
{
  "mcpServers": {
    "shadcn": {
      "command": "npx",
      "args": ["@jpisnice/shadcn-ui-mcp-server"]
    }
  }
}
{
  "mcpServers": {
    "storybook": {
      "type": "http",
      "url": "STORYBOOK_LOCAL_MCP_URL"
    }
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.