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.
The server offers several tools accessible through the Model Control Protocol:
list-components
: Retrieve all available shadcn/ui componentsget-component-docs
: Access documentation for a specific componentinstall-component
: Install a shadcn/ui componentlist-blocks
: Retrieve all available shadcn/ui blocksget-block-docs
: Access documentation for a specific blockinstall-blocks
: Install a shadcn/ui blockTo 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"]
}
}
}
Add to your ./codeium/windsurf/model_config.json
:
{
"mcpServers": {
"shadcn-ui-server": {
"command": "npx",
"args": ["@heilgar/shadcn-ui-mcp-server"]
}
}
}
Add to your .cursor/mcp.json
:
{
"mcpServers": {
"shadcn-ui-server": {
"command": "npx",
"args": ["@heilgar/shadcn-ui-mcp-server"]
}
}
}
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
To view documentation for a specific component:
# Replace "button" with your desired component
npx @heilgar/shadcn-ui-mcp-server get-component-docs button
Install a component with your preferred package manager:
# Install the button component using npm
npx @heilgar/shadcn-ui-mcp-server install-component button npm
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.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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