@storyshelf/mcp 0.7.0 → 0.8.0

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.
@@ -2,7 +2,7 @@
2
2
  import "node:path";
3
3
  import "node:url";
4
4
  import.meta.url;
5
- //#region src/capabilities.ts
5
+ // src/capabilities.ts
6
6
  /**
7
7
  * Read the instance's capabilities. An instance that does not say (an older one) or cannot be
8
8
  * reached counts as having `testing`, so no tool is hidden on a guess.
@@ -18,5 +18,4 @@ async function probeCapabilities(client) {
18
18
  function toolsFor(tools, capabilities) {
19
19
  return tools.filter((tool) => tool.routeClass !== "testing" || capabilities.testing);
20
20
  }
21
- //#endregion
22
21
  export { probeCapabilities, toolsFor };
package/dist/client.js CHANGED
@@ -3,7 +3,7 @@ import "node:path";
3
3
  import "node:url";
4
4
  import.meta.url;
5
5
  import { HttpError, httpJson } from "@storyshelf/core/utils";
6
- //#region src/client.ts
6
+ // src/client.ts
7
7
  /** Error whose message is safe to show an agent (no secrets, actionable). */
8
8
  var ToolError = class extends Error {
9
9
  name = "ToolError";
@@ -47,5 +47,4 @@ function toToolError(error) {
47
47
  if (error instanceof HttpError) return new ToolError(`StoryShelf API: ${STATUS_HINTS[error.status] ?? `request failed (${error.status})`}`);
48
48
  return new ToolError(`StoryShelf API unreachable: ${error instanceof Error ? error.message : String(error)}`);
49
49
  }
50
- //#endregion
51
50
  export { ToolError, createApiClient, toToolError };
package/dist/config.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import "node:path";
3
3
  import "node:url";
4
4
  import.meta.url;
5
- //#region src/config.ts
5
+ // src/config.ts
6
6
  /**
7
7
  * Read the connection from the environment (same variables as the CLI:
8
8
  * `STORYSHELF_URL`, `STORYSHELF_TOKEN`/`SHELF_TOKEN`, `STORYSHELF_SLUG`).
@@ -20,5 +20,4 @@ function resolveConfig(env = process.env, overrides = {}) {
20
20
  ...slug ? { slug } : {}
21
21
  };
22
22
  }
23
- //#endregion
24
23
  export { resolveConfig };
package/dist/http.js CHANGED
@@ -8,7 +8,7 @@ import { createStoryShelfMcpServer } from "./server.js";
8
8
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
9
9
  import { createServer } from "node:http";
10
10
  import { Readable } from "node:stream";
11
- //#region src/http.ts
11
+ // src/http.ts
12
12
  /**
13
13
  * Create a stateless Streamable HTTP MCP handler. Each request carries its own
14
14
  * `Authorization: Bearer` token, which is forwarded to `/api/v1`, so StoryShelf's
@@ -109,5 +109,4 @@ function toRequest(incoming, url) {
109
109
  } : {}
110
110
  });
111
111
  }
112
- //#endregion
113
112
  export { createMcpHttpHandler, serveHttp };
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { resolveConfig } from "./config.js";
6
6
  import { parseArgs } from "node:util";
7
- //#region src/index.ts
7
+ // src/index.ts
8
8
  const HELP = `storyshelf-mcp: StoryShelf MCP server
9
9
 
10
10
  Usage: storyshelf-mcp [--http] [--port 3333] [--host 127.0.0.1] [--url URL] [--slug SLUG] [--token TOKEN] [--origin ORIGIN]
@@ -70,5 +70,4 @@ try {
70
70
  process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
71
71
  process.exitCode = 1;
72
72
  }
73
- //#endregion
74
73
  export {};
package/dist/server.js CHANGED
@@ -7,7 +7,7 @@ import { toToolError } from "./client.js";
7
7
  import { ALL_TOOLS } from "./tools/index.js";
8
8
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
9
  import { z } from "zod";
10
- //#region src/server.ts
10
+ // src/server.ts
11
11
  /** What a server assumes of an instance that was not asked: nothing is hidden. */
12
12
  const ALL_CAPABILITIES = { testing: true };
13
13
  /**
@@ -17,7 +17,7 @@ const ALL_CAPABILITIES = { testing: true };
17
17
  function createStoryShelfMcpServer(client, capabilities = ALL_CAPABILITIES) {
18
18
  const server = new McpServer({
19
19
  name: "storyshelf",
20
- version: "0.7.0"
20
+ version: "0.8.0"
21
21
  }, { instructions: "StoryShelf visual testing for Storybook. Inspect builds, snapshot diffs, capture logs and advisory AI triage; add review comments. Approving or rejecting snapshots is not available: leave that to a human in the StoryShelf UI." });
22
22
  registerTools(server, client, capabilities);
23
23
  registerPrompts(server, capabilities);
@@ -71,5 +71,4 @@ function registerPrompts(server, capabilities) {
71
71
  }
72
72
  }] }));
73
73
  }
74
- //#endregion
75
74
  export { createStoryShelfMcpServer };
package/dist/stdio.js CHANGED
@@ -6,11 +6,10 @@ import { probeCapabilities } from "./capabilities.js";
6
6
  import { createApiClient } from "./client.js";
7
7
  import { createStoryShelfMcpServer } from "./server.js";
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
9
- //#region src/stdio.ts
9
+ // src/stdio.ts
10
10
  /** Serve MCP over stdio (local agents: Claude Code, Cursor). Logs go to stderr only. */
11
11
  async function runStdio(config) {
12
12
  const client = createApiClient(config);
13
13
  await createStoryShelfMcpServer(client, await probeCapabilities(client)).connect(new StdioServerTransport());
14
14
  }
15
- //#endregion
16
15
  export { runStdio };
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { buildPath, projectSlug } from "./types.js";
6
6
  import { z } from "zod";
7
- //#region src/tools/builds.ts
7
+ // src/tools/builds.ts
8
8
  const project = z.string().optional().describe("Project slug (defaults to STORYSHELF_SLUG)");
9
9
  const buildId = z.string().describe("Build id (ULID)");
10
10
  const BUILD_FIELDS = [
@@ -104,5 +104,4 @@ const buildTools = [
104
104
  getBuild,
105
105
  getCaptureLogs
106
106
  ];
107
- //#endregion
108
107
  export { buildTools, getBuild, getCaptureLogs, listBuilds };
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { buildPath } from "./types.js";
6
6
  import { z } from "zod";
7
- //#region src/tools/comments.ts
7
+ // src/tools/comments.ts
8
8
  const project = z.string().optional().describe("Project slug (defaults to STORYSHELF_SLUG)");
9
9
  const buildId = z.string().describe("Build id (ULID)");
10
10
  const listComments = {
@@ -55,5 +55,4 @@ const commentTools = [
55
55
  addComment,
56
56
  resolveComment
57
57
  ];
58
- //#endregion
59
58
  export { addComment, commentTools, listComments, resolveComment };
@@ -7,7 +7,7 @@ import { commentTools } from "./comments.js";
7
7
  import { insightTools } from "./insights.js";
8
8
  import { projectTools } from "./projects.js";
9
9
  import { snapshotTools } from "./snapshots.js";
10
- //#region src/tools/index.ts
10
+ // src/tools/index.ts
11
11
  /**
12
12
  * Every tool exposed in v1: read-only review data plus comments. No approvals and no build
13
13
  * verdicts: an agent must not be able to sign off a build (ADR 0013, decision 10).
@@ -19,5 +19,4 @@ const ALL_TOOLS = [
19
19
  ...insightTools,
20
20
  ...commentTools
21
21
  ];
22
- //#endregion
23
22
  export { ALL_TOOLS };
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { buildPath, projectSlug } from "./types.js";
6
6
  import { z } from "zod";
7
- //#region src/tools/insights.ts
7
+ // src/tools/insights.ts
8
8
  const project = z.string().optional().describe("Project slug (defaults to STORYSHELF_SLUG)");
9
9
  const getBuildInsight = {
10
10
  name: "get_build_insight",
@@ -31,5 +31,4 @@ const getProjectHealth = {
31
31
  run: async (client, args) => await client.get(`/projects/${projectSlug(client, args["project"])}/insights/health`, { window: args["window"] })
32
32
  };
33
33
  const insightTools = [getBuildInsight, getProjectHealth];
34
- //#endregion
35
34
  export { getBuildInsight, getProjectHealth, insightTools };
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { projectSlug } from "./types.js";
6
6
  import { z } from "zod";
7
- //#region src/tools/projects.ts
7
+ // src/tools/projects.ts
8
8
  const project = z.string().optional().describe("Project slug (defaults to STORYSHELF_SLUG)");
9
9
  const listProjects = {
10
10
  name: "list_projects",
@@ -33,5 +33,4 @@ function pick(source, keys) {
33
33
  return Object.fromEntries(keys.map((key) => [key, source[key]]));
34
34
  }
35
35
  const projectTools = [listProjects, getProject];
36
- //#endregion
37
36
  export { getProject, listProjects, projectTools };
@@ -4,7 +4,7 @@ import "node:url";
4
4
  import.meta.url;
5
5
  import { buildPath } from "./types.js";
6
6
  import { z } from "zod";
7
- //#region src/tools/snapshots.ts
7
+ // src/tools/snapshots.ts
8
8
  const SNAPSHOT_FIELDS = [
9
9
  "id",
10
10
  "storyId",
@@ -43,5 +43,4 @@ const listSnapshots = {
43
43
  }
44
44
  };
45
45
  const snapshotTools = [listSnapshots];
46
- //#endregion
47
46
  export { listSnapshots, snapshotTools };
@@ -3,7 +3,7 @@ import "node:path";
3
3
  import "node:url";
4
4
  import.meta.url;
5
5
  import { ToolError } from "../client.js";
6
- //#region src/tools/types.ts
6
+ // src/tools/types.ts
7
7
  /** Resolve the project slug from the call argument or the configured default. */
8
8
  function projectSlug(client, project) {
9
9
  const slug = typeof project === "string" && project ? project : client.defaultSlug;
@@ -14,5 +14,4 @@ function projectSlug(client, project) {
14
14
  function buildPath(client, args) {
15
15
  return `/projects/${projectSlug(client, args["project"])}/builds/${encodeURIComponent(String(args["buildId"]))}`;
16
16
  }
17
- //#endregion
18
17
  export { buildPath, projectSlug };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyshelf/mcp",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "StoryShelf MCP server: let AI agents read builds, diffs and AI insights, and comment on reviews.",
5
5
  "keywords": [
6
6
  "agents",
@@ -50,8 +50,8 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/sdk": "^1.20.0",
53
- "@storyshelf/core": "0.7.0",
54
- "zod": "^4.2.0"
53
+ "@storyshelf/core": "0.8.0",
54
+ "zod": "^4.6.7"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "^26.0.0",
@@ -61,7 +61,7 @@
61
61
  "oxlint-tsgolint": "^7.0.2001",
62
62
  "tsdown": "^0.22.14",
63
63
  "typescript": "^7.0.2",
64
- "vitest": "^5.0.0"
64
+ "vitest": "^5.0.5"
65
65
  },
66
66
  "engines": {
67
67
  "node": ">=24"