Storybook MCP Server
⚠️ This tool was created for testing purposes and is not recommended for use in production environments.
Getting Started
Before you begin, you need to prepare your Storybook static files.
https://storybook.js.org/docs/sharing/publish-storybook
1. Clone the repository
git clone https://github.com/m-yoshiro/storybook-mcp.git
cd storybook-mcp
2. Install dependencies
We recommend using Bun
bun install
# or
npm install
3. Build
bun run build
# or
npm run build
4. Set up
{
"mcpServers": {
"storybook-mcp": {
"command": "node",
"args": [
"//index.js",
// Optional: path to your Storybook static json file
"//index.json"
]
}
}
}
The server will load your Storybook data and expose MCP tools to external agents.
🔧 Available Tools
| Tool Name | Description | Parameters |
|---|
list-components | Lists all available components from Storybook | path (optional): Path to the index.json or stories.json file (optional if default path is provided) |
find-components-by-name | Finds components based on a keyword (partial match supported) | name: Component name or keyword to search forpath (optional): Path to the index.json or stories.json file (optional if default path is provided) |
"What Storybook component matches this 'CTA Button' in my Figma design?"
➡️ MCP server runs:
find-component-by-name("cta button")
get-component-details("PrimaryButton")
get-component-usage-examples("PrimaryButton")
✨ Auto-generate UI code from a Figma section
Ask the AI:
"Generate a contact form using our design system"
➡️ MCP server:
- Suggests
TextField, Textarea, PrimaryButton
- Provides JSX using those components
🧠 Why MCP?
MCP (Model Context Protocol) provides a standard interface for large language models to safely and efficiently access contextual information like UI components, documentation, and code.
By integrating your Storybook via MCP:
- AI agents can suggest components intelligently
- Designers and developers get a shared source of truth
- Natural language is enough to drive UI generation
📁 Project Structure
storybook-mcp/
├── tools/
│ ├── list-components.ts
│ ├── get-component-details.ts
│ ├── get-component-usage-examples.ts
│ └── ...
├── config.ts
├── index.ts
└── README.md
🤝 Contributing
If you have ideas to improve or want to contribute new tools, feel free to open a PR or issue!
📜 License
MIT -->