Skip to main content

MCP server for Storybook integration – browse, inspect, and scaffold components

Project description

Storybook MCP Server

An MCP (Model Context Protocol) server that integrates with a running Storybook instance. It lets AI-powered coding tools browse your component library, inspect individual components, and scaffold brand-new components from natural language.

Features

Tool Description
storybook_list_components List & search every component in your running Storybook
storybook_get_component Get stories, arg types, default args, and Storybook URLs for a component
storybook_create_component Scaffold a component + Storybook story from a plain-English description
storybook_compose_view Compose existing components into a higher-order page/view with layout, state, and wiring

Quick Start

Prerequisites

  • Python ≥ 3.10
  • A running Storybook instance (v7+)
  • uv installed

1. Install uv if needed (Python Package Manager)

# Install via Homebrew
brew install uv

# Or via curl
curl -LsSf https://astral.sh/uv/install.sh | sh

Note: The storybook-mcp package itself does NOT need to be installed separately. The MCP configuration uses uvx which automatically downloads and runs the package when needed.

Configuration by Editor

Configuration Format A: Project-Relative Paths

Use this configuration for Cursor, Windsurf, Roo Code, and Kilo Code.

{
  "mcpServers": {
    "storybook": {
      "command": "uvx",
      "args": ["storybook-mcp"],
      "env": {
        "STORYBOOK_URL": "http://localhost:6006",
        "STORYBOOK_COMPONENTS_DIR": "relative/path/to/your/storybook/components",
        "STORYBOOK_FRAMEWORK": "react",
        "STORYBOOK_STYLE_TECH": "tailwind",
        "STORYBOOK_TYPESCRIPT": "true"
      }
    }
  }
}

Configuration File Locations:

  • Cursor: .cursor/mcp.json (project root - already created in this project)
  • Windsurf: .windsurf/mcp.json (project root)
  • Roo Code: .roo/mcp.json (project root)
  • Kilo Code: .kilocode/mcp.json (project root)

Configuration Format B: Absolute Paths

Use this configuration for Claude Desktop and Claude CLI.

{
  "mcpServers": {
    "storybook": {
      "command": "uvx",
      "args": ["storybook-mcp"],
      "env": {
        "STORYBOOK_URL": "http://localhost:6006",
        "STORYBOOK_COMPONENTS_DIR": "/absolute/path/to/frontend/src/apps/core/shared/core-components",
        "STORYBOOK_FRAMEWORK": "react",
        "STORYBOOK_STYLE_TECH": "tailwind",
        "STORYBOOK_TYPESCRIPT": "true"
      }
    }
  }
}

Configuration File Locations:

  • Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude CLI (Linux/macOS): ~/.config/claude/claude_desktop_config.json
  • Claude CLI (Windows): %APPDATA%\Claude\claude_desktop_config.json

Note: Claude Desktop and Claude CLI require absolute paths for STORYBOOK_COMPONENTS_DIR.

Usage Examples

Once configured, you can use natural language commands:

List Components

"List all components in Storybook"
"Show me all button components"

Inspect Component

"Show me the details for the Core/UI/Button component"
"What props does the DataTable accept?"

Create Component

"Create a new AlertBanner component with info, warning, and error variants"
"Build a StatusIndicator component with online/offline/away states"

Compose Page

"Compose a SettingsPage using Sidebar, Tabs, TextInput, Toggle, and Button"
"Build a DashboardView with Card, Chart, DataTable, and Badge components"

Troubleshooting

MCP Server Not Connecting

  • ✅ Ensure Storybook is running at http://localhost:6006
  • ✅ Restart your editor/CLI after creating/modifying the MCP configuration file
  • ✅ Verify uv is installed: uv --version
  • ✅ Check that the configuration file is in the correct location for your tool

Components Not Found

  • ✅ Check that Storybook is fully loaded in browser
  • ✅ Component titles are case-sensitive
  • ✅ Use storybook_list_components to see available components

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

storybook_mcp-0.3.0.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

storybook_mcp-0.3.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file storybook_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: storybook_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for storybook_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 aa70ec67cc488a037201fd58ee43838d8a87f2dd1631f3d3baa3b40378b7e2ac
MD5 8a0bfa1628f6091e72e5bc7d139974f4
BLAKE2b-256 067b99741c2ec388e5028c693896d1bafcc6da9edfd0b322a11e0771ec56e88e

See more details on using hashes here.

File details

Details for the file storybook_mcp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: storybook_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for storybook_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 663068e6a45031bb7afee4f3c1dd67775faae58dee01aebf1c3b9200825a73cf
MD5 7dbd18b042ca64794d1d9bea054ebbaf
BLAKE2b-256 fb77c0db3bfa255e22ca7d744b421bb18d6ee9b4f984e36a21d8a3ddc79271a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page