@storybook/mcp 10.6.0-alpha.5 → 10.6.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,11 @@ Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=r
6
6
 
7
7
  ## Self-hosting `@storybook/mcp`
8
8
 
9
+ This package is a library: the tarball ships one module and no executable. It declares no `bin`,
10
+ starts no process, and has no CLI. You register its tools on an MCP server you own, using the
11
+ snippets below. If you want a running Storybook MCP server with no code at all, use the dev server
12
+ instead — `storybook dev` serves one at `/mcp` through `@storybook/addon-mcp`.
13
+
9
14
  ### Prerequisites
10
15
 
11
16
  - Node.js 20+
@@ -15,7 +20,10 @@ Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=r
15
20
 
16
21
  ### Example implementation
17
22
 
18
- In-repo local server: [`serve.ts`](./serve.ts) (Node process that loads manifests from a directory or URL).
23
+ The Storybook repository has a local HTTP server built on this package,
24
+ [`serve.ts`](https://github.com/storybookjs/storybook/blob/next/code/lib/mcp/serve.ts), that loads
25
+ manifests from a directory or URL. It is a development harness and is not part of the published
26
+ package.
19
27
 
20
28
  The snippets below cover the common self-hosting patterns.
21
29
 
@@ -80,9 +88,9 @@ A fetch-compatible request handler for your `/mcp` endpoint.
80
88
  ##### Behavior
81
89
 
82
90
  - Registers these MCP tools:
83
- - [`list-all-documentation`](https://storybook.js.org/docs/next/ai/mcp/overview/#list-all-documentation)
84
- - [`get-documentation`](https://storybook.js.org/docs/next/ai/mcp/overview/#get-documentation)
85
- - [`get-documentation-for-story`](https://storybook.js.org/docs/next/ai/mcp/overview/#get-documentation-for-story)
91
+ - [`docs-list`](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-list)
92
+ - [`docs-show`](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-show)
93
+ - [`docs-show-story`](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-show-story)
86
94
  - Uses HTTP transport from [`@tmcp/transport-http`](https://github.com/paoloricciuti/tmcp/).
87
95
  - For each request, the handler always passes the current `Request` as `context.request`.
88
96
  - Per-request `context` overrides handler-level `options` for:
@@ -203,7 +211,7 @@ Type:
203
211
  }) => void | Promise<void>
204
212
  ```
205
213
 
206
- Optional callback after `list-all-documentation` resolves successfully.
214
+ Optional callback after `docs-list` resolves successfully.
207
215
 
208
216
  ##### `onGetDocumentation`
209
217
 
@@ -225,7 +233,7 @@ Type:
225
233
  ) => void | Promise<void>
226
234
  ```
227
235
 
228
- Optional callback after `get-documentation` runs:
236
+ Optional callback after `docs-show` runs:
229
237
 
230
238
  - When a component/docs entry is found, receives `foundDocumentation` and `resultText`.
231
239
  - When not found, receives only `context` and `input`.
@@ -331,7 +339,7 @@ Type:
331
339
  Promise<void>;
332
340
  ```
333
341
 
334
- Registers the [list tool](https://storybook.js.org/docs/next/ai/mcp/overview/#list-all-documentation) that returns all component/docs IDs from manifests.
342
+ Registers the [list tool](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-list) that returns all component/docs IDs from manifests.
335
343
 
336
344
  #### `addGetDocumentationTool`
337
345
 
@@ -345,7 +353,7 @@ Type:
345
353
  ) => Promise<void>;
346
354
  ```
347
355
 
348
- Registers [documentation lookup](https://storybook.js.org/docs/next/ai/mcp/overview/#get-documentation) by component/docs `id`.
356
+ Registers [documentation lookup](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-show) by component/docs `id`.
349
357
 
350
358
  When `options.multiSource` is `true`, the tool schema requires `storybookId` input.
351
359
 
@@ -361,4 +369,4 @@ Type:
361
369
  ) => Promise<void>;
362
370
  ```
363
371
 
364
- Registers [story-level documentation lookup](https://storybook.js.org/docs/next/ai/mcp/overview/#get-documentation-for-story) for a specific story variant by `componentId` and `storyName`.
372
+ Registers [story-level documentation lookup](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-show-story) for a specific story variant by `componentId` and `storyName`.