Conversation
🦋 Changeset detectedLatest commit: e559378 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
/mcp test-toolset requirements and replace auto-redirect with manual manifest link
commit: |
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Pull request overview
This PR updates the /mcp landing page UX in @storybook/addon-mcp by clarifying the “test” toolset requirements (Storybook 10.3.0+ with @storybook/addon-vitest) and removing the countdown-based auto-redirect in favor of a manual link to the manifest debugger when available.
Changes:
- Replaces the old redirect meta/script injection with a
{{MANIFEST_DEBUGGER_LINK}}placeholder that renders a manual link only when manifests are available. - Updates the “test” toolset notice text to explicitly mention the Storybook 10.3.0+ requirement.
- Adds/updates a unit test to assert the new requirement message and presence of the manual manifest debugger link.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
packages/addon-mcp/src/template.html |
Removes redirect markup/script and introduces {{MANIFEST_DEBUGGER_LINK}} injection point. |
packages/addon-mcp/src/preset.ts |
Removes meta-refresh redirect injection; adds manual manifest debugger link injection; updates vitest toolset requirement copy. |
packages/addon-mcp/src/preset.test.ts |
Adds a test covering the updated requirement copy + manual manifest debugger link rendering. |
|
|
||
| let getHandler: any; | ||
| mockApp.get = vi.fn((path, handler) => { | ||
| getHandler = handler; |
There was a problem hiding this comment.
Nit: This captures the last registered GET handler, which happens to be /mcp today — but only because it's registered after /.well-known/... in preset.ts. If a future change adds another app.get() call after /mcp, this test would silently test the wrong handler.
Other tests in this same file already use a more robust pattern (e.g. line 144):
const handlers: Record<string, any> = {};
mockApp.get = vi.fn((path: string, handler: any) => {
handlers[path] = handler;
});
await (experimental_devServer as any)(mockApp, manifestEnabledOptions);
const mcpHandler = handlers['/mcp'];
await mcpHandler(mockReq, mockRes);There was a problem hiding this comment.
@copilot this comment makes sense to me, fix it.
There was a problem hiding this comment.
Updated the test to capture GET handlers by route and explicitly invoke handlers['/mcp'] instead of relying on the last registered handler. This is in commit e559378, and preset.test.ts passes with the change. Screenshot reference: https://github.com/user-attachments/assets/768de4e3-cc8b-4b37-ad64-5e125c70a42f
Bundle ReportChanges will decrease total bundle size by 47.9kB (-100.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|

packages/addon-mcp/src/preset.test.tsto explicitly select/mcppreset.test.ts(and addon package tests if needed)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.