Shadcn UI MCP server

Provides a dynamic server for accessing shadcn/ui component documentation by scraping and caching information from the official documentation site and GitHub repository, enabling developers to list, retrieve, and search through React UI component details.
Back to servers
Provider
ymadd
Release date
Mar 09, 2025
Language
TypeScript
Stats
25 stars

This MCP server enables AI assistants to access and retrieve information about shadcn/ui components, including documentation and examples, through the Model Context Protocol.

Installation Options

Using npx (Recommended)

The easiest way to use the shadcn-ui MCP server is with npx:

npx -y shadcn-ui-mcp-server

Manual Installation

If you prefer to install the package locally:

npm install shadcn-ui-mcp-server

Configuration

Claude Desktop Setup

To use with Claude Desktop, configure the MCP server in the appropriate configuration file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Add the following configuration:

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

Windsurf Setup

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

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

Cursor Setup

Add this configuration to your .cursor/mcp.json:

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

Using the MCP Server

The shadcn-ui MCP server provides several tools that AI assistants can use to access shadcn/ui component information:

Available Tools

  • list_shadcn_components: Get a list of all available shadcn/ui components
  • get_component_details: Get detailed information about a specific component
  • get_component_examples: Get usage examples for a specific component
  • search_components: Search for components by keyword

Debugging

To debug the MCP server, use the MCP Inspector:

npm run inspector

This will provide a URL to access debugging tools in your browser, which can be helpful for troubleshooting as MCP servers communicate over stdio.

What You Can Access

The server provides structured information about shadcn/ui components including:

  • Component descriptions
  • Installation instructions
  • Usage examples
  • Props and variants
  • Code samples

All this information is sourced from the official shadcn/ui documentation site and GitHub repository.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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