@storybook/addon-mcp 0.1.4-next.1 → 0.1.4-next.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/dist/preset.js +5 -6
- package/package.json +6 -5
package/dist/preset.js
CHANGED
|
@@ -11,7 +11,7 @@ import { buffer } from "node:stream/consumers";
|
|
|
11
11
|
|
|
12
12
|
//#region package.json
|
|
13
13
|
var name = "@storybook/addon-mcp";
|
|
14
|
-
var version = "0.1.4-next.
|
|
14
|
+
var version = "0.1.4-next.2";
|
|
15
15
|
var description = "Help agents automatically write and test stories for your UI components";
|
|
16
16
|
|
|
17
17
|
//#endregion
|
|
@@ -222,8 +222,8 @@ const initializeMCPServer = async (options) => {
|
|
|
222
222
|
adapter: new ValibotJsonSchemaAdapter(),
|
|
223
223
|
capabilities: { tools: { listChanged: true } }
|
|
224
224
|
}).withContext();
|
|
225
|
-
server.on("initialize", () => {
|
|
226
|
-
if (!options.disableTelemetry) collectTelemetry({
|
|
225
|
+
server.on("initialize", async () => {
|
|
226
|
+
if (!options.disableTelemetry) await collectTelemetry({
|
|
227
227
|
event: "session:initialized",
|
|
228
228
|
server
|
|
229
229
|
});
|
|
@@ -241,7 +241,7 @@ const initializeMCPServer = async (options) => {
|
|
|
241
241
|
logger.debug("MCP server origin:", origin);
|
|
242
242
|
return server;
|
|
243
243
|
};
|
|
244
|
-
const mcpServerHandler = async ({ req, res,
|
|
244
|
+
const mcpServerHandler = async ({ req, res, options, addonOptions }) => {
|
|
245
245
|
const disableTelemetry = options.disableTelemetry ?? false;
|
|
246
246
|
if (!initialize) initialize = initializeMCPServer(options);
|
|
247
247
|
const server = await initialize;
|
|
@@ -333,10 +333,9 @@ var template_default = "<!doctype html>\n<html>\n <head>\n {{REDIRECT_META}}\n
|
|
|
333
333
|
//#region src/preset.ts
|
|
334
334
|
const experimental_devServer = async (app, options) => {
|
|
335
335
|
const addonOptions = v.parse(AddonOptions, { toolsets: options.toolsets ?? {} });
|
|
336
|
-
app.post("/mcp", (req, res
|
|
336
|
+
app.post("/mcp", (req, res) => mcpServerHandler({
|
|
337
337
|
req,
|
|
338
338
|
res,
|
|
339
|
-
next,
|
|
340
339
|
options,
|
|
341
340
|
addonOptions
|
|
342
341
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-mcp",
|
|
3
|
-
"version": "0.1.4-next.
|
|
3
|
+
"version": "0.1.4-next.2",
|
|
4
4
|
"description": "Help agents automatically write and test stories for your UI components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook-addon",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"ai"
|
|
9
9
|
],
|
|
10
10
|
"repository": {
|
|
11
|
-
"
|
|
12
|
-
"url": "https://github.com/storybookjs/mcp.git",
|
|
11
|
+
"url": "git+https://github.com/storybookjs/mcp.git",
|
|
13
12
|
"directory": "packages/addon-mcp"
|
|
14
13
|
},
|
|
15
14
|
"license": "MIT",
|
|
@@ -30,11 +29,12 @@
|
|
|
30
29
|
"@tmcp/transport-http": "^0.8.0",
|
|
31
30
|
"tmcp": "^1.16.0",
|
|
32
31
|
"valibot": "^1.1.0",
|
|
33
|
-
"@storybook/mcp": "0.0.
|
|
32
|
+
"@storybook/mcp": "0.0.7-next.0"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
35
|
"@types/node": "20.19.0",
|
|
37
36
|
"@vitest/coverage-v8": "3.2.4",
|
|
37
|
+
"publint": "0.3.15",
|
|
38
38
|
"storybook": "^10.1.0-alpha.2",
|
|
39
39
|
"ts-dedent": "^2.2.0",
|
|
40
40
|
"tsdown": "^0.15.12",
|
|
@@ -71,8 +71,9 @@
|
|
|
71
71
|
"prebuild": "node -e \"fs.rmSync('./dist', { recursive: true, force: true })\"",
|
|
72
72
|
"build": "tsdown --config ../../tsdown.config.ts",
|
|
73
73
|
"dev": "pnpm run build -- --watch",
|
|
74
|
-
"test": "vitest",
|
|
75
74
|
"inspect": "mcp-inspector --config ../../.mcp.inspect.json --server storybook-addon-mcp",
|
|
75
|
+
"publint": "publint",
|
|
76
|
+
"test": "vitest",
|
|
76
77
|
"typecheck": "tsc --noEmit"
|
|
77
78
|
}
|
|
78
79
|
}
|