Storybook MCP Integration
Use the Storybook MCP server (@storybook/addon-mcp) to give agents awareness of a project's actual component library — props, stories, tests, and live previews.
When to Use
- Component generation — check existing Storybook components before creating new ones
- Component testing — run story tests + a11y audits via MCP instead of CLI
- Visual verification — embed story previews in chat for user confirmation
- Component auditing — inventory components with full metadata via MCP
Quick Reference — 6 Tools, 3 Toolsets
| Toolset |
Tool |
Purpose |
Key Inputs |
| dev |
get-storybook-story-instructions |
Guidance on writing stories + interaction tests |
none |
| dev |
preview-stories |
Returns preview URLs for stories (embeddable) |
stories[]: {storyId} or {absoluteStoryPath, exportName} |
| docs |
list-all-documentation |
Full component + docs manifest index |
none |
| docs |
get-documentation |
Props, first 3 stories, story index, docs |
id (required), storybookId (optional) |
| docs |
get-documentation-for-story |
Full story source + component docs |
componentId, storyName (required) |
| testing |
run-story-tests |
Run component + a11y tests, pass/fail + violations |
stories[] (optional), a11y boolean (default true) |
Prerequisites
# Storybook 10.3+ with Vite builder (no webpack)
npx storybook@latest upgrade
# Install the addon (current: @storybook/addon-mcp@0.6.0, Apr 2026)
npx storybook add @storybook/addon-mcp
# Enable docs toolset (required for component discovery)
# In .storybook/main.ts:
# componentsManifest: true
# NOTE: the old `experimentalComponentsManifest` flag was renamed in
# Storybook 10.3; it is now `componentsManifest` and default-on. Any
# code still passing the `experimental` prefix will warn-then-ignore.
# For Chromatic remote setups, use the standalone package instead of
# the addon (same tool surface, no local Storybook required):
# npm i -D @storybook/mcp
# npx storybook-mcp --registry https://chromatic.storybook.cloud
# Enable testing toolset (requires addon-vitest)
# npx storybook add @storybook/addon-vitest
# Register with Claude Code
npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project
Detection Pattern
Before using Storybook MCP tools, check availability:
# Probe for storybook-mcp tools
ToolSearch(query="+storybook list-all-documentation")
# If tools found → Storybook MCP is available
# If not found → fallback to filesystem-based component discovery
Rule Details
Load rules on demand with Read("rules/<file>"):
| Rule |
Impact |
Description |
component-discovery |
HIGH |
Use list-all-documentation + get-documentation before generating new components |
story-preview-verification |
HIGH |
Embed preview-stories URLs for visual confirmation |
mcp-test-runner |
CRITICAL |
Run run-story-tests with a11y:true after component generation |
Toolset Selection
Filter toolsets via X-MCP-Toolsets header to reduce agent context:
| Agent Role |
Toolsets |
Rationale |
| component-curator |
docs |
Inventory + props only, no testing |
| frontend-ui-developer |
dev,docs,testing |
Full access for gen → verify loop |
| design-system-architect |
docs |
Component metadata for governance |
Chromatic Remote Publishing
For teams using Chromatic, the docs toolset is publishable remotely:
- Published at
https://<chromatic-storybook-url>/mcp
- Only docs toolset available remotely (dev + testing need local Storybook)
- Useful for cross-team design system discovery without running Storybook locally
Graceful Degradation
| Storybook MCP |
Fallback |
Behavior |
| Available |
— |
Use MCP tools for component discovery, testing, previews |
| Unavailable |
Filesystem |
Glob("**/components/**/*.tsx") + Grep for component inventory |
| Unavailable |
21st.dev |
Search public registry via 21st-dev-magic MCP |
| Unavailable |
Manual |
Claude multimodal analysis of screenshots |
Related Skills
storybook-testing — CSF3 patterns, Vitest integration, Chromatic TurboSnap
component-search — 21st.dev registry search (external components)
design-to-code — Full mockup-to-component pipeline (uses this skill in Stage 2)
ui-components — shadcn/ui + Radix component patterns
1---2name: storybook-mcp-integration3license: MIT4compatibility: "Claude Code 2.1.277+. Optional: @storybook/addon-mcp (Storybook 10.3+, Vite-based only)."5description: "Storybook MCP server (@storybook/addon-mcp) tools and toolsets. Use when calling them on existing components. To build from a mockup, use design-to-code."6user-invocable: false7disable-model-invocation: false8targets:9 - library: storybook10 version: ">=10.6.1"11metadata:12 source: https://skillmd.com/skills/yonatangross/storybook-mcp-integration13 category: document-asset-creation14 mcp-server: storybook-mcp15 version: "1.0.0"16 author: "OrchestKit"17 complexity: "medium"18 tags: "storybook, mcp, component-discovery, story-preview, component-testing, a11y, design-system, react"19allowed-tools: "Read Glob Grep WebFetch WebSearch ToolSearch mcp__storybook-mcp__get-storybook-story-instructions mcp__storybook-mcp__preview-stories mcp__storybook-mcp__list-all-documentation mcp__storybook-mcp__get-documentation mcp__storybook-mcp__get-documentation-for-story mcp__storybook-mcp__run-story-tests"20paths:21 - ".storybook/**"22 - "src/**/*.stories.{ts,tsx}"23---2425# Storybook MCP Integration2627Use the Storybook MCP server (`@storybook/addon-mcp`) to give agents awareness of a project's actual component library — props, stories, tests, and live previews.2829## When to Use3031- **Component generation** — check existing Storybook components before creating new ones32- **Component testing** — run story tests + a11y audits via MCP instead of CLI33- **Visual verification** — embed story previews in chat for user confirmation34- **Component auditing** — inventory components with full metadata via MCP3536## Quick Reference — 6 Tools, 3 Toolsets3738| Toolset | Tool | Purpose | Key Inputs |39|---------|------|---------|------------|40| **dev** | `get-storybook-story-instructions` | Guidance on writing stories + interaction tests | none |41| **dev** | `preview-stories` | Returns preview URLs for stories (embeddable) | `stories[]: {storyId}` or `{absoluteStoryPath, exportName}` |42| **docs** | `list-all-documentation` | Full component + docs manifest index | none |43| **docs** | `get-documentation` | Props, first 3 stories, story index, docs | `id` (required), `storybookId` (optional) |44| **docs** | `get-documentation-for-story` | Full story source + component docs | `componentId`, `storyName` (required) |45| **testing** | `run-story-tests` | Run component + a11y tests, pass/fail + violations | `stories[]` (optional), `a11y` boolean (default true) |4647## Prerequisites4849```bash50# Storybook 10.3+ with Vite builder (no webpack)51npx storybook@latest upgrade5253# Install the addon (current: @storybook/addon-mcp@0.6.0, Apr 2026)54npx storybook add @storybook/addon-mcp5556# Enable docs toolset (required for component discovery)57# In .storybook/main.ts:58# componentsManifest: true59# NOTE: the old `experimentalComponentsManifest` flag was renamed in60# Storybook 10.3; it is now `componentsManifest` and default-on. Any61# code still passing the `experimental` prefix will warn-then-ignore.6263# For Chromatic remote setups, use the standalone package instead of64# the addon (same tool surface, no local Storybook required):65# npm i -D @storybook/mcp66# npx storybook-mcp --registry https://chromatic.storybook.cloud6768# Enable testing toolset (requires addon-vitest)69# npx storybook add @storybook/addon-vitest7071# Register with Claude Code72npx mcp-add --type http --url "http://localhost:6006/mcp" --scope project73```7475## Detection Pattern7677Before using Storybook MCP tools, check availability:7879```python80# Probe for storybook-mcp tools81ToolSearch(query="+storybook list-all-documentation")8283# If tools found → Storybook MCP is available84# If not found → fallback to filesystem-based component discovery85```8687## Rule Details8889Load rules on demand with `Read("rules/<file>")`:9091| Rule | Impact | Description |92|------|--------|-------------|93| `component-discovery` | HIGH | Use list-all-documentation + get-documentation before generating new components |94| `story-preview-verification` | HIGH | Embed preview-stories URLs for visual confirmation |95| `mcp-test-runner` | CRITICAL | Run run-story-tests with a11y:true after component generation |9697## Toolset Selection9899Filter toolsets via `X-MCP-Toolsets` header to reduce agent context:100101| Agent Role | Toolsets | Rationale |102|------------|----------|-----------|103| component-curator | `docs` | Inventory + props only, no testing |104| frontend-ui-developer | `dev,docs,testing` | Full access for gen → verify loop |105| design-system-architect | `docs` | Component metadata for governance |106107## Chromatic Remote Publishing108109For teams using Chromatic, the docs toolset is publishable remotely:110- Published at `https://<chromatic-storybook-url>/mcp`111- Only docs toolset available remotely (dev + testing need local Storybook)112- Useful for cross-team design system discovery without running Storybook locally113114## Graceful Degradation115116| Storybook MCP | Fallback | Behavior |117|---------------|----------|----------|118| Available | — | Use MCP tools for component discovery, testing, previews |119| Unavailable | Filesystem | `Glob("**/components/**/*.tsx")` + `Grep` for component inventory |120| Unavailable | 21st.dev | Search public registry via 21st-dev-magic MCP |121| Unavailable | Manual | Claude multimodal analysis of screenshots |122123## Related Skills124125- `storybook-testing` — CSF3 patterns, Vitest integration, Chromatic TurboSnap126- `component-search` — 21st.dev registry search (external components)127- `design-to-code` — Full mockup-to-component pipeline (uses this skill in Stage 2)128- `ui-components` — shadcn/ui + Radix component patterns