Integrate the shadcn/ui MCP Server with Cursor for AI-powered component development.
-
Open Cursor Settings:
- Go to Settings (Cmd/Ctrl + ,)
- Search for "MCP" or "Model Context Protocol"
-
Add MCP Server Configuration:
{
"mcpServers": {
"shadcn-ui": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}Create a .cursorrules file in your project root:
{
"mcpServers": {
"shadcn-ui": {
"command": "npx",
"args": ["@jpisnice/shadcn-ui-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}{
"mcpServers": {
"shadcn-ui": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}{
"mcpServers": {
"shadcn-ui-svelte": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"svelte",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}{
"mcpServers": {
"shadcn-ui-vue": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"vue",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}{
"mcpServers": {
"shadcn-ui-react-native": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"react-native",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}Configure multiple frameworks for comparison:
{
"mcpServers": {
"shadcn-ui-react": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"react",
"--github-api-key",
"ghp_your_token_here"
]
},
"shadcn-ui-svelte": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"svelte",
"--github-api-key",
"ghp_your_token_here"
]
},
"shadcn-ui-vue": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"vue",
"--github-api-key",
"ghp_your_token_here"
]
},
"shadcn-ui-react-native": {
"command": "npx",
"args": [
"@jpisnice/shadcn-ui-mcp-server",
"--framework",
"react-native",
"--github-api-key",
"ghp_your_token_here"
]
}
}
}- Open Cursor Chat (Cmd/Ctrl + L)
- Ask for components:
"Show me the shadcn/ui button component" "Get the dashboard-01 block implementation" "List all available components"
- Use Cursor's AI features:
"Generate a login form using shadcn/ui components" "Create a dashboard with shadcn/ui blocks" "Show me how to use the card component"
"Compare the button component implementations between React and Svelte"
"Show me the Vue version of the card component"
"Get the React dialog component with TypeScript"
Use environment variables for better security:
{
"mcpServers": {
"shadcn-ui": {
"command": "npx",
"args": ["@jpisnice/shadcn-ui-mcp-server"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
}
}
}
}-
Verify server runs standalone:
npx @jpisnice/shadcn-ui-mcp-server --help
-
Check configuration syntax:
- Validate JSON format
- Check for missing commas or brackets
-
Restart Cursor after configuration changes
-
Check Cursor logs for error messages
"Command not found":
# Ensure npx is available
npx --version"Rate limit exceeded":
# Add GitHub token to configuration"MCP server not recognized":
- Restart Cursor
- Check configuration file location
- Verify JSON syntax
- Usage Examples - How to use after integration
- Troubleshooting - Common issues and solutions
- API Reference - Complete tool reference
- Other Integrations - Connect to other tools