@storybook/mcp 11.0.0-beta.3 → 11.0.0-beta.4
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 +6 -6
- package/dist/index.d.ts +5 -0
- package/dist/index.js +12 -34
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -88,9 +88,9 @@ A fetch-compatible request handler for your `/mcp` endpoint.
|
|
|
88
88
|
##### Behavior
|
|
89
89
|
|
|
90
90
|
- Registers these MCP tools:
|
|
91
|
-
- [`docs-list`](https://storybook.js.org/docs/next/ai/mcp
|
|
92
|
-
- [`docs-show`](https://storybook.js.org/docs/next/ai/mcp
|
|
93
|
-
- [`docs-show-story`](https://storybook.js.org/docs/next/ai/mcp
|
|
91
|
+
- [`docs-list`](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs)
|
|
92
|
+
- [`docs-show`](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs)
|
|
93
|
+
- [`docs-show-story`](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs)
|
|
94
94
|
- Uses HTTP transport from [`@tmcp/transport-http`](https://github.com/paoloricciuti/tmcp/).
|
|
95
95
|
- For each request, the handler always passes the current `Request` as `context.request`.
|
|
96
96
|
- Per-request `context` overrides handler-level `options` for:
|
|
@@ -344,7 +344,7 @@ Type:
|
|
|
344
344
|
Promise<void>;
|
|
345
345
|
```
|
|
346
346
|
|
|
347
|
-
Registers the [list tool](https://storybook.js.org/docs/next/ai/mcp
|
|
347
|
+
Registers the [list tool](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs) that returns all component/docs IDs from manifests.
|
|
348
348
|
|
|
349
349
|
#### `addGetDocumentationTool`
|
|
350
350
|
|
|
@@ -358,7 +358,7 @@ Type:
|
|
|
358
358
|
) => Promise<void>;
|
|
359
359
|
```
|
|
360
360
|
|
|
361
|
-
Registers [documentation lookup](https://storybook.js.org/docs/next/ai/mcp
|
|
361
|
+
Registers [documentation lookup](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs) by component/docs `id`.
|
|
362
362
|
|
|
363
363
|
When `options.multiSource` is `true`, the tool schema takes an optional `storybookId` input, defaulting to `local`. When it is omitted, the schema follows the request's `sources`.
|
|
364
364
|
|
|
@@ -374,4 +374,4 @@ Type:
|
|
|
374
374
|
) => Promise<void>;
|
|
375
375
|
```
|
|
376
376
|
|
|
377
|
-
Registers [story-level documentation lookup](https://storybook.js.org/docs/next/ai/mcp
|
|
377
|
+
Registers [story-level documentation lookup](https://storybook.js.org/docs/next/ai/reference/mcp-server/#docs) for a specific story variant by `componentId` and `storyName`.
|
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,7 @@ type ComponentManifestV0 = v.InferOutput<typeof ComponentManifestV0>;
|
|
|
113
113
|
declare const DocV1: v.ObjectSchema<{
|
|
114
114
|
readonly id: v.StringSchema<undefined>;
|
|
115
115
|
readonly name: v.StringSchema<undefined>;
|
|
116
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
116
117
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
117
118
|
readonly mdx: v.OptionalSchema<v.ObjectSchema<{
|
|
118
119
|
readonly $ref: v.StringSchema<undefined>;
|
|
@@ -157,6 +158,7 @@ declare const ComponentManifestV1: v.ObjectSchema<{
|
|
|
157
158
|
readonly docs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
158
159
|
readonly id: v.StringSchema<undefined>;
|
|
159
160
|
readonly name: v.StringSchema<undefined>;
|
|
161
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
160
162
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
161
163
|
readonly mdx: v.OptionalSchema<v.ObjectSchema<{
|
|
162
164
|
readonly $ref: v.StringSchema<undefined>;
|
|
@@ -261,6 +263,7 @@ declare const ComponentManifestMap: v.VariantSchema<"v", [v.ObjectSchema<{
|
|
|
261
263
|
readonly docs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
262
264
|
readonly id: v.StringSchema<undefined>;
|
|
263
265
|
readonly name: v.StringSchema<undefined>;
|
|
266
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
264
267
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
265
268
|
readonly mdx: v.OptionalSchema<v.ObjectSchema<{
|
|
266
269
|
readonly $ref: v.StringSchema<undefined>;
|
|
@@ -293,6 +296,7 @@ declare const DocsManifestMap: v.VariantSchema<"v", [v.ObjectSchema<{
|
|
|
293
296
|
readonly docs: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
294
297
|
readonly id: v.StringSchema<undefined>;
|
|
295
298
|
readonly name: v.StringSchema<undefined>;
|
|
299
|
+
readonly title: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
296
300
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
297
301
|
readonly mdx: v.OptionalSchema<v.ObjectSchema<{
|
|
298
302
|
readonly $ref: v.StringSchema<undefined>;
|
|
@@ -621,6 +625,7 @@ interface DocgenPayload {
|
|
|
621
625
|
/** Component-level summary + docgen for one subcomponent. */
|
|
622
626
|
interface DocgenSubcomponent {
|
|
623
627
|
name: string;
|
|
628
|
+
/** The file that declares the subcomponent, or the story file when it does not resolve. */
|
|
624
629
|
path: string;
|
|
625
630
|
description?: string;
|
|
626
631
|
summary?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_j03lugat0d from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_j03lugat0d from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_j03lugat0d from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_j03lugat0d.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_j03lugat0d.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_j03lugat0d.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x, {
|
|
13
|
-
get: (a, b) => (typeof require < "u" ? require : a)[b]
|
|
14
|
-
}) : x)(function(x) {
|
|
15
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
16
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
1
|
// src/index.ts
|
|
20
2
|
import { McpServer } from "tmcp";
|
|
21
3
|
import { ValibotJsonSchemaAdapter } from "@tmcp/adapter-valibot";
|
|
@@ -24,7 +6,7 @@ import { HttpTransport } from "@tmcp/transport-http";
|
|
|
24
6
|
// package.json
|
|
25
7
|
var package_default = {
|
|
26
8
|
name: "@storybook/mcp",
|
|
27
|
-
version: "11.0.0-beta.
|
|
9
|
+
version: "11.0.0-beta.4",
|
|
28
10
|
description: "MCP server that serves knowledge about your components based on your Storybook stories and documentation",
|
|
29
11
|
keywords: [
|
|
30
12
|
"mcp",
|
|
@@ -63,8 +45,8 @@ var package_default = {
|
|
|
63
45
|
],
|
|
64
46
|
dependencies: {
|
|
65
47
|
"@tmcp/adapter-valibot": "^0.1.5",
|
|
66
|
-
"@tmcp/transport-http": "^0.
|
|
67
|
-
tmcp: "^1.
|
|
48
|
+
"@tmcp/transport-http": "^0.9.1",
|
|
49
|
+
tmcp: "^1.20.1",
|
|
68
50
|
valibot: "^1.4.0"
|
|
69
51
|
},
|
|
70
52
|
devDependencies: {
|
|
@@ -816,14 +798,6 @@ function dedent(templ) {
|
|
|
816
798
|
}), string3;
|
|
817
799
|
}
|
|
818
800
|
|
|
819
|
-
// ../../core/dist/_browser-chunks/chunk-IMSF75WX.js
|
|
820
|
-
var __require2 = ((x) => typeof __require < "u" ? __require : typeof Proxy < "u" ? new Proxy(x, {
|
|
821
|
-
get: (a, b) => (typeof __require < "u" ? __require : a)[b]
|
|
822
|
-
}) : x)(function(x) {
|
|
823
|
-
if (typeof __require < "u") return __require.apply(this, arguments);
|
|
824
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
825
|
-
});
|
|
826
|
-
|
|
827
801
|
// ../../core/dist/shared/open-service/toolsets/docs/public.js
|
|
828
802
|
var ref = getToolName({ transport: "mcp" }), DOCS_TOOLSET_INSTRUCTIONS = `## Documentation Workflow
|
|
829
803
|
|
|
@@ -844,9 +818,12 @@ async function listEntryNames(access) {
|
|
|
844
818
|
return access.listNames();
|
|
845
819
|
let manifests = await access.list({ withStoryIds: !1 });
|
|
846
820
|
return [
|
|
847
|
-
...Object.values(manifests.componentManifest.components),
|
|
848
|
-
...Object.values(manifests.docsManifest?.docs ?? {})
|
|
849
|
-
|
|
821
|
+
...Object.values(manifests.componentManifest.components).map(({ id, name }) => ({ id, name })),
|
|
822
|
+
...Object.values(manifests.docsManifest?.docs ?? {}).map(({ id, name, title }) => ({
|
|
823
|
+
id,
|
|
824
|
+
name: title ?? name
|
|
825
|
+
}))
|
|
826
|
+
];
|
|
850
827
|
}
|
|
851
828
|
function emptyManifests() {
|
|
852
829
|
return { componentManifest: { v: 1, components: {} } };
|
|
@@ -981,8 +958,8 @@ function formatComponentLine(component) {
|
|
|
981
958
|
return summary ? `- ${component.name} (${component.id}): ${summary}` : `- ${component.name} (${component.id})`;
|
|
982
959
|
}
|
|
983
960
|
function formatDocLine(doc) {
|
|
984
|
-
let
|
|
985
|
-
return `- ${title ?? doc.name} (${doc.id})${summary ? `: ${summary}` : ""}`;
|
|
961
|
+
let content = "content" in doc ? doc.content : void 0, summary = doc.summary ?? extractDocsSummary(content ?? "");
|
|
962
|
+
return `- ${doc.title ?? doc.name} (${doc.id})${summary ? `: ${summary}` : ""}`;
|
|
986
963
|
}
|
|
987
964
|
function formatStorySubLine(story) {
|
|
988
965
|
return ` - ${story.name}` + (story.id ? ` (${story.id})` : "");
|
|
@@ -1252,6 +1229,7 @@ var JSDocTag = record(string(), array(string())), ManifestErrorSchema = object({
|
|
|
1252
1229
|
}), DocV1 = object({
|
|
1253
1230
|
id: string(),
|
|
1254
1231
|
name: string(),
|
|
1232
|
+
title: optional(string()),
|
|
1255
1233
|
summary: optional(string()),
|
|
1256
1234
|
mdx: optional(JsonRef),
|
|
1257
1235
|
error: optional(ManifestErrorSchema)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/mcp",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.4",
|
|
4
4
|
"description": "MCP server that serves knowledge about your components based on your Storybook stories and documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@tmcp/adapter-valibot": "^0.1.5",
|
|
42
|
-
"@tmcp/transport-http": "^0.
|
|
43
|
-
"tmcp": "^1.
|
|
42
|
+
"@tmcp/transport-http": "^0.9.1",
|
|
43
|
+
"tmcp": "^1.20.1",
|
|
44
44
|
"valibot": "^1.4.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-docgen": "^8.0.2",
|
|
50
50
|
"react-docgen-typescript": "^2.4.0",
|
|
51
51
|
"srvx": "^0.8.16",
|
|
52
|
-
"storybook": "11.0.0-beta.
|
|
52
|
+
"storybook": "11.0.0-beta.4",
|
|
53
53
|
"tinyexec": "^1.0.2",
|
|
54
54
|
"typescript": "^6.0.3"
|
|
55
55
|
},
|