-
-
Notifications
You must be signed in to change notification settings - Fork 9
chore: Upgrade Storybook and add Storybook MCP addon #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eb9a396
6a9e82c
ec15f71
2521e34
5b1e17d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "mcpServers": { | ||
| "storybook-mcp": { | ||
| "url": "http://localhost:6006/mcp" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,10 @@ yarn build-storybook # Build static site | |
|
|
||
| # Test accessibility | ||
| yarn test:storybook # Run Storybook accessibility tests | ||
|
|
||
| # MCP-assisted Storybook workflows (requires Storybook running) | ||
| # MCP endpoint: http://localhost:6006/mcp | ||
| # Tools: preview-stories, run-story-tests | ||
| ``` | ||
|
|
||
| ## Golden Path Examples | ||
|
|
@@ -108,3 +112,5 @@ After adding/updating component documentation, verify: | |
| - [ ] Cross-platform: same prop names and types | ||
| - [ ] Storybook builds without errors: `yarn build-storybook` | ||
| - [ ] Accessibility tests pass: `yarn test:storybook` | ||
| - [ ] If using Storybook MCP workflows, run `run-story-tests` after story/component changes and resolve failures | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MCP workflows are optional, but when used they should gate the same quality bar as |
||
| - [ ] If using Storybook MCP previews, include `preview-stories` URLs when sharing visual verification | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "servers": { | ||
| "storybook-mcp": { | ||
| "type": "http", | ||
| "url": "http://localhost:6006/mcp" | ||
| } | ||
| } | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above but for vscode |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,4 +27,5 @@ npmPreapprovedPackages: | |
| - '@metamask/*' | ||
| - '@lavamoat/*' | ||
| - '@storybook/*' | ||
| - '@chromatic-com/*' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Chromatic integration already uses |
||
| - 'storybook' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,7 @@ const config: StorybookConfig = { | |
| getAbsolutePath('@storybook/addon-a11y'), | ||
| getAbsolutePath('@storybook/addon-docs'), | ||
| getAbsolutePath('@storybook/addon-vitest'), | ||
| getAbsolutePath('@storybook/addon-mcp'), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ], | ||
| framework: { | ||
| name: getAbsolutePath('@storybook/react-vite'), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,25 @@ For React Native components, please use: | |
| yarn storybook:ios | ||
| ``` | ||
|
|
||
| ## AI Integration (Storybook MCP) | ||
|
|
||
| When Storybook is running locally, an MCP endpoint is available at: | ||
|
|
||
| ```text | ||
| http://localhost:6006/mcp | ||
| ``` | ||
|
|
||
| This endpoint helps AI agents work with the design system by exposing: | ||
|
|
||
| - `list-all-documentation` to discover documented components and docs entries | ||
| - `get-documentation` to retrieve component props, examples, and stories | ||
| - `get-documentation-for-story` to inspect a specific story variant | ||
| - `get-storybook-story-instructions` for Storybook's built-in story-writing guidance | ||
| - `preview-stories` to generate preview URLs for stories | ||
| - `run-story-tests` to execute story tests (when supported by the Storybook setup) | ||
|
|
||
| Maintainers can use these tools while authoring stories in this repo. Consumer repositories get the most value by connecting their agent clients to this endpoint (local) or a published Storybook MCP endpoint. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agents and humans need a single, app-local reference for what the endpoint exposes and how it differs from static repo rules. The maintainer vs consumer split clarifies that this repo does not mandate global MCP client config—downstream teams point their own clients at a running Storybook (local or deployed). |
||
|
|
||
| ## Accessibility Testing | ||
|
|
||
| Our Storybook setup includes accessibility testing capabilities. See [Accessibility Testing Documentation](../../docs/accessibility-testing.md). | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,10 +17,11 @@ | |
| "@metamask/design-tokens": "workspace:^", | ||
| "@metamask/utils": "^11.10.0", | ||
| "@playwright/test": "^1.52.0", | ||
| "@storybook/addon-a11y": "^10.2.3", | ||
| "@storybook/addon-docs": "^10.2.3", | ||
| "@storybook/addon-vitest": "^10.2.3", | ||
| "@storybook/react-vite": "^10.2.3", | ||
| "@storybook/addon-a11y": "^10.3.1", | ||
| "@storybook/addon-docs": "^10.3.1", | ||
| "@storybook/addon-mcp": "^0.4.1", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Storybook addons and |
||
| "@storybook/addon-vitest": "^10.3.1", | ||
| "@storybook/react-vite": "^10.3.1", | ||
| "@testing-library/dom": "^9.0.0", | ||
| "@testing-library/react": "^16.0.1", | ||
| "@types/prop-types": "^15", | ||
|
|
@@ -36,7 +37,7 @@ | |
| "prop-types": "^15.8.1", | ||
| "react": "^18.2.0", | ||
| "react-dom": "^18.2.0", | ||
| "storybook": "^10.2.3", | ||
| "storybook": "^10.3.1", | ||
| "tailwindcss": "^3.0.0", | ||
| "typescript": "~5.2.2", | ||
| "vite": "^6.3.6", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding mcp config file to
.cursor/this was created using the addon docs https://storybook.js.org/docs/ai/mcp/overview?ref=readme