chore: Upgrade Storybook and add Storybook MCP addon#987
chore: Upgrade Storybook and add Storybook MCP addon#987georgewrmarshall wants to merge 2 commits intomainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
📖 Storybook Preview |
Made-with: Cursor
📖 Storybook Preview |
| ### Documentation ownership | ||
|
|
||
| - Keep maintainers' standards in `.cursor/rules/` and contributor docs. | ||
| - Keep Storybook MCP setup and endpoint usage in Storybook app docs (for example, `apps/storybook-react/README.md`). | ||
| - Do not require repository-global MCP client config in this repo; consumers should configure their own agent clients. |
There was a problem hiding this comment.
Not sure if we need this section?
| ### Documentation ownership | |
| - Keep maintainers' standards in `.cursor/rules/` and contributor docs. | |
| - Keep Storybook MCP setup and endpoint usage in Storybook app docs (for example, `apps/storybook-react/README.md`). | |
| - Do not require repository-global MCP client config in this repo; consumers should configure their own agent clients. |
|
@SocketSecurity ignore npm/glob@13.0.6 Socket Security review:
|
| getAbsolutePath('@storybook/addon-a11y'), | ||
| getAbsolutePath('@storybook/addon-docs'), | ||
| getAbsolutePath('@storybook/addon-vitest'), | ||
| getAbsolutePath('@storybook/addon-mcp'), |
There was a problem hiding this comment.
Why register MCP here? @storybook/addon-mcp ships as a normal Storybook addon and must appear in addons so the dev server exposes the MCP route documented in the Storybook app README.
Reviewer note: This sits beside docs, a11y, and Vitest addons—same lifecycle as other dev-only tooling. Storybook 10.3.x aligns peer ranges with the addon; no separate runtime wiring is required beyond this entry.
| - '@metamask/*' | ||
| - '@lavamoat/*' | ||
| - '@storybook/*' | ||
| - '@chromatic-com/*' |
There was a problem hiding this comment.
Why pre-approve @chromatic-com/*? The Chromatic integration already uses @chromatic-com/storybook in main.ts; Yarn's minimal-age gate blocks scopes, not just package names.
Reviewer note: Adding this scope lets legitimate Chromatic packages resolve under the same supply-chain rules as @storybook/* without weakening other namespaces.
| "@storybook/react-vite": "^10.2.3", | ||
| "@storybook/addon-a11y": "^10.3.1", | ||
| "@storybook/addon-docs": "^10.3.1", | ||
| "@storybook/addon-mcp": "^0.4.1", |
There was a problem hiding this comment.
Why pin every Storybook package to ^10.3.1? Storybook addons and storybook share tight peer dependency ranges; mixing minors commonly breaks installs or runtime peer warnings.
Reviewer note: @storybook/addon-mcp is pre-1.0 (^0.4.1) and is the only non-10.x Storybook devDependency here—expected until the addon stabilizes.
| - `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. |
There was a problem hiding this comment.
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).
| ### Documentation ownership | ||
|
|
||
| - Keep maintainers' standards in `.cursor/rules/` and contributor docs. | ||
| - Keep Storybook MCP setup and endpoint usage in Storybook app docs (for example, `apps/storybook-react/README.md`). |
There was a problem hiding this comment.
Why add a whole section to ai-agents.md? The three-layer doc model stays canonical for how we write code; Storybook MCP is an optional runtime context source on top of .cursor/rules/.
Reviewer note: Explicit documentation ownership avoids duplicating MCP setup in every rule file and sets the expectation that consumers configure their own agent clients rather than checking shared IDE config into this monorepo.
| - [ ] 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 |
There was a problem hiding this comment.
Why extend the component-doc checklist? MCP workflows are optional, but when used they should gate the same quality bar as yarn test:storybook—especially story tests and shareable preview URLs for visual review.
Reviewer note: These items are additive; contributors who do not use MCP can ignore them, while teams using agents get an explicit reminder tied to the Storybook port and tool surface.
Description
This change upgrades React web Storybook from 10.2.3 to 10.3.1 and adds the official
@storybook/addon-mcpso agents can use Storybook as dynamic context while authoring or consuming the design system.https://storybook.js.org/ai
Why
What
@storybook/addon-mcpinapps/storybook-react/.storybook/main.ts.apps/storybook-react/package.jsonand refreshyarn.lock.@chromatic-com/*innpmPreapprovedPackages(.yarnrc.yml) for approved dependency resolution.http://localhost:6006/mcp), available tools, and maintainer vs consumer guidance inapps/storybook-react/README.mdanddocs/ai-agents.md..cursor/rules/component-documentation.mdwith MCP workflow notes and checklist items.Related issues
Fixes:
Manual testing steps
yarn install(if needed).yarn storybookand confirm Storybook starts without errors.http://localhost:6006/mcpwhile Storybook is running (perapps/storybook-react/README.md).Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Moderate risk due to a Storybook minor-version upgrade plus introduction of the
@storybook/addon-mcpserver endpoint and new transitive dependencies, which could affect local Storybook build/runtime behavior.Overview
Upgrades the React web Storybook stack from
10.2.3to10.3.1and updates the lockfile accordingly.Enables Storybook MCP by adding
@storybook/addon-mcpto the Storybook addons list, and documents the local MCP endpoint (http://localhost:6006/mcp) plus recommendedpreview-stories/run-story-testsworkflows in Storybook and contributor docs.Relaxes the Yarn minimal-age gate allowlist to include
@chromatic-com/*for dependency resolution.Written by Cursor Bugbot for commit 6a9e82c. This will update automatically on new commits. Configure here.