Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/smart-clouds-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@storybook/mcp': patch
'@storybook/addon-mcp': patch
---

Add story ID based inputs for preview/testing workflows and surface story IDs in docs outputs.

This change keeps existing path-based story inputs (`absoluteStoryPath` + `exportName`) while adding a `storyId` input shape for `preview-stories` and `run-story-tests`. It also adds `withStoryIds` to `list-all-documentation` and includes story IDs in `get-documentation` story sections, so agents can discover and reuse IDs directly without extra filesystem lookup steps.
144 changes: 72 additions & 72 deletions apps/internal-storybook/pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions apps/internal-storybook/tests/mcp-composition-auth.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ describe('MCP Composition Auth E2E Tests', () => {

### Primary

Story ID: example-button--primary

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -154,6 +156,8 @@ describe('MCP Composition Auth E2E Tests', () => {

### Secondary

Story ID: example-button--secondary

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -162,6 +166,8 @@ describe('MCP Composition Auth E2E Tests', () => {

### Large

Story ID: example-button--large

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -170,8 +176,8 @@ describe('MCP Composition Auth E2E Tests', () => {

### Other Stories

- Small
- With A 11 Y Violation
- Small (example-button--small)
- With A 11 Y Violation (example-button--with-a-11-y-violation)

## Props

Expand Down
10 changes: 8 additions & 2 deletions apps/internal-storybook/tests/mcp-composition.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ describe('MCP Composition E2E Tests', () => {

### Primary

Story ID: example-button--primary

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -96,6 +98,8 @@ describe('MCP Composition E2E Tests', () => {

### Secondary

Story ID: example-button--secondary

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -104,6 +108,8 @@ describe('MCP Composition E2E Tests', () => {

### Large

Story ID: example-button--large

\`\`\`
import { Button } from "@my-org/my-component-library";

Expand All @@ -112,8 +118,8 @@ describe('MCP Composition E2E Tests', () => {

### Other Stories

- Small
- With A 11 Y Violation
- Small (example-button--small)
- With A 11 Y Violation (example-button--with-a-11-y-violation)

## Props

Expand Down
300 changes: 219 additions & 81 deletions apps/internal-storybook/tests/mcp-endpoint.e2e.test.ts

Large diffs are not rendered by default.

98 changes: 49 additions & 49 deletions eval/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions eval/tasks/914-preview-story-by-path/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 914 – Preview Story By Path

## Purpose

Tests whether the agent chooses the **path-based preview input** after reading story-file context directly from disk.

## Setup

- Pre-seeded Button component and existing stories.
- Prompt first asks the agent to read `stories/Button.stories.tsx` and report its imports.
- Prompt then asks the agent to preview existing `Primary` and `Secondary` stories.
- No file edits are expected.

## Prompt

Asks the agent to inspect story file imports first, then preview `Primary` and `Secondary`.

## Quality Signal

| Metric | Weight |
| ---------------------------------------------------- | ------ |
| MCP tools coverage (`preview-stories` called) | 10 % |
| Preview input strategy (path + exportName preferred) | 60 % |
| Avoid unnecessary docs fetches for button | 30 % |

## Expected MCP Tools

- `preview-stories` (at least 1 call)

For strategy quality credit, at least one preview invocation should pass `stories` using `absoluteStoryPath` + `exportName` and should not rely exclusively on `storyId`.

For docs-avoidance quality credit, the agent should not call `get-documentation` with `id: "button"` in this task.
7 changes: 7 additions & 0 deletions eval/tasks/914-preview-story-by-path/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"expectedMcpTools": {
"preview-stories": {
"minCalls": 1
}
}
}
Loading
Loading