@storybook/mcp 11.0.0-alpha.0 → 11.0.0-alpha.2
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 +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +89 -60
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ instead — `storybook dev` serves one at `/mcp` through `@storybook/addon-mcp`.
|
|
|
13
13
|
|
|
14
14
|
### Prerequisites
|
|
15
15
|
|
|
16
|
-
- Node.js
|
|
16
|
+
- Node.js 22.12+
|
|
17
17
|
- A [manifests](https://storybook.js.org/docs/next/ai/manifests) source containing:
|
|
18
18
|
- `components.json` (required)
|
|
19
19
|
- `docs.json` (optional)
|
|
@@ -355,7 +355,7 @@ Type:
|
|
|
355
355
|
|
|
356
356
|
Registers [documentation lookup](https://storybook.js.org/docs/next/ai/mcp/overview/#docs-show) by component/docs `id`.
|
|
357
357
|
|
|
358
|
-
When `options.multiSource` is `true`, the tool schema
|
|
358
|
+
When `options.multiSource` is `true`, the tool schema takes an optional `storybookId` input, defaulting to `local`.
|
|
359
359
|
|
|
360
360
|
#### `addGetStoryDocumentationTool`
|
|
361
361
|
|
package/dist/index.d.ts
CHANGED
|
@@ -480,10 +480,10 @@ interface InputType {
|
|
|
480
480
|
/** @see https://storybook.js.org/docs/api/arg-types#type */
|
|
481
481
|
type?: SBType | SBScalarType['name'];
|
|
482
482
|
/**
|
|
483
|
-
*
|
|
484
|
-
*
|
|
483
|
+
* Removed. Set the story value with `args`, or the docs-table text with `table.defaultValue`.
|
|
484
|
+
* The index signature would otherwise still accept this field.
|
|
485
485
|
*/
|
|
486
|
-
defaultValue?:
|
|
486
|
+
defaultValue?: never;
|
|
487
487
|
[key: string]: any;
|
|
488
488
|
}
|
|
489
489
|
interface StrictInputType extends InputType {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_wv85m4giz1 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_wv85m4giz1 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_wv85m4giz1 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_wv85m4giz1.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_wv85m4giz1.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_wv85m4giz1.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -24,7 +24,7 @@ import { HttpTransport } from "@tmcp/transport-http";
|
|
|
24
24
|
// package.json
|
|
25
25
|
var package_default = {
|
|
26
26
|
name: "@storybook/mcp",
|
|
27
|
-
version: "11.0.0-alpha.
|
|
27
|
+
version: "11.0.0-alpha.2",
|
|
28
28
|
description: "MCP server that serves knowledge about your components based on your Storybook stories and documentation",
|
|
29
29
|
keywords: [
|
|
30
30
|
"mcp",
|
|
@@ -82,27 +82,16 @@ var package_default = {
|
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
// ../../core/dist/_browser-chunks/chunk-
|
|
86
|
-
function resolveToolsetDescription(description3, context) {
|
|
87
|
-
return typeof description3 == "function" ? description3(context) : description3;
|
|
88
|
-
}
|
|
89
|
-
async function reportToolsetTelemetry(context, event, payload) {
|
|
90
|
-
try {
|
|
91
|
-
await context.telemetry?.(event, payload);
|
|
92
|
-
} catch {
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// ../../core/dist/_browser-chunks/chunk-ZF665KZD.js
|
|
85
|
+
// ../../core/dist/_browser-chunks/chunk-IE4ULIOQ.js
|
|
97
86
|
var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
|
|
98
87
|
function words(str) {
|
|
99
88
|
return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
|
|
100
89
|
}
|
|
101
|
-
|
|
102
|
-
// ../../core/dist/_browser-chunks/chunk-TYQWMAQX.js
|
|
103
90
|
function kebabCase(str) {
|
|
104
91
|
return words(str).map((word) => word.toLowerCase()).join("-");
|
|
105
92
|
}
|
|
93
|
+
|
|
94
|
+
// ../../core/dist/_browser-chunks/chunk-QQVAH3EE.js
|
|
106
95
|
function parseToolsetMethodId(methodId) {
|
|
107
96
|
let separator = methodId.indexOf(".");
|
|
108
97
|
if (separator <= 0 || separator !== methodId.lastIndexOf(".") || separator === methodId.length - 1)
|
|
@@ -140,7 +129,12 @@ function getToolName(context) {
|
|
|
140
129
|
};
|
|
141
130
|
}
|
|
142
131
|
|
|
143
|
-
// ../../core/dist/_browser-chunks/chunk-
|
|
132
|
+
// ../../core/dist/_browser-chunks/chunk-PMPHKUPK.js
|
|
133
|
+
function resolveToolsetDescription(description3, context) {
|
|
134
|
+
return typeof description3 == "function" ? description3(context) : description3;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ../../core/dist/_browser-chunks/chunk-DJVLGLRX.js
|
|
144
138
|
function getDocsToolsetInstructions(transport) {
|
|
145
139
|
let ref = getToolName({ transport });
|
|
146
140
|
return `## Documentation Workflow
|
|
@@ -160,7 +154,7 @@ Only use properties explicitly documented or shown in example stories. Only refe
|
|
|
160
154
|
}
|
|
161
155
|
var DOCS_TOOLSET_INSTRUCTIONS = getDocsToolsetInstructions("mcp");
|
|
162
156
|
|
|
163
|
-
// ../../core/dist/_browser-chunks/chunk-
|
|
157
|
+
// ../../core/dist/_browser-chunks/chunk-FMAVANLQ.js
|
|
164
158
|
var store$4, DEFAULT_CONFIG = {
|
|
165
159
|
lang: void 0,
|
|
166
160
|
message: void 0,
|
|
@@ -787,7 +781,7 @@ function formatRequiresOwnMcpNotice(source, endpoint, options = {}) {
|
|
|
787
781
|
var RequiresOwnMcpError = class extends Error {
|
|
788
782
|
constructor(source) {
|
|
789
783
|
let endpoint = getSourceMcpEndpoint(source);
|
|
790
|
-
super(
|
|
784
|
+
super(formatRequiresOwnMcpNotice(source, endpoint)), this.name = "RequiresOwnMcpError", this.source = source, this.endpoint = endpoint;
|
|
791
785
|
}
|
|
792
786
|
}, ManifestGetError = class extends Error {
|
|
793
787
|
constructor(message, url, cause) {
|
|
@@ -1202,7 +1196,10 @@ async function defaultManifestProvider(request, path) {
|
|
|
1202
1196
|
throw new ManifestGetError(
|
|
1203
1197
|
"Request is required when using the default manifest provider. You must either pass the original request forward to the server context, or set a custom manifestProvider that doesn't need the request."
|
|
1204
1198
|
);
|
|
1205
|
-
let manifestUrl = getManifestUrlFromRequest(request, path)
|
|
1199
|
+
let manifestUrl = getManifestUrlFromRequest(request, path);
|
|
1200
|
+
return readManifestText(await fetch(manifestUrl), manifestUrl);
|
|
1201
|
+
}
|
|
1202
|
+
async function readManifestText(response, manifestUrl) {
|
|
1206
1203
|
if (!response.ok)
|
|
1207
1204
|
throw new ManifestGetError(
|
|
1208
1205
|
`Failed to fetch manifest: ${response.status} ${response.statusText}`,
|
|
@@ -1507,8 +1504,8 @@ function selectReportedManifests({
|
|
|
1507
1504
|
}) {
|
|
1508
1505
|
return manifests ?? sources?.find((listing) => listing.manifests)?.manifests;
|
|
1509
1506
|
}
|
|
1510
|
-
function resolveShow({ entry, sourceError }) {
|
|
1511
|
-
return sourceError !== void 0 ? { kind: "source-error", message: sourceError } : entry === void 0 ? { kind: "entry-missing" } : { kind: "found", entry };
|
|
1507
|
+
function resolveShow({ entry, sourceError, notice }) {
|
|
1508
|
+
return sourceError !== void 0 ? { kind: "source-error", message: sourceError } : notice !== void 0 ? { kind: "notice", message: notice } : entry === void 0 ? { kind: "entry-missing" } : { kind: "found", entry };
|
|
1512
1509
|
}
|
|
1513
1510
|
function isShowStorySelector({ storyId, componentId, storyName }) {
|
|
1514
1511
|
return storyId !== void 0 || componentId !== void 0 && storyName !== void 0;
|
|
@@ -1518,29 +1515,33 @@ function componentIdOfStoryId(storyId) {
|
|
|
1518
1515
|
return separator === -1 ? storyId : storyId.slice(0, separator);
|
|
1519
1516
|
}
|
|
1520
1517
|
function resolveShowStory(data) {
|
|
1521
|
-
let { entry, storyId, storyName, sourceError } = data;
|
|
1518
|
+
let { entry, storyId, storyName, sourceError, notice } = data;
|
|
1522
1519
|
if (!isShowStorySelector(data))
|
|
1523
1520
|
return { kind: "input-invalid" };
|
|
1524
1521
|
if (sourceError !== void 0)
|
|
1525
1522
|
return { kind: "source-error", message: sourceError };
|
|
1523
|
+
if (notice !== void 0)
|
|
1524
|
+
return { kind: "notice", message: notice };
|
|
1526
1525
|
if (entry === void 0 || entry.kind !== "component")
|
|
1527
1526
|
return { kind: "component-missing" };
|
|
1528
1527
|
let { component } = entry, story = storyId !== void 0 ? component.stories?.find((candidate) => candidate.id === storyId) : component.stories?.find((candidate) => candidate.name === storyName);
|
|
1529
|
-
return story ? { kind: "found", component,
|
|
1528
|
+
return story ? { kind: "found", component, story } : { kind: "story-missing", component };
|
|
1530
1529
|
}
|
|
1531
1530
|
function isDocsShowError(output) {
|
|
1532
|
-
|
|
1531
|
+
let { kind } = resolveShow(output);
|
|
1532
|
+
return kind !== "found" && kind !== "notice";
|
|
1533
1533
|
}
|
|
1534
1534
|
function isDocsShowStoryError(output) {
|
|
1535
|
-
|
|
1535
|
+
let { kind } = resolveShowStory(output);
|
|
1536
|
+
return kind !== "found" && kind !== "notice";
|
|
1536
1537
|
}
|
|
1537
1538
|
function describeList(ctx2) {
|
|
1538
|
-
return `List all available UI components and documentation entries from the Storybook, returning the IDs the other documentation tools take as input. Call this first for any UI task \u2014 before writing a new component, check what the design system already provides and build on it instead of hand-rolling a duplicate; before answering any question about props, API, or usage, discover the relevant IDs here rather than reading component source. Then fetch the entries with ${getToolName(ctx2)(DOCS_METHOD_REFS.show)}, referencing only IDs returned here \u2014 never guess IDs. When multiple Storybook sources are configured, entries from every source are included; scope follow-up calls to one source via their
|
|
1539
|
+
return `List all available UI components and documentation entries from the Storybook, returning the IDs the other documentation tools take as input. Call this first for any UI task \u2014 before writing a new component, check what the design system already provides and build on it instead of hand-rolling a duplicate; before answering any question about props, API, or usage, discover the relevant IDs here rather than reading component source. Then fetch the entries with ${getToolName(ctx2)(DOCS_METHOD_REFS.show)}, referencing only IDs returned here \u2014 never guess IDs. When multiple Storybook sources are configured, entries from every source are included; scope follow-up calls to one source via their storybookId input. Pass withStoryIds: true when you need story IDs for other tools.`;
|
|
1539
1540
|
}
|
|
1540
1541
|
function describeShow(ctx2) {
|
|
1541
1542
|
return `Get documentation for a UI component or docs entry.
|
|
1542
1543
|
|
|
1543
|
-
Returns the first ${MAX_STORIES_TO_SHOW} stories (including story IDs) with code snippets showing how props are used, plus TypeScript prop definitions. Call this before using a component to avoid hallucinating prop names, types, or valid combinations, and to answer any question about a component's props, API, or usage \u2014 reading or grepping the component source is not a substitute. Stories reveal real prop usage patterns, interactions, and edge cases that type definitions alone don't show. If the example stories don't show the prop you need, use the ${getToolName(ctx2)(DOCS_METHOD_REFS.showStory)} tool to fetch the story documentation for the specific story variant you need \u2014 its story ID can be passed directly as
|
|
1544
|
+
Returns the first ${MAX_STORIES_TO_SHOW} stories (including story IDs) with code snippets showing how props are used, plus TypeScript prop definitions. Call this before using a component to avoid hallucinating prop names, types, or valid combinations, and to answer any question about a component's props, API, or usage \u2014 reading or grepping the component source is not a substitute. Stories reveal real prop usage patterns, interactions, and edge cases that type definitions alone don't show. If the example stories don't show the prop you need, use the ${getToolName(ctx2)(DOCS_METHOD_REFS.showStory)} tool to fetch the story documentation for the specific story variant you need \u2014 its story ID can be passed directly as storyId.
|
|
1544
1545
|
|
|
1545
1546
|
Example: id="button" returns Primary, Secondary, Large stories with code like <Button variant="primary" size="large"> showing actual prop combinations.`;
|
|
1546
1547
|
}
|
|
@@ -1552,6 +1553,7 @@ function renderShow(data, ctx2) {
|
|
|
1552
1553
|
let resolution = resolveShow(data);
|
|
1553
1554
|
switch (resolution.kind) {
|
|
1554
1555
|
case "source-error":
|
|
1556
|
+
case "notice":
|
|
1555
1557
|
return resolution.message;
|
|
1556
1558
|
case "entry-missing":
|
|
1557
1559
|
return formatEntryNotFound(data.id, data.storybookId, ctx2);
|
|
@@ -1564,12 +1566,12 @@ function renderShow(data, ctx2) {
|
|
|
1564
1566
|
function formatAvailableStories(stories) {
|
|
1565
1567
|
return stories?.map((story) => story.id ? `${story.name} (${story.id})` : story.name).join(", ") || "none";
|
|
1566
1568
|
}
|
|
1567
|
-
function renderShowStory(data, ctx2) {
|
|
1568
|
-
let resolution = resolveShowStory(data);
|
|
1569
|
+
function renderShowStory(resolution, data, ctx2) {
|
|
1569
1570
|
switch (resolution.kind) {
|
|
1570
1571
|
case "input-invalid":
|
|
1571
1572
|
return `Provide either \`storyId\`, or both \`componentId\` and \`storyName\`. Story ids are listed by the ${getToolName(ctx2)(DOCS_METHOD_REFS.list)} tool with \`withStoryIds: true\` and in ${getToolName(ctx2)(DOCS_METHOD_REFS.show)} output.`;
|
|
1572
1573
|
case "source-error":
|
|
1574
|
+
case "notice":
|
|
1573
1575
|
return resolution.message;
|
|
1574
1576
|
case "component-missing":
|
|
1575
1577
|
return data.storyId !== void 0 ? `Story not found: "${data.storyId}". Use the ${getToolName(ctx2)(DOCS_METHOD_REFS.list)} tool with \`withStoryIds: true\` to see available stories and their ids.` : `Component not found: "${data.componentId}". Use the ${getToolName(ctx2)(DOCS_METHOD_REFS.list)} tool to see available components.`;
|
|
@@ -1578,24 +1580,35 @@ function renderShowStory(data, ctx2) {
|
|
|
1578
1580
|
return data.storyId !== void 0 ? `Story not found: "${data.storyId}" for component "${resolution.component.id}". Available stories: ${availableStories}` : `Story "${data.storyName}" not found for component "${data.componentId}". Available stories: ${availableStories}`;
|
|
1579
1581
|
}
|
|
1580
1582
|
case "found":
|
|
1581
|
-
return formatStoryDocumentation(resolution.component, resolution.
|
|
1583
|
+
return formatStoryDocumentation(resolution.component, resolution.story.name);
|
|
1582
1584
|
default:
|
|
1583
1585
|
return resolution;
|
|
1584
1586
|
}
|
|
1585
1587
|
}
|
|
1586
1588
|
var storybookIdField = {
|
|
1587
|
-
storybookId:
|
|
1588
|
-
|
|
1589
|
-
|
|
1589
|
+
storybookId: optional(
|
|
1590
|
+
pipe(
|
|
1591
|
+
string(),
|
|
1592
|
+
description(
|
|
1593
|
+
'The ID of the Storybook source to query (e.g., "local", "design-system"). Defaults to "local", this Storybook.'
|
|
1594
|
+
)
|
|
1595
|
+
),
|
|
1596
|
+
"local"
|
|
1590
1597
|
)
|
|
1591
1598
|
};
|
|
1599
|
+
async function resolveFromSource(access, id) {
|
|
1600
|
+
try {
|
|
1601
|
+
return { entry: await access.resolve(id) };
|
|
1602
|
+
} catch (error) {
|
|
1603
|
+
if (error instanceof RequiresOwnMcpError)
|
|
1604
|
+
return { notice: error.message };
|
|
1605
|
+
throw error;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1592
1608
|
function selectSource(sources, storybookId, ctx2) {
|
|
1593
1609
|
if (!sources?.length)
|
|
1594
1610
|
return {};
|
|
1595
|
-
let available = sources.map(({ source }) => source.id).join(", "), listRef = `Use the ${getToolName(ctx2)(DOCS_METHOD_REFS.list)} tool to see available sources
|
|
1596
|
-
if (!storybookId)
|
|
1597
|
-
return { sourceError: `storybookId is required. Available sources: ${available}. ${listRef}` };
|
|
1598
|
-
let match = sources.find(({ source }) => source.id === storybookId);
|
|
1611
|
+
let available = sources.map(({ source }) => source.id).join(", "), listRef = `Use the ${getToolName(ctx2)(DOCS_METHOD_REFS.list)} tool to see available sources.`, match = sources.find(({ source }) => source.id === storybookId);
|
|
1599
1612
|
return match ? { access: match.access } : {
|
|
1600
1613
|
sourceError: `Storybook source not found: "${storybookId}". Available sources: ${available}. ${listRef}`
|
|
1601
1614
|
};
|
|
@@ -1647,15 +1660,23 @@ function createDocsToolset(options) {
|
|
|
1647
1660
|
}),
|
|
1648
1661
|
title: "List All Documentation",
|
|
1649
1662
|
description: describeList,
|
|
1650
|
-
handler: async (input
|
|
1663
|
+
handler: async (input) => {
|
|
1651
1664
|
let { withStoryIds } = input, data = multiSource ? { withStoryIds, sources: await listSources(sources, { withStoryIds }) } : { withStoryIds, manifests: await docsAccess.list({ withStoryIds }) }, markdown = data.sources ? formatMultiSourceManifestsToLists(data.sources, { withStoryIds }) : formatManifestsToLists(data.manifests, { withStoryIds }), counted = selectReportedManifests(data);
|
|
1652
|
-
return
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1665
|
+
return {
|
|
1666
|
+
ok: !0,
|
|
1667
|
+
data,
|
|
1668
|
+
markdown,
|
|
1669
|
+
...counted ? {
|
|
1670
|
+
telemetry: {
|
|
1671
|
+
payload: {
|
|
1672
|
+
componentCount: Object.keys(counted.componentManifest.components).length,
|
|
1673
|
+
docsCount: Object.keys(counted.docsManifest?.docs ?? {}).length,
|
|
1674
|
+
resultTokenCount: estimateTokens(markdown),
|
|
1675
|
+
sourceCount: data.sources?.length
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
} : {}
|
|
1679
|
+
};
|
|
1659
1680
|
}
|
|
1660
1681
|
},
|
|
1661
1682
|
[DOCS_METHOD_NAMES.show]: {
|
|
@@ -1663,13 +1684,14 @@ function createDocsToolset(options) {
|
|
|
1663
1684
|
title: "Get Documentation",
|
|
1664
1685
|
description: describeShow,
|
|
1665
1686
|
handler: async (input, ctx2) => {
|
|
1666
|
-
let { id, storybookId } = input, selected = access(storybookId, ctx2), data = selected.sourceError ? { id, storybookId, sourceError: selected.sourceError } : { id, storybookId,
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
}
|
|
1687
|
+
let { id, storybookId } = input, selected = access(storybookId, ctx2), data = selected.sourceError ? { id, storybookId, sourceError: selected.sourceError } : { id, storybookId, ...await resolveFromSource(selected.access, id) }, markdown = renderShow(data, ctx2), telemetry = {
|
|
1688
|
+
payload: {
|
|
1689
|
+
componentId: id,
|
|
1690
|
+
found: data.entry !== void 0,
|
|
1691
|
+
resultTokenCount: estimateTokens(markdown)
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
return isDocsShowError(data) ? { ok: !1, data, markdown, telemetry } : { ok: !0, data, markdown, telemetry };
|
|
1673
1695
|
}
|
|
1674
1696
|
},
|
|
1675
1697
|
[DOCS_METHOD_NAMES.showStory]: {
|
|
@@ -1677,8 +1699,15 @@ function createDocsToolset(options) {
|
|
|
1677
1699
|
title: "Get Documentation for Story",
|
|
1678
1700
|
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. Identify the story by its story ID (preferred), or by componentId plus storyName.",
|
|
1679
1701
|
handler: async (input, ctx2) => {
|
|
1680
|
-
let { storyId, componentId, storyName, storybookId } = input, request = { storyId, componentId, storyName, storybookId }, resolveId = storyId !== void 0 ? componentIdOfStoryId(storyId) : componentId !== void 0 && storyName !== void 0 ? componentId : void 0, selected = resolveId !== void 0 ? access(storybookId, ctx2) : {}, data = selected.access && resolveId !== void 0 ? { ...request,
|
|
1681
|
-
|
|
1702
|
+
let { storyId, componentId, storyName, storybookId } = input, request = { storyId, componentId, storyName, storybookId }, resolveId = storyId !== void 0 ? componentIdOfStoryId(storyId) : componentId !== void 0 && storyName !== void 0 ? componentId : void 0, selected = resolveId !== void 0 ? access(storybookId, ctx2) : {}, data = selected.access && resolveId !== void 0 ? { ...request, ...await resolveFromSource(selected.access, resolveId) } : { ...request, sourceError: selected.sourceError }, resolution = resolveShowStory(data), markdown = renderShowStory(resolution, data, ctx2), telemetry = {
|
|
1703
|
+
payload: {
|
|
1704
|
+
found: resolution.kind === "found",
|
|
1705
|
+
storyId: resolution.kind === "found" ? resolution.story.id : storyId,
|
|
1706
|
+
lookup: storyId !== void 0 ? "storyId" : "name",
|
|
1707
|
+
resultTokenCount: estimateTokens(markdown)
|
|
1708
|
+
}
|
|
1709
|
+
};
|
|
1710
|
+
return isDocsShowStoryError(data) ? { ok: !1, data, markdown, telemetry } : { ok: !0, data, markdown, telemetry };
|
|
1682
1711
|
}
|
|
1683
1712
|
}
|
|
1684
1713
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/mcp",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.2",
|
|
4
4
|
"description": "MCP server that serves knowledge about your components based on your Storybook stories and documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -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-alpha.
|
|
52
|
+
"storybook": "11.0.0-alpha.2",
|
|
53
53
|
"tinyexec": "^1.0.2",
|
|
54
54
|
"typescript": "^6.0.3"
|
|
55
55
|
},
|