-
Notifications
You must be signed in to change notification settings - Fork 29
Add MCP server-level instructions to both packages #185
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
282e37e
Initial plan
Copilot c5439b7
feat: add MCP server-level instructions to both packages
Copilot b349dd3
refactor: make addon instructions dynamic and composable
Copilot 799a551
refactor: dynamic instructions getter and named tool in test instruct…
Copilot b17868f
update reshaped-based tasks with configs, RDT manifests
JReinhold cb93700
add concise variant config
JReinhold 25fe7aa
update to Claude Sonnet 4.6 in evals
JReinhold 1f886da
add mcp tool calls as quality metric for 901-907
JReinhold 29419f1
improve composability of server instructions
JReinhold 9fd9130
revert reshaped eval manifest updates
JReinhold 3dd5b2a
Merge branch 'main' into copilot/implement-mcp-server-instructions
JReinhold 79930fc
update storybook deps
JReinhold f6c5470
Merge branch 'copilot/implement-mcp-server-instructions' of https://g…
JReinhold a360f09
cleanup
JReinhold 67fc5d6
update tests, sb deps
JReinhold 8dbd727
fix: return mcpToolsSummary when expectedToolCount is set even if tot…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| '@storybook/mcp': minor | ||
| '@storybook/addon-mcp': minor | ||
| --- | ||
|
|
||
| Add MCP server-level instructions to both packages | ||
|
|
||
| Both `@storybook/mcp` and `@storybook/addon-mcp` now include server instructions in the MCP `initialize` response. These instructions guide agents on how to use the available tools effectively without requiring explicit prompting from users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 901 - Create Component (Atom, Reshaped) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Tests whether the agent can build a small, accessible atomic component from scratch, add stories, and validate behavior using Storybook MCP tooling. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Reshaped is installed in trial setup. | ||
| - The task asks for a new `ToggleSwitch` component at `src/components/ToggleSwitch.tsx`. | ||
| - Prompt variants include concise, detailed, and explicit-story guidance. | ||
|
|
||
| ## Prompt | ||
|
|
||
| Asks the agent to create an accessible `ToggleSwitch` with keyboard interaction and disabled behavior. Concise prompt (`prompt.concise.md`) is intentionally brief. | ||
|
|
||
| ## Quality Signal | ||
|
|
||
| | Metric | Weight | | ||
| | ------------------------------------------------------- | ------ | | ||
| | MCP tools coverage (`get-storybook-story-instructions`) | 50 % | | ||
| | MCP tools coverage (`preview-stories`) | 50 % | | ||
|
|
||
| ## Expected MCP Tools | ||
|
|
||
| - `get-storybook-story-instructions` (at least 1 call) | ||
| - `preview-stories` (at least 1 call) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "expectedMcpTools": { | ||
| "get-storybook-story-instructions": { | ||
| "minCalls": 1 | ||
| }, | ||
| "preview-stories": { | ||
| "minCalls": 1 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
eval/tasks/902-create-component-composite-reshaped/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 902 - Create Component (Composite, Reshaped) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Tests whether the agent can create a composite UI component (multiple subparts and optional sections), write stories for key states, and verify outcomes with Storybook MCP tools. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Reshaped is installed in trial setup. | ||
| - The task targets a new `ProfileCard` at `src/components/ProfileCard.tsx`. | ||
| - Stories should cover avatar fallback, tags, and actions. | ||
|
|
||
| ## Prompt | ||
|
|
||
| Asks the agent to build a `ProfileCard` with avatar/initials fallback, content sections, and accessible action buttons. Concise prompt (`prompt.concise.md`) is intentionally minimal. | ||
|
|
||
| ## Quality Signal | ||
|
|
||
| | Metric | Weight | | ||
| | ------------------------------------------------------- | ------ | | ||
| | MCP tools coverage (`get-storybook-story-instructions`) | 50 % | | ||
| | MCP tools coverage (`run-story-tests`) | 50 % | | ||
|
|
||
| ## Expected MCP Tools | ||
|
|
||
| - `get-storybook-story-instructions` (at least 1 call) | ||
| - `run-story-tests` (at least 1 call) |
10 changes: 10 additions & 0 deletions
10
eval/tasks/902-create-component-composite-reshaped/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "expectedMcpTools": { | ||
| "get-storybook-story-instructions": { | ||
| "minCalls": 1 | ||
| }, | ||
| "run-story-tests": { | ||
| "minCalls": 1 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
eval/tasks/903-create-component-async-fetch-reshaped/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 903 - Create Component (Async Fetch, Reshaped) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Tests whether the agent can implement async data-fetching behavior with loading, empty, and error states, then create reliable stories that mock network behavior. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Reshaped, `msw`, and `msw-storybook-addon` are installed in trial setup. | ||
| - The task targets a new `NotificationsList` at `src/components/NotificationsList.tsx`. | ||
| - Stories are expected to mock request outcomes (loaded, empty, error) without live calls. | ||
|
|
||
| ## Prompt | ||
|
|
||
| Asks the agent to build an async list component fetching `/api/notifications`, handling abort/errors, and wiring `onSelect`. Concise prompt (`prompt.concise.md`) is short and under-specified. | ||
|
|
||
| ## Quality Signal | ||
|
|
||
| | Metric | Weight | | ||
| | ------------------------------------------------------- | ------ | | ||
| | MCP tools coverage (`get-storybook-story-instructions`) | 50 % | | ||
| | MCP tools coverage (`run-story-tests`) | 50 % | | ||
|
|
||
| ## Expected MCP Tools | ||
|
|
||
| - `get-storybook-story-instructions` (at least 1 call) | ||
| - `run-story-tests` (at least 1 call) |
10 changes: 10 additions & 0 deletions
10
eval/tasks/903-create-component-async-fetch-reshaped/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "expectedMcpTools": { | ||
| "get-storybook-story-instructions": { | ||
| "minCalls": 1 | ||
| }, | ||
| "run-story-tests": { | ||
| "minCalls": 1 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
eval/tasks/904-create-component-async-module-reshaped/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 904 - Create Component (Async Module, Reshaped) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Tests whether the agent can build an async component that depends on an imported service module, model loading/empty/error states, and author testable stories with mocked module behavior. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Reshaped is installed in trial setup. | ||
| - The task targets `InventoryList` in `src/components/InventoryList.tsx`. | ||
| - Data comes from `getInventory()` in `src/services/inventoryApi.ts`. | ||
|
|
||
| ## Prompt | ||
|
|
||
| Asks the agent to implement a service-backed async list with robust states and add stories for loaded, empty, and error paths. Concise prompt (`prompt.concise.md`) only states the core objective. | ||
|
|
||
| ## Quality Signal | ||
|
|
||
| | Metric | Weight | | ||
| | ------------------------------------------------------- | ------ | | ||
| | MCP tools coverage (`get-storybook-story-instructions`) | 50 % | | ||
| | MCP tools coverage (`run-story-tests`) | 50 % | | ||
|
|
||
| ## Expected MCP Tools | ||
|
|
||
| - `get-storybook-story-instructions` (at least 1 call) | ||
| - `run-story-tests` (at least 1 call) |
10 changes: 10 additions & 0 deletions
10
eval/tasks/904-create-component-async-module-reshaped/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "expectedMcpTools": { | ||
| "get-storybook-story-instructions": { | ||
| "minCalls": 1 | ||
| }, | ||
| "run-story-tests": { | ||
| "minCalls": 1 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
eval/tasks/905-existing-component-write-story-reshaped/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # 905 - Existing Component: Write Story (Reshaped) | ||
|
|
||
| ## Purpose | ||
|
|
||
| Tests whether the agent can discover and document states for an existing component by writing complete stories from scratch. | ||
|
|
||
| ## Setup | ||
|
|
||
| - Reshaped is installed in trial setup. | ||
| - `AlertBanner` already exists at `src/components/AlertBanner.tsx`. | ||
| - The task is to create `stories/AlertBanner.stories.tsx` with key variants. | ||
|
|
||
| ## Prompt | ||
|
|
||
| Asks the agent to author stories for `info`, `success`, `warning`, `error`, and dismissible behavior. Concise prompt (`prompt.concise.md`) gives only the target file and component. | ||
|
|
||
| ## Quality Signal | ||
|
|
||
| | Metric | Weight | | ||
| | ------------------------------------------------------- | ------ | | ||
| | MCP tools coverage (`get-storybook-story-instructions`) | 50 % | | ||
| | MCP tools coverage (`run-story-tests`) | 50 % | | ||
|
|
||
| ## Expected MCP Tools | ||
|
|
||
| - `get-storybook-story-instructions` (at least 1 call) | ||
| - `run-story-tests` (at least 1 call) |
10 changes: 10 additions & 0 deletions
10
eval/tasks/905-existing-component-write-story-reshaped/config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "expectedMcpTools": { | ||
| "get-storybook-story-instructions": { | ||
| "minCalls": 1 | ||
| }, | ||
| "run-story-tests": { | ||
| "minCalls": 1 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.