A streamlined MCP (Model Context Protocol) server that provides shadcn/ui component installation and usage instructions through a simple, natural language interface.
SuperUI MCP simplifies the process of adding shadcn/ui components to your React projects. Instead of searching documentation and copying installation commands, simply ask Claude Code for the components you need, and get instant installation instructions.
This project consists of two independent services:
- MCP server that connects to Claude Code
- 2-stage discovery tools:
list_components+get_component_details - Template tool:
build_landing - Frontend cloning tool:
clone_frontend - Communicates with API server via HTTP
- Express.js backend
- Manages 70+ component library
- Provides ranked search and installation guides
User (Claude Code) β list_components β Candidates
β
Choose component
β
get_component_details β Installation Guide
β
npx install command
- 2-Stage Discovery: Search first, then get details for better accuracy
- 70+ Components: shadcn/ui + AI + Advanced Buttons + Animated Text
- Semantic Search: Ranked search with relevance scoring
- Category Filtering: Filter by form, layout, ai, advanced-button, text, etc.
- Frontend Cloning: Clone any website by iteratively comparing screenshots
- Project-Aware: Automatically detects your project structure
- Installation Commands: Ready-to-use npx commands
- Usage Examples: Import statements and code examples
Form Components (14) button, input, textarea, select, checkbox, radio-group, label, form, switch, slider, combobox, toggle, toggle-group, input-otp
Layout Components (8) card, sheet, dialog, popover, collapsible, resizable, scroll-area, aspect-ratio
Navigation Components (9) tabs, accordion, breadcrumb, navigation-menu, menubar, command, context-menu, dropdown-menu, pagination
Data Display Components (10) table, badge, avatar, progress, skeleton, calendar, date-picker, hover-card, carousel, tooltip
Feedback Components (4) alert, toast, separator, sonner
ai-actions, ai-branch, ai-code-block, ai-conversation, ai-image, ai-inline-citation, ai-loader, ai-message, ai-prompt-input, ai-reasoning, ai-response, ai-sources, ai-suggestion, ai-task, ai-tool, ai-web-preview
glow-button, shimmer-button, magnetic-button, pulse-button, gradient-button, neon-button, shine-button, copy-button, expanding-button, tilt-button
gradient-text, typing-text, shimmering-text, counting-number, sliding-number, rolling-text, rotating-text, splitting-text, highlight-text, writing-text
- Node.js 18+
- VS Code with Claude Code extension installed
- React project (Next.js, Vite, etc.)
- Tailwind CSS configured in your project
git clone <repository-url>
cd magic_to_supercd superui-server
npm install
npx playwright install chromium
npm run buildcd ../superui-mcp
npm install
npm run buildcd superui-server
npm startThe API server will start on http://localhost:3001
Verify it's running:
curl http://localhost:3001/healthExpected response:
{
"status": "OK",
"timestamp": "2025-10-07T10:50:10.128Z",
"version": "1.0.0"
}- Open VS Code
- Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
- Type "Claude Code: Edit MCP Settings"
- Add the SuperUI MCP configuration
The .claude.json file location varies by OS:
macOS/Linux:
~/.claude.json
Windows:
%USERPROFILE%\.claude.json
Add the following configuration:
{
"mcpServers": {
"superui": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/magic_to_super/superui-mcp/dist/index.js"],
"env": {
"API_BASE_URL": "http://localhost:3001"
}
}
}
}Important: Replace /absolute/path/to/magic_to_super with your actual project path.
Example paths:
- macOS:
/Users/username/projects/magic_to_super - Linux:
/home/username/projects/magic_to_super - Windows:
C:\\Users\\username\\projects\\magic_to_super
If you already have other MCP servers configured:
{
"mcpServers": {
"existing-server": {
"type": "stdio",
"command": "node",
"args": ["..."]
},
"superui": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/magic_to_super/superui-mcp/dist/index.js"],
"env": {
"API_BASE_URL": "http://localhost:3001"
}
}
}
}- Close VS Code completely (Cmd+Q on Mac, or close all windows)
- Restart VS Code
- The MCP server will load automatically
- Open Claude Code chat in VS Code
- Check that the MCP server is connected (look for a green indicator)
- You're ready to use SuperUI!
SuperUI uses a 2-stage discovery process for better accuracy:
When you ask for a component, Claude automatically calls list_components to find matching options:
User: "I need an animated button with glow effect"
Claude:
β list_components(query="animated button glow effect")
β Returns: [glow-button, neon-button, shimmer-button, pulse-button, ...]
Claude reviews the candidates and calls get_component_details for the best match:
Claude:
β get_component_details(componentName="glow-button")
β Returns: Full installation guide with commands, imports, and examples
I need a button component for my React app
What happens behind the scenes:
- Claude calls
list_components(query="button") - Finds: button, glow-button, shimmer-button, etc.
- Claude calls
get_component_details(componentName="button") - Provides installation guide
I want an AI chat interface with streaming support
What happens:
list_components(query="ai chat streaming")- Finds: ai-conversation, ai-message, ai-loader, ai-prompt-input
- Claude reviews and selects appropriate components
- Gets details for each selected component
Show me all animated text components
What happens:
list_components(query="animated text", category="text")- Finds: gradient-text, typing-text, shimmering-text, etc.
- Claude presents the list and can get details for any of them
When Claude gets component details, you'll see:
# Glow Button
Button with animated glow effect and neon styling
## π¦ Installation
cd /path/to/your/project
npx shadcn@latest add glow-button
## π Installation Path
The component will be installed to:
`src/components/ui`
## π§ Import Statement
import { GlowButton } from "@/components/button/glow-button"
## π‘ Basic Usage
<GlowButton>Click me</GlowButton>
## π·οΈ Component Details
- **Name**: Glow Button
- **Package**: shadcn-button
- **Category**: Advanced-button
- **Library**: shadcn-button
- **Tags**: button, glow, neon, animated, effect
## π Additional Resources
- [Documentation](https://www.shadcn.io/button/glow-button)
- [Button Components Collection](https://www.shadcn.io/button)
## π‘ Pro Tips
- These buttons include advanced animations and effects
- Test performance on lower-end devices
- Consider using reduced-motion queries for accessibilityThe ranking algorithm prioritizes:
- Exact matches (highest priority)
- Name prefix matches
- Name contains query
- Tag matches
- Description matches
- Multi-word bonuses
Examples:
"button"β Findsbuttonfirst, thenglow-button,shimmer-button"glow"β Findsglow-buttonfirst, thenneon-button(similar tags)"chat interface"β Findsai-conversation,ai-message,ai-prompt-input
SuperUI includes a powerful frontend cloning tool that helps you recreate any website's UI by iteratively comparing screenshots.
- π Playwright-Powered: Server automatically captures screenshots using headless browser
- ποΈ Vision-Based Comparison: LLM uses multimodal capabilities to compare screenshots
- π Iterative Refinement: Continuous improvement through multiple iterations
- π― Pattern Matching: Automatically suggests relevant shadcn/ui components
- π¦ Stateless Design: No session management, LLM controls entire workflow
- π Zero Manual Work: All screenshot capture handled by server
Clone this website: https://example.com
What happens:
- Server captures screenshot of target website
- LLM analyzes structure, colors, components
- Server suggests matching shadcn/ui components
- LLM implements initial version
- Server captures both target and current screenshots
- LLM compares screenshots and identifies differences
- LLM iteratively improves until satisfied
Clone this design (uploads screenshot)
What happens:
- User provides screenshot instead of URL
- Same workflow as above
- No need for target URL
The tool supports 4 request types:
Captures target screenshot and provides analysis prompt.
Parameters:
targetUrl(optional): Website URL to clonetargetScreenshotBase64(optional): Or provide screenshot directlyscreenshotOptions(optional): Viewport size, fullPage, delay, etc.
Returns:
- Analysis prompt with checklist
- Target screenshot as image
Matches components based on your analysis.
Parameters:
targetDescription: Your vision analysis of the target
Returns:
- Recommended components
- Installation commands
- Usage examples
Captures both target and current implementation for comparison.
Parameters:
targetUrlortargetScreenshotBase64: Target to compare againstlocalUrl: Your development server (e.g.,http://localhost:3000)iteration(optional): Current iteration number
Returns:
- Comparison checklist prompt
- Target screenshot
- Current implementation screenshot
Provides specific improvement suggestions based on differences.
Parameters:
differences: Array of differences found during comparisoniteration(optional): Current iteration number
Returns:
- Priority-based improvement guide
- Specific suggestions for each difference
- Next steps
Create a .env file in superui-server/:
PORT=3001
NODE_ENV=development
CORS_ORIGINS=http://localhost:3000,http://localhost:3001Set in .claude.json:
{
"env": {
"API_BASE_URL": "http://localhost:3001",
"TIMEOUT": "30000"
}
}If you need to use a different port:
- Update
PORTin API server.env - Update
API_BASE_URLin.claude.json - Restart both servers
Symptoms:
- Claude Code doesn't respond to component requests
- "Tool not available" errors
Solutions:
-
Check VS Code Output:
- View β Output (Cmd+Shift+U)
- Select "Claude Code" from dropdown
- Look for error messages
-
Verify
.claude.json:# Check JSON syntax cat ~/.claude.json | jq
-
Check MCP server path:
# Verify file exists ls /path/to/magic_to_super/superui-mcp/dist/index.js -
Rebuild MCP server:
cd superui-mcp npm run build -
Restart VS Code completely
Symptoms:
- "API Server Unavailable" messages
- Fallback installation instructions
Solutions:
-
Check API server status:
curl http://localhost:3001/health
-
Restart API server:
cd superui-server npm start -
Check if port 3001 is in use:
# macOS/Linux lsof -i :3001 # Windows netstat -ano | findstr :3001
-
Check API server logs for errors
Symptoms:
- "Component not found" messages
Solutions:
-
Check available components:
curl http://localhost:3001/api/component/list
-
Search for component:
curl "http://localhost:3001/api/component/search?q=button" -
Try using exact component name from the supported list
Solutions:
- Make sure you're in the correct project directory
- Claude Code automatically detects your VS Code workspace path
- Check the installation guide for the correct path
GET http://localhost:3001/healthPOST http://localhost:3001/api/component/list
Content-Type: application/json
{
"query": "animated button glow",
"category": "advanced-button", // optional
"limit": 10 // optional, default: 10
}Response:
{
"results": [
{
"name": "glow-button",
"displayName": "Glow Button",
"description": "Button with animated glow effect",
"category": "advanced-button",
"library": "shadcn-button"
}
],
"metadata": {
"query": "animated button glow",
"category": "all",
"count": 5,
"timestamp": "2025-10-08T...",
"version": "1.0.0"
}
}POST http://localhost:3001/api/component/details
Content-Type: application/json
{
"componentName": "glow-button",
"absolutePathToCurrentFile": "/path/to/file.tsx",
"absolutePathToProjectDirectory": "/path/to/project"
}Response:
{
"result": "# Glow Button\n\nButton with animated glow effect...",
"metadata": {
"componentName": "glow-button",
"timestamp": "2025-10-08T...",
"version": "1.0.0"
}
}POST http://localhost:3001/api/component
Content-Type: application/json
{
"searchQuery": "button",
"message": "I need a button",
"absolutePathToCurrentFile": "/path/to/file.tsx",
"absolutePathToProjectDirectory": "/path/to/project",
"standaloneRequestQuery": "I need a button component"
}GET http://localhost:3001/api/component/search?q=buttonGET http://localhost:3001/api/component/list?category=formGET http://localhost:3001/api/component/buttonPOST http://localhost:3001/api/clone
Content-Type: application/json
{
"requestType": "initial_analysis",
"targetUrl": "https://example.com",
"screenshotOptions": {
"fullPage": true,
"width": 1920,
"height": 1080,
"delay": 2000
}
}Request Types:
initial_analysis- Capture and analyze target screenshotcomponent_suggestion- Get component recommendationscompare_screenshots- Compare target vs currentiteration_guide- Get improvement suggestions
Response:
{
"text": "Analysis prompt and instructions...",
"screenshots": {
"target": {
"data": "base64-encoded-image",
"mimeType": "image/png",
"metadata": { "width": 1920, "height": 1080, "url": "...", "timestamp": "..." }
},
"current": {
"data": "base64-encoded-image",
"mimeType": "image/png",
"metadata": { ... }
}
},
"components": [ ... ],
"installations": [ "npx shadcn@latest add button", ... ],
"metadata": {
"requestType": "initial_analysis",
"timestamp": "2025-10-12T...",
"version": "1.0.0"
}
}POST http://localhost:3001/api/clone/screenshot
Content-Type: application/json
{
"url": "https://example.com",
"options": {
"fullPage": true,
"width": 1920,
"height": 1080
}
}magic_to_super/
βββ superui-mcp/ # MCP Server (v2.0.0)
β βββ src/
β β βββ index.ts # Main server
β β βββ tools/
β β β βββ list-components.ts # Stage 1: Component discovery
β β β βββ get-components.ts # DEPRECATED
β β β βββ get-component-details.ts # Stage 2: Component details
β β β βββ build-landing.ts # Template builder
β β β βββ clone-frontend.ts # NEW: Frontend cloning
β β βββ utils/
β β βββ base-tool.ts
β β βββ config.ts
β β βββ http-client.ts
β βββ dist/ # Built files
β βββ package.json
β βββ tsconfig.json
β
βββ superui-server/ # API Server
βββ src/
β βββ index.ts # Express server
β βββ routes/
β β βββ component.ts # Component endpoints
β β βββ landing.ts # Template endpoints
β β βββ clone.ts # Clone endpoints
β βββ services/
β β βββ component-service.ts # Component logic
β β βββ landing-service.ts # Template logic
β β βββ clone-service.ts # Clone logic
β β βββ screenshot-service.ts # Playwright screenshots
β βββ utils/
β βββ component-finder.ts # 70+ components database
β βββ component-matcher.ts # Pattern matching
β βββ clone-prompts.ts # Analysis prompts
β βββ landing-conversation.ts # Template conversation
βββ dist/ # Built files
βββ package.json
βββ tsconfig.json
cd superui-server
npm run devcd superui-mcp
npm run dev- Edit
superui-server/src/utils/component-finder.ts - Add component to
COMPONENT_LIBRARYobject:"new-component": { componentName: "new-component", displayName: "New Component", packageName: "@radix-ui/react-new-component", importStatement: `import { NewComponent } from "@/components/ui/new-component"`, usage: `<NewComponent />`, description: "Description of the component", category: "form", tags: ["tag1", "tag2", "tag3"] }
- Rebuild and restart API server
# Test API server health
curl http://localhost:3001/health
# Test component search
curl "http://localhost:3001/api/component/search?q=button"
# Test component retrieval
curl -X POST http://localhost:3001/api/component \
-H "Content-Type: application/json" \
-d '{"searchQuery": "button", "message": "I need a button"}'cd superui-server
npm run build
NODE_ENV=production npm start# Install PM2
npm install -g pm2
# Start API server
cd superui-server
pm2 start dist/index.js --name superui-api
# Start on boot
pm2 startup
pm2 saveCreate Dockerfile in superui-server/:
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY dist ./dist
EXPOSE 3001
CMD ["npm", "start"]Build and run:
docker build -t superui-api .
docker run -p 3001:3001 superui-api| Feature | Magic MCP | SuperUI MCP |
|---|---|---|
| Tools | 4 tools | 1 tool (get_component) |
| Complexity | High (callback server, browser) | Low (simple HTTP API) |
| Dependencies | External APIs (21st.dev, SVGL) | Self-contained API server |
| Installation | Auto file generation | npx command guidance |
| Customization | Limited | Full control over components |
- shadcn/ui Documentation
- Radix UI Documentation
- Tailwind CSS Documentation
- MCP (Model Context Protocol)
- Claude Code Extension
MIT License
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues and questions:
- Check the API server logs
- Check VS Code Output panel (Claude Code)
- Verify MCP server build status
- Check
.claude.jsonsyntax - Open an issue on GitHub
- Node.js 18+ installed
- Claude Code extension installed in VS Code
- Repository cloned
- API server installed and built
- Playwright chromium installed (
npx playwright install chromium) - MCP server installed and built
- API server running on port 3001
-
.claude.jsonconfigured with correct absolute path - VS Code restarted
- Tested with "I need a button component"
- Received installation instructions
Ready to go!
- Ask Claude Code for UI components and get instant installation instructions! π
- Clone any website with "Clone https://example.com" π¨
- Build landing pages with conversational templates! π