# 21st MCP server

> Enables AI clients to search thousands of React and Tailwind components and generate new UI directly within your code editor.

- Repository: https://github.com/21st-dev/magic-mcp
- Page: https://hostedmcp.org/servers/21st-dev/magic-mcp
- Transport: stdio
- Stars: 6555
- License: ISC

## Install

### Claude Code

```sh
claude mcp add magic-mcp -- npx -y @21st-dev/magic
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "magic-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"magic-mcp","type":"stdio","command":"npx","args":["-y","@21st-dev/magic"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add magic-mcp -- npx -y @21st-dev/magic
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.magic-mcp]
command = "npx"
args = ["-y", "@21st-dev/magic"]
```

### Gemini CLI

```sh
gemini mcp add -s user magic-mcp npx -- -y @21st-dev/magic
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "magic-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@21st-dev/magic"
      ]
    }
  }
}
```

## Tools (1)

- `logo_search`

## FAQ

### Why did my old Magic MCP stop working?

The Magic backend was replaced by the unified 21st MCP and all old API keys were reset. You can use a new key with the existing config via a compatibility proxy.

### How can I check if AI generation is enabled?

You can check the `get_usage.aiGenerationEnabled` property to see if you have access to the generate and iterate_generation tools.

### Can I still use the old Magic tool names?

Yes, the 21st MCP accepts legacy Magic tool names and translates them to the new tool names automatically.
