Shadcn UI MCP server

Provides tools for managing and installing shadcn/ui components directly through assistants, enabling efficient component discovery, documentation retrieval, and installation command generation with multiple package manager support.
Back to servers
Setup instructions
Provider
heilgar
Release date
May 16, 2025
Stats
10 stars

Shadcn UI MCP Server provides a robust interface for working with Shadcn UI components through the Model Control Protocol. It allows you to list, view documentation for, and install both components and blocks with support for multiple package managers.

Features

Available Tools

The server offers several tools accessible through the Model Control Protocol:

  • list-components: Retrieve all available shadcn/ui components
  • get-component-docs: Access documentation for a specific component
  • install-component: Install a shadcn/ui component
  • list-blocks: Retrieve all available shadcn/ui blocks
  • get-block-docs: Access documentation for a specific block
  • install-blocks: Install a shadcn/ui block

Key Capabilities

  • Component Management: List, document, and install shadcn/ui components
  • Block Management: List, document, and install shadcn/ui blocks
  • Package Manager Support: Works with npm, pnpm, yarn, and bun

Installation

Prerequisites

  • Node.js (v18 or higher)
  • npm, yarn, pnpm, or bun package manager

Claude Desktop Setup

To configure with Claude Desktop, add the server configuration:

MacOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: Edit %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "shadcn-ui-server": {
      "command": "npx",
      "args": ["@heilgar/shadcn-ui-mcp-server"]
    }
  }
}

Windsurf Configuration

Add to your ./codeium/windsurf/model_config.json:

{
  "mcpServers": {
    "shadcn-ui-server": {
      "command": "npx",
      "args": ["@heilgar/shadcn-ui-mcp-server"]
    }
  }
}

Cursor Configuration

Add to your .cursor/mcp.json:

{
  "mcpServers": {
    "shadcn-ui-server": {
      "command": "npx",
      "args": ["@heilgar/shadcn-ui-mcp-server"]
    }
  }
}

Usage Examples

Listing Available Components

Use the list-components tool to see all available shadcn/ui components:

# This would be called through your MCP client
npx @heilgar/shadcn-ui-mcp-server list-components

Getting Component Documentation

To view documentation for a specific component:

# Replace "button" with your desired component
npx @heilgar/shadcn-ui-mcp-server get-component-docs button

Installing Components

Install a component with your preferred package manager:

# Install the button component using npm
npx @heilgar/shadcn-ui-mcp-server install-component button npm

Working with Blocks

List available blocks:

npx @heilgar/shadcn-ui-mcp-server list-blocks

Get documentation for a specific block:

npx @heilgar/shadcn-ui-mcp-server get-block-docs contact-form

Install a block:

npx @heilgar/shadcn-ui-mcp-server install-blocks contact-form

The server will automatically detect your package manager if not specified, or you can explicitly choose between npm, pnpm, yarn, or bun.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "shadcn-ui-server" '{"command":"npx","args":["@heilgar/shadcn-ui-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "shadcn-ui-server": {
            "command": "npx",
            "args": [
                "@heilgar/shadcn-ui-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "shadcn-ui-server": {
            "command": "npx",
            "args": [
                "@heilgar/shadcn-ui-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later