Welcome to the Storybook MCP Addon monorepo! This project enables AI agents to work more efficiently with Storybook by providing an MCP (Model Context Protocol) server that exposes UI component information and development workflows. This monorepo contains two main packages: - @storybook/mcp - Standalone MCP library for serving Storybook component knowledge (can be used independently) - @storybook/
Add this skill
npx mdskills install storybookjs/addon-mcpContributor documentation for an MCP monorepo, not a usable MCP server listing for end users
1# Storybook MCP - Contributor Guide23Welcome to the Storybook MCP Addon monorepo! This project enables AI agents to work more efficiently with Storybook by providing an MCP (Model Context Protocol) server that exposes UI component information and development workflows.45## 📦 Packages67This monorepo contains two main packages:89- **[@storybook/mcp](./packages/mcp)** - Standalone MCP library for serving Storybook component knowledge (can be used independently)10- **[@storybook/addon-mcp](./packages/addon-mcp)** - Storybook addon that runs an MCP server within your Storybook dev server, and includes the functionality of **[@storybook/mcp](./packages/mcp)** from your local Storybook1112Each package has its own README with user-facing documentation. This document is for **contributors** looking to develop, test, or contribute to these packages.1314## 🚀 Quick Start1516### Prerequisites1718- **Node.js 24+** - The project requires Node.js 24 or higher (see `.nvmrc`)19- **pnpm 10.19.0+** - Strict package manager requirement (enforced in `package.json`)2021```bash22# Use the correct Node version23nvm use2425# Install pnpm if you don't have it26npm install -g pnpm@10.19.027```2829### Installation3031```bash32# Clone the repository33git clone https://github.com/storybookjs/mcp.git34cd addon-mcp3536# Install all dependencies (for all packages in the monorepo)37pnpm install38```3940### Development Workflow4142```bash43# Build all packages44pnpm build4546# Start development mode (watches for changes in all packages)47pnpm dev4849# Run unit tests in watch mode50pnpm test5152# Run unit tests once53pnpm test:run5455# Run Storybook with the addon for testing56pnpm --filter internal-storybook storybook57```5859The Storybook command starts:6061- The internal test Storybook instance on `http://localhost:6006`62- The addon in watch mode, so changes are reflected automatically63- MCP server available at `http://localhost:6006/mcp`6465## 🛠️ Common Tasks6667### Development6869The `turbo watch build` command runs all packages in watch mode, automatically rebuilding when you make changes:7071```bash72# Start development mode for all packages73pnpm turbo watch build74```7576```bash77# This is usually all you need - starts Storybook AND watches addon for changes78pnpm storybook79```8081### Building8283```bash84# Build all packages85pnpm build86```8788### Testing8990The monorepo uses a centralized Vitest configuration at the root level with projects configured for each package:9192```bash93# Watch tests across all packages94pnpm test9596# Run tests once across all packages97pnpm test:run9899# Run tests with coverage and CI reporters100pnpm test:ci101```102103### Debugging MCP Servers104105Use the MCP Inspector to debug and test MCP server functionality:106107```bash108# Launches the MCP inspector (requires Storybook to be running)109pnpm inspect110```111112This uses the configuration in `.mcp.inspect.json` to connect to your local MCP servers.113114Alternatively, you can also use these `curl` comamnds to check that everything works:115116```bash117# test that the mcp server is running118# use port 6006 to test the addon-mcp server instead119curl -X POST \120 http://localhost:13316/mcp \121 -H "Content-Type: application/json" \122 -d '{123 "jsonrpc": "2.0",124 "id": 1,125 "method": "tools/list",126 "params": {}127 }'128129# test a specific tool call130curl -X POST http://localhost:13316/mcp \131 -H "Content-Type: application/json" \132 -d '{133 "jsonrpc": "2.0",134 "id": 2,135 "method": "tools/call",136 "params": {137 "name": "list-all-documentation",138 "arguments": {}139 }140 }'141```142143### Debugging with Storybook144145You can start Storybook with:146147```bash148pnpm storybook149```150151This will build everything and start up Storybook with addon-mcp, and you can then connect your coding agent to it at `http://localhost:6006/mcp` and try it out.152153### Working with the MCP App154155To work with and debug the MCP app that is rendered as part of the preview-stories tool, you can:1561571. Use the Insiders build of VSCode1582. Ensure the [chat.mcp.apps.enabled](vscode-insiders://settings/chat.mcp.apps.enabled) setting is enabled1593. Start up the repo's Storybook in watch mode by running `pnpm storybook` in the root1604. Restart VSCode and, open the [`.vscode/mcp.json`](./.vscode/mcp.json) file and ensure the Storybook MCP is marked as Running, otherwise click Start.1615. Open up a chat in VSCode and write a prompt like this:162163> Show me how all the button stories look, using the Storybook MCP1641656. After this first prompt, whenever you make changes, Storybook automatically restarts. Wait for it to be fully ready, then you can prompt _"Run the tool again"_.166167You can also use [the inspector from MCPJam](https://docs.mcpjam.com/getting-started) to have more low level control of the tool calls.168169### Formatting & Linting170171```bash172# Format all files with Prettier173pnpm format174175# Check formatting without changing files176pnpm format:check177178# Lint code with oxlint179pnpm lint180181# Lint with GitHub Actions format (for CI)182pnpm lint:ci183184# Check package exports with publint185pnpm publint186```187188## 🔍 Quality Checks189190The monorepo includes several quality checks that run in CI:191192```bash193# Run all checks (build, test, lint, format, typecheck, publint)194pnpm check195196# Run checks in watch mode (experimental)197pnpm check:watch198199# Type checking (uses tsc directly, not turbo)200pnpm typecheck201202# Type checking with turbo (for individual packages)203pnpm turbo:typecheck204205# Testing with turbo (for individual packages)206pnpm turbo:test207```208209## 📝 Code Conventions210211### TypeScript & Imports212213**Always include file extensions** in relative imports:214215```typescript216// ✅ Correct217import { foo } from './bar.ts';218219// ❌ Wrong220import { foo } from './bar';221```222223- **JSON imports** use the import attributes syntax:224225```typescript226import pkg from '../package.json' with { type: 'json' };227```228229## 🚢 Release Process230231This project uses [Changesets](https://github.com/changesets/changesets) for version management:232233```bash234# 1. Create a changeset describing your changes235pnpm changeset236```237238When you create a PR, add a changeset if your changes should trigger a release:239240- Patch: Bug fixes, documentation updates241- Minor: New features, backward-compatible changes242- Major: Breaking changes243244## 🤝 Contributing245246We welcome contributions! Here's how to get started:2472481. **Fork the repository** and create a feature branch2492. **Make your changes** following the code conventions above2503. **Test your changes** using the internal Storybook instance2514. **Create a changeset** if your changes warrant a release2525. **Submit a pull request** with a clear description253254### Before Submitting255256- [ ] Code builds without errors (`pnpm build`)257- [ ] Tests pass (`pnpm test:run`)258- [ ] Code is formatted (`pnpm format`)259- [ ] Code is linted (`pnpm lint`)260- [ ] Type checking passes (`pnpm typecheck`)261- [ ] Changes tested with MCP inspector or internal Storybook262- [ ] Changeset created if necessary (`pnpm changeset`)263264### Getting Help265266- **Ideas & Feature Requests**: [Start a discussion](https://github.com/storybookjs/mcp/discussions/new?category=ideas)267- **Bug Reports**: [Open an issue](https://github.com/storybookjs/mcp/issues/new)268- **Questions**: Ask in [GitHub Discussions](https://github.com/storybookjs/mcp/discussions)269270## 📄 License271272MIT - See [LICENSE](./LICENSE) for details273274---275276**Note**: This project is experimental and under active development. APIs and architecture may change as we explore the best ways to integrate AI agents with Storybook.277
Full transparency — inspect the skill content before installing.