Skip to content

Fix: Wrongly enabling docs toolset when only docs manifests where present#193

Merged
JReinhold merged 6 commits intomainfrom
fix-manifest-detection
Mar 11, 2026
Merged

Fix: Wrongly enabling docs toolset when only docs manifests where present#193
JReinhold merged 6 commits intomainfrom
fix-manifest-detection

Conversation

@JReinhold
Copy link
Copy Markdown
Contributor

This PR fixes an issue that the docs toolset would be enabled (and reported as all green on the human readable /mcp route) when there were any manifest.

addon-docs adds a docs manifest, but that is not enough for the docs toolset to work, it needs a components manifest as supplied by the React renderer.

Users would have addon-mcp installed in a non-React renderer with addon-docs, and the MCP server would crash trying to deliver docs becaause no components manifest would be found.

…' manifests.docs alone doesn't enable the docs toolset.
Copilot AI review requested due to automatic review settings March 11, 2026 13:15
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 11, 2026

🦋 Changeset detected

Latest commit: c34f94a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@storybook/addon-mcp Patch

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 11, 2026

npm i https://pkg.pr.new/storybookjs/mcp/@storybook/addon-mcp@193
npm i https://pkg.pr.new/storybookjs/mcp/@storybook/mcp@193

commit: c34f94a

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.28%. Comparing base (eaf6afa) to head (c34f94a).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
- Coverage   73.45%   73.28%   -0.17%     
==========================================
  Files          42       42              
  Lines        1179     1179              
  Branches      333      333              
==========================================
- Hits          866      864       -2     
- Misses        197      198       +1     
- Partials      116      117       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Bundle Report

Bundle size has no change ✅

Copy link
Copy Markdown
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

Fixes incorrect detection of “docs toolset” availability in @storybook/addon-mcp when only a docs manifest is present (e.g., from addon-docs) but the required components manifest is missing, preventing the MCP docs tools from being shown as enabled and then crashing at runtime.

Changes:

  • Tighten manifest availability detection to require experimental_manifests.components (or the legacy generator) rather than any manifest.
  • Add a regression test covering the docs-only manifest scenario.
  • Update affected tests/fixtures to include a components manifest where appropriate, and adjust the /mcp HTML notice wording.

Reviewed changes

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

Show a summary per file
File Description
packages/addon-mcp/src/tools/is-manifest-available.ts Require components manifest (or legacy generator) to consider docs toolset available
packages/addon-mcp/src/tools/is-manifest-available.test.ts Adds regression test for docs-only manifests
packages/addon-mcp/src/preset.ts Updates docs toolset notice text on the human-readable /mcp page
packages/addon-mcp/src/preset.test.ts Updates preset test to mock experimental_manifests.components
packages/addon-mcp/src/mcp-handler.test.ts Updates handler test to mock experimental_manifests.components for docs tools registration

You can also share your feedback on Copilot code review. Take the survey.

Comment thread packages/addon-mcp/src/preset.ts
Copilot AI review requested due to automatic review settings March 11, 2026 13:46
@JReinhold JReinhold self-assigned this Mar 11, 2026
@JReinhold JReinhold requested a review from kasperpeulen March 11, 2026 13:48
@JReinhold JReinhold merged commit 762c0e8 into main Mar 11, 2026
15 of 16 checks passed
@JReinhold JReinhold deleted the fix-manifest-detection branch March 11, 2026 13:54
Copy link
Copy Markdown
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


You can also share your feedback on Copilot code review. Take the survey.

@storybook-app-bot storybook-app-bot Bot mentioned this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants