See your components render live inside the IDE as the AI edits them. No switching windows.
Add this to .cursor/mcp.json in your project root:
{
"mcpServers": {
"storybook-preview": {
"command": "npx",
"args": ["-y", "simple-storybook-preview-mcp"],
"env": {
"STORYBOOK_URL": "http://localhost:6006"
}
}
}
}
npm run storybook
The preview panel appears automatically whenever the AI modifies a component that has a Storybook story. No manual action needed.
| Env Variable | Default | Description |
|---|---|---|
STORYBOOK_URL |
http://localhost:6006 |
Base URL of your running Storybook dev server |
DEBUG |
false |
Set to true or 1 to show a debug log panel in the preview |
The AI derives story IDs from your Storybook file structure. The pattern is:
title segments lowercased, joined by dashes
+ double-dash
+ story export name lowercased
Examples:
title: "Components/Button" export: "Primary" → components-button--primary
title: "Forms/Input" export: "WithLabel" → forms-input--withlabel
title: "Layout/Sidebar" export: "Collapsed" → layout-sidebar--collapsed
Renders automatically after AI edits a component with a story
Light and dark themes, follows OS preference or set explicitly
Shows component title, variant, file path, and tags
Proper Content Security Policy for iframe embedding
Works with npx, just set STORYBOOK_URL and go
Optional debug panel for troubleshooting MCP communication
Node.js 18+ and a running Storybook 7+ dev server. Works with any framework Storybook supports (React, Vue, Angular, Svelte, etc.).
Requires an IDE with MCP Apps support (e.g. Cursor).