MCP Server
Expose your Panda CSS design system to AI assistants using the Model Context Protocol (MCP).
The Panda MCP Server allows AI assistants like Claude, Cursor, VS Code Copilot, Windsurf, and Codex to understand and work with your project's design system. It provides tools for querying tokens, recipes, patterns, conditions, and more.
What is MCP?
The Model Context Protocol (MCP) (opens in a new tab) is an open standard for connecting AI assistants to external tools and data sources. Panda's MCP server exposes your design system through a set of specialized tools that AI assistants can use to:
- Look up design tokens and their values
- Understand available component recipes and variants
- Query layout patterns and their properties
- Inspect configured conditions, animations, and style compositions
- Audit source usage and find unused tokens, recipes, patterns, and keyframes
Quick Start
1. Add the MCP Server
Add the Panda MCP server to your AI client's MCP configuration:
{
"mcpServers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp"]
}
}
}For VS Code, use the servers key instead of mcpServers.
2. Use with Your AI Assistant
Once configured, your AI assistant will automatically have access to Panda CSS tools. You can ask questions like:
- "What color tokens are available in my design system?"
- "Show me the button recipe variants"
- "What text styles are available?"
- "What breakpoints are defined?"
CLI Commands
The MCP server is distributed as @pandacss/mcp. It is usually started by your AI client, but you can also run it
directly with npx, pnpm dlx, or your package manager's equivalent one-off package runner.
Start the MCP server manually (usually not needed - clients start it automatically).
pnpm dlx @pandacss/mcp
# With custom config path
pnpm dlx @pandacss/mcp --config ./panda.config.ts
# Specify working directory
pnpm dlx @pandacss/mcp --cwd ./my-project| Flag | Description |
|---|---|
--config, -c <path> | Path to Panda config file |
--cwd <path> | Current working directory |
--silent | Suppress startup logs |
Supported AI Clients
The MCP server can be used with AI assistants that support local stdio MCP servers:
| Client | Typical Config Path | Config Key |
|---|---|---|
| Claude | .mcp.json | mcpServers |
| Cursor | .cursor/mcp.json | mcpServers |
| VS Code | .vscode/mcp.json | servers |
| Windsurf | .windsurf/mcp.json | mcpServers |
| Codex | .codex/mcp.json | mcpServers |
Available Tools
The MCP server exposes these tools to AI assistants:
| Tool | Description | Input |
|---|---|---|
get_tokens | Get design tokens with values, CSS variables, and usage examples | category? - filter by token category |
get_semantic_tokens | Get semantic tokens with conditional values (dark mode, responsive) | category? - filter by token category |
get_color_palette | Get the complete color palette | - |
get_recipes | Get component recipes with variants and default values | name? - filter by recipe name |
get_patterns | Get layout patterns with properties and usage examples | name? - filter by pattern name |
get_conditions | Get all conditions (breakpoints, pseudo-classes, color modes) | - |
get_keyframes | Get keyframe animations defined in the theme | - |
get_text_styles | Get text style compositions for typography | - |
get_layer_styles | Get layer style compositions for visual styling | - |
get_animation_styles | Get animation style compositions | - |
get_config | Get the resolved Panda CSS configuration | - |
get_usage_report | Scan source files for design-system usage and unused configured names | scope? - select a report scope |
get_usage_report scans files matching your configured include and exclude paths on each call. Its optional scope
accepts all (the default), tokens, recipes, utilities, patterns, or keyframes.
Reports include usage counts, source locations, unused configured names, and diagnostics. Token reports also include raw values and token suggestions; recipe reports include variant usage. Reports with file-read errors or JavaScript parse errors are returned as MCP tool errors and may be incomplete. Other tools query your resolved design-system configuration.
Configuration
For most MCP clients, use this configuration:
{
"mcpServers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp"]
}
}
}The server automatically loads your panda.config.ts from the current working directory when started.
Claude
Create .mcp.json in your project root:
{
"mcpServers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp"]
}
}
}Cursor
Create .cursor/mcp.json:
{
"mcpServers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp"]
}
}
}VS Code
Create .vscode/mcp.json:
{
"servers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp"]
}
}
}Custom Config Path
If your Panda config is not in the default location, specify it explicitly:
{
"mcpServers": {
"panda": {
"command": "npx",
"args": ["-y", "@pandacss/mcp", "--config", "./path/to/panda.config.ts"]
}
}
}Example Interactions
Here are some example prompts you can use with AI assistants once MCP is configured:
Exploring Tokens
"What spacing tokens are available?"
The AI will use get_tokens with category: "spacing" to show you all spacing values.
Understanding Recipes
"How do I use the button recipe with a destructive variant?"
The AI will use get_recipes with name: "button" to show variants and usage.
Finding unused tokens
"Which tokens aren't used in this project?"
The AI will use get_usage_report with scope: "tokens" to show token usage and unused configured tokens.
Auditing patterns and animations
"Where do we use the stack pattern?"
The AI will use get_usage_report with scope: "patterns" to show pattern usage and source locations. Use
scope: "keyframes" to audit animation references, or scope: "all" for all five usage categories.
Checking Conditions
"What responsive breakpoints are defined?"
The AI will use get_conditions to show all available breakpoints.
Troubleshooting
Server Not Starting
If the MCP server fails to start:
- Ensure Panda CSS is installed:
pnpm add -D @pandacss/dev - Verify you have a valid
panda.config.tsin your project - Check that
npx -y @pandacss/mcpruns without errors
Tools Not Available
If tools aren't showing up in your AI assistant:
- Restart the AI assistant after adding the MCP configuration
- Verify the config file is in the correct location
- Check the AI assistant's MCP documentation for any additional setup steps
Usage report scans no files
Check that the include paths in panda.config.ts cover your source files and that the MCP server starts from your
project directory. Files matching exclude are not scanned.