Server profile

21st.dev Magic AI Agent MCP Server

21st.dev Magic AI Agent turns natural-language requests into customizable UI components inside supported coding tools. It combines component-library inspiration, previews, TypeScript support, and brand assets for interface development.

Server facts

21st.dev Magic AI Agent MCP Server

Project

Author
21st-dev
License
Not specified

Tech

Runtime / language
nodeTypeScript
Transports
stdio
Remote available
No
Authentication
Not specified

Activity

GitHub stars
6,063
Last commit
Data as of

Tags

  • Brand Assets
  • Ide Integration
  • React
  • Typescript
  • Ui Generation

Overview

21st.dev Magic AI Agent focuses on building interface components from conversational requests. A developer uses the /ui instruction in an AI agent chat, describes the desired component, and lets the editor invoke Magic. The resulting component is added to the project and remains editable. The README describes inspiration from the 21st.dev component collection, real-time previews, TypeScript support, and access to logos and brand assets through SVGL. It also says the agent limits changes to files associated with generated components and follows the surrounding project's style and organization. The intended workflow is component creation within an existing development environment, not a replacement for the rest of the application.

Setup requires Node.js and a supported editor or client, plus an API key created in the Magic console. The README provides CLI installation guidance and manual npx configurations for MCP clients. Cursor, Windsurf, VS Code, and Cline appear among the supported development environments, with Cline integration marked beta. The document also labels Magic itself beta and marks enhancement of existing components with advanced features and animations as forthcoming. Generated components can be customized, and the FAQ advises splitting especially complex interfaces into smaller pieces. Monthly generation limits are mentioned, although exact allowances are not stated. Named MCP tool identifiers are not supplied in this input.

Install & configure

Requirements

  • Node.js, with the latest LTS recommended
  • A supported IDE or MCP client
  • An API key from the Magic console
Documented launch / install command
npx -y @21st-dev/magic@latest

This follows the README's manual VS Code server configuration. Other supported clients also have installation instructions. Named MCP tools are not stated in the README.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Desktop configuration
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "<your 21st.dev Magic API key>"
      }
    }
  }
}

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

Cursor configuration
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "<your 21st.dev Magic API key>"
      }
    }
  }
}

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "magic-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "<your 21st.dev Magic API key>"
      }
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

Windsurf configuration
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "<your 21st.dev Magic API key>"
      }
    }
  }
}

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "magic-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic@latest"
      ],
      "env": {
        "API_KEY": "<your 21st.dev Magic API key>"
      }
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

No individual tool names were confirmed in the source material. Check the repository for its current tool list.

Names, permissions, and defaults can change. Check the current upstream documentation before granting access.

Use cases

  • Generate a UI component from a description in an editor chat.
  • Customize generated React component styling and behavior.
  • Preview a component while iterating on its design.
  • Use SVGL logos and brand assets in interface work.

Strengths

  • Creates editable components directly in a project.
  • Provides TypeScript support and real-time previews.
  • Integrates component inspiration and brand asset access.

Limitations

  • Requires an API key and a supported development environment.
  • The README labels the product beta and some enhancement features as coming soon.
  • Generation limits are mentioned without exact allowances.

Frequently asked questions

The documented workflow uses /ui followed by a component description in the agent chat, then invokes Magic through the editor.

Yes. Generated components are editable, including their presentation, functionality, and behavior.

The README says changes are confined to files associated with generated components and follow the project's existing structure.

The feature list marks advanced component enhancement and animation improvements as coming soon.

Independent listing, not an affiliation or security review. Grant the least access needed and verify the upstream instructions before running code.

Related MCP servers

Framelink MCP for Figma

Design & Creative

Framelink supplies coding agents with selected Figma metadata and image assets. Developers can bring a design link into an editor conversation and use its underlying layout details while implementing an interface.

DaVinci Resolve MCP Server

Design & Creative

Control DaVinci Resolve Studio from an AI assistant through its scripting API. Editing, grading, media analysis, render preparation, and a local control panel support post-production workflows.

FreeCAD MCP

Design & Creative

Control FreeCAD from an assistant through an addon and Python MCP server. Tools create and inspect CAD objects, run Python, use library parts, capture views, and execute existing FEM analyses.

Photoshop MCP Server

Design & Creative

Photoshop MCP Server lets assistants control a locally installed Photoshop through photoshop-python-api. It supports document work, layers, and session inspection on Windows only.

Draw.io MCP Server

Design & Creative

Draw.io MCP Server gives assistants control over diagrams in a browser. It can host its own editor or connect through an extension, with explicit document and page selection for larger diagramming sessions.

After Effects MCP Server

Design & Creative

After Effects MCP Server routes assistant commands into an open Adobe After Effects session. A bridge panel enables composition and layer work, animation controls, and JavaScript execution inside the application.