Skip to content

Commit 48dd520

Browse files
authored
Merge pull request #171 from storybookjs/copilot/change-export-in-storybook-mcp
Fix: expose the `get-documentation-for-story` tool in the MCP Addon
2 parents 1631d4e + 3e7c3a4 commit 48dd520

File tree

14 files changed

+410
-183
lines changed

14 files changed

+410
-183
lines changed

.changeset/brave-wolves-swim.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@storybook/mcp': minor
3+
---
4+
5+
Export `addGetStoryDocumentationTool` directly instead of renaming it to `addGetComponentStoryDocumentationTool`.
6+
7+
**Breaking change**: If you were importing `addGetComponentStoryDocumentationTool` from `@storybook/mcp`, update your import to use `addGetStoryDocumentationTool` instead.

.changeset/calm-rivers-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@storybook/addon-mcp': patch
3+
---
4+
5+
Fix: expose the `get-documentation-for-story` tool in the MCP Addon.

apps/internal-storybook/pnpm-lock.yaml

Lines changed: 73 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/internal-storybook/tests/mcp-endpoint.e2e.test.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('MCP Endpoint E2E Tests', () => {
100100

101101
expect(response.result).toHaveProperty('tools');
102102
// Dev, docs, and test tools should be present
103-
expect(response.result.tools).toHaveLength(5);
103+
expect(response.result.tools).toHaveLength(6);
104104

105105
expect(response.result.tools).toMatchInlineSnapshot(`
106106
[
@@ -379,6 +379,27 @@ describe('MCP Endpoint E2E Tests', () => {
379379
"name": "get-documentation",
380380
"title": "Get Documentation",
381381
},
382+
{
383+
"description": "Get detailed documentation for a specific story variant of a UI component. Use this when you need to see more usage examples of a component, via the stories written for it.",
384+
"inputSchema": {
385+
"$schema": "http://json-schema.org/draft-07/schema#",
386+
"properties": {
387+
"componentId": {
388+
"type": "string",
389+
},
390+
"storyName": {
391+
"type": "string",
392+
},
393+
},
394+
"required": [
395+
"componentId",
396+
"storyName",
397+
],
398+
"type": "object",
399+
},
400+
"name": "get-documentation-for-story",
401+
"title": "Get Documentation for Story",
402+
},
382403
]
383404
`);
384405
});
@@ -750,6 +771,7 @@ describe('MCP Endpoint E2E Tests', () => {
750771
[
751772
"list-all-documentation",
752773
"get-documentation",
774+
"get-documentation-for-story",
753775
]
754776
`);
755777
});

eval/pnpm-lock.yaml

Lines changed: 50 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)