Skip to content

Adding the storybook mcp agent so that copilot can effectively work with our storybook docs#7704

Open
jonrohan wants to merge 6 commits intomainfrom
storybook_mcp_server
Open

Adding the storybook mcp agent so that copilot can effectively work with our storybook docs#7704
jonrohan wants to merge 6 commits intomainfrom
storybook_mcp_server

Conversation

@jonrohan
Copy link
Member

This PR adds an agent that checks if Storybook is running on port 6006, starts it from the workspace root (npm start) in the background if not, waits for it to be ready, then calls the primer-storybook MCP tools to look up component docs, stories, and live previews.

Example prompts to try:

  • /storybook What props does the Button component accept?
  • /storybook Show me the stories for ActionMenu
  • /storybook I'm writing a story for Dialog — what imports and patterns do I use?
  • /storybook Preview all variants of the Banner component
CleanShot 2026-03-25 at 14 46 33@2x

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@jonrohan jonrohan requested a review from a team as a code owner March 25, 2026 21:49
@jonrohan jonrohan requested review from Copilot and siddharthkp March 25, 2026 21:49
@jonrohan jonrohan added skip changeset This change does not need a changelog integration-tests: skipped manually Changes in this PR do not require an integration test labels Mar 25, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 25, 2026

⚠️ No Changeset found

Latest commit: 283b1f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

Uh oh! @jonrohan, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 10

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@github-actions github-actions bot added the staff Author is a staff member label Mar 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repo’s Storybook setup to support the Storybook MCP add-on/server so Copilot can query component docs/stories and generate previews via an MCP endpoint exposed by the local Storybook dev server.

Changes:

  • Bump Storybook (and related addons/lint plugin) to ^10.3.3 across workspaces and root.
  • Enable the MCP addon in Storybook config and expose it via a VS Code MCP server entry pointing at http://localhost:6006/mcp.
  • Add a Copilot “storybook” skill doc and update Copilot instructions to reference it.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/styled-react/package.json Updates @storybook/react-vite to match the newer Storybook version.
packages/react/package.json Adds --no-open to Storybook dev script; bumps Storybook packages; adds @storybook/addon-mcp.
packages/react/.storybook/preview.jsx Updates viewport parameter configuration key (viewportsoptions).
packages/react/.storybook/main.ts Registers @storybook/addon-mcp and enables features.componentsManifest.
package.json Bumps root storybook and eslint-plugin-storybook versions.
package-lock.json Captures dependency graph updates from the Storybook + MCP add-on upgrade.
.vscode/mcp.json Adds primer-storybook MCP HTTP server pointing at the local Storybook /mcp endpoint.
.github/skills/storybook/SKILL.md Adds Copilot skill instructions for starting Storybook and using the MCP tools.
.github/copilot-instructions.md Points Copilot to the new Storybook skill doc for MCP usage guidance.

- **Always** call `list-all-documentation` before `get-documentation` — never guess or derive an ID from a component name. Only use `id` values returned by this list.
- **Never invent props or variants** not present in the documentation. Only use properties explicitly documented or shown in example stories — do not assume properties based on naming conventions or patterns from other libraries. If a property isn't documented, report it as not found and check back with the user.
- Before writing or editing stories, always call `get-storybook-story-instructions` — treat its output as the source of truth.
- Check your work by running `run-story-tests`.
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run-story-tests doesn’t appear to be a runnable command or documented script in this repo (a full-text search only finds it here). This will send users down a dead end; please replace it with an actual verification command used in this repo (e.g. the Playwright Storybook-based checks documented in contributor-docs/testing.md) or remove this bullet if there isn’t a supported local command.

Suggested change
- Check your work by running `run-story-tests`.
- Check your work by running Storybook E2E tests from the repo root (with Storybook running): `script/test-e2e --grep @vrt` for visual regression and `script/test-e2e --grep @avt` for accessibility.

Copilot uses AI. Check for mistakes.
@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions bot requested a deployment to storybook-preview-7704 March 25, 2026 21:56 Abandoned
@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions bot requested a deployment to storybook-preview-7704 March 25, 2026 22:06 Abandoned
@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@github-actions github-actions bot temporarily deployed to storybook-preview-7704 March 25, 2026 22:43 Inactive
@primer
Copy link
Contributor

primer bot commented Mar 25, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

@primer
Copy link
Contributor

primer bot commented Mar 26, 2026

🤖 Lint issues have been automatically fixed and committed to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants