@cyanheads/mcp-ts-core 0.13.1 → 0.13.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/AGENTS.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Package:** `@cyanheads/mcp-ts-core`
4
- **Version:** 0.13.1
4
+ **Version:** 0.13.2
5
5
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
6
6
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
7
- **Zod:** ^4.6.1
7
+ **Zod:** ^4.6.2
8
8
  **GitHub:** [cyanheads/mcp-ts-core](https://github.com/cyanheads/mcp-ts-core)
9
9
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
10
10
  **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
package/CLAUDE.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Package:** `@cyanheads/mcp-ts-core`
4
- **Version:** 0.13.1
4
+ **Version:** 0.13.2
5
5
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
6
6
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0 (protocol revisions 2026-07-28 and 2025-*)
7
- **Zod:** ^4.6.1
7
+ **Zod:** ^4.6.2
8
8
  **GitHub:** [cyanheads/mcp-ts-core](https://github.com/cyanheads/mcp-ts-core)
9
9
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
10
10
  **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <div align="center">
2
2
  <h1>@cyanheads/mcp-ts-core</h1>
3
- <p><b>Agent-native TypeScript framework for MCP servers.</b></p>
3
+ <p><b>Agent-native TypeScript framework for MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.</b></p>
4
4
  <p>Give your agent the infrastructure, patterns, and skills to build and ship your server.</p>
5
5
  </div>
6
6
 
7
7
  <div align="center">
8
8
 
9
- [![Version](https://img.shields.io/badge/Version-0.13.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2026--07--28-8A2BE2.svg?style=flat-square)](https://modelcontextprotocol.io/specification/2026-07-28)
9
+ [![Version](https://img.shields.io/badge/Version-0.13.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2026--07--28-8A2BE2.svg?style=flat-square)](https://modelcontextprotocol.io/specification/2026-07-28)
10
10
 
11
11
  [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0%2B-blueviolet.svg?style=flat-square)](https://bun.sh/)
12
12
 
@@ -22,7 +22,7 @@ The Phase 2 remainder of the SDK v2 migration ([#305](https://github.com/cyanhea
22
22
 
23
23
  ## Fixed
24
24
 
25
- - **`transport.sessionMode` reports the mode the server actually runs in, never `auto`** ([#357](https://github.com/cyanheads/mcp-ts-core/issues/357)). A default HTTP deployment serves sessions statefully while advertising `auto` on the landing page and the `/.well-known/mcp.json` server card; it reads `stateful` there now.
25
+ - **`transport.sessionMode` reports the mode the server actually runs in, never `auto`** ([#357](https://github.com/cyanheads/mcp-ts-core/issues/357)). A default HTTP deployment serves sessions statefully while the `GET /mcp` status JSON reported `auto`; it reads `stateful` there now.
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ summary: "A fresh init scaffold builds again — the shipped build scripts resolve both tsconfig layouts — and devcheck gains a README version-badge check. runToolContract rejects out-of-schema arguments with the InvalidParams envelope a client actually receives."
3
+ breaking: false
4
+ security: false
5
+ agent-notes: |
6
+ Two adoption steps for a consumer upgrading from 0.13.1.
7
+
8
+ 1. A test asserting `ValidationError` (`-32007`) on an argument rejection
9
+ through `runToolContract` now receives `InvalidParams` (`-32602`) with the
10
+ production message — flip the assertion. Message assertions hold either
11
+ way, since both texts name the offending field.
12
+ 2. After the next `scripts/` sync, `devcheck` fails when the `README.md`
13
+ `Version-` badge disagrees with the `package.json` `version`. Fix the
14
+ badge before syncing.
15
+ ---
16
+
17
+ # 0.13.2 — 2026-09-13
18
+
19
+ ## Added
20
+
21
+ - **`lint:packaging` check 12 — README version badge parity** ([#418](https://github.com/cyanheads/mcp-ts-core/issues/418)). A shields.io `Version-<semver>-` badge in `README.md` must carry the `package.json` `version`, with `--` decoded so a prerelease matches. `devcheck`'s Packaging step now triggers on `README.md` too, so the check gates a project carrying no bundle or plugin metadata.
22
+ - **Server card publishes the resolved session mode** ([#387](https://github.com/cyanheads/mcp-ts-core/issues/387)) under the `_meta` key `io.github.cyanheads.mcp-ts-core/sessionMode` — `stateful` or `stateless`, never `auto`. SEP-2127 closes the card's top-level field set, so it ships as a namespaced extension; every field the card already emitted is unchanged.
23
+
24
+ ## Changed
25
+
26
+ - **Sync-guarantee comments in `scripts/clean-mcpb.ts` and `scripts/lint-packaging.ts` read true in a consumer's copy** ([#313](https://github.com/cyanheads/mcp-ts-core/issues/313)). The four `AGENT_DOC_ENTRY` / `NATIVE_BINDING_ENTRY` blocks no longer claim a unit test enforces the pair where `tests/` never ships, and the `KNOWN_DEV_DIRS` note names `.mcpbignore` rather than `templates/_.mcpbignore`.
27
+ - **`add-tool` skill and the 0.8.11 entry drop the server-card disabled-tool claim** ([#409](https://github.com/cyanheads/mcp-ts-core/issues/409)). The card carries no per-tool entries; the landing page is the only surface that renders a disabled tool.
28
+ - **0.12.2's session-mode entry names `GET /mcp`** — the surface that actually reported the resolved mode, rather than the landing page and server card it claimed (#387).
29
+ - **README tagline matches the `package.json` `description` verbatim.**
30
+ - Skill versions: `add-tool` 2.25 → 2.26, `api-testing` 1.9 → 1.10, `git-wrapup` 1.16 → 1.17, `polish-docs-meta` 2.16 → 2.17.
31
+
32
+ ## Fixed
33
+
34
+ - **`scripts/build.ts` resolves the build tsconfig in either layout** ([#440](https://github.com/cyanheads/mcp-ts-core/issues/440)). It probes `config/tsconfig.build.json`, then `tsconfig.build.json`, so a fresh `init` scaffold builds with no `--project` and no consumer edit; an explicit `--project` still reaches the compiler verbatim.
35
+ - **`devcheck`'s TypeScript (Worker) step probes both tsconfig locations** ([#440](https://github.com/cyanheads/mcp-ts-core/issues/440)). A worker tsconfig at the project root rendered `SKIPPED`, indistinguishable from a project with no Workers lane.
36
+ - **`scripts/verify-package.ts` builds the scaffold through its own `build` script** and asserts `dist/index.js` ([#440](https://github.com/cyanheads/mcp-ts-core/issues/440)), so a default-path regression fails `bun run test:package`.
37
+ - **`scripts/clean.ts` removes every build-info file the project's tsconfigs write** ([#441](https://github.com/cyanheads/mcp-ts-core/issues/441)) — the lane-suffixed `.tsbuildinfo.<lane>` forms, and files written beside a tsconfig in `config/`. Explicit positional arguments still replace the default set entirely.
38
+ - **`devcheck`'s running log marks a warning-demoted step as a warning** ([#344](https://github.com/cyanheads/mcp-ts-core/issues/344)). `formatCheckResult` read `exitCode` alone and printed `finished successfully` for a result the summary reported as `WARNING`; both surfaces now key on the same guard.
39
+ - **`runToolContract` rejects out-of-schema arguments as `InvalidParams` (`-32602`)** ([#416](https://github.com/cyanheads/mcp-ts-core/issues/416)), through the same `parseToolArguments` call `createToolHandler` makes, so the code, message, and `content[0].text` are what a client receives. A `ZodError` thrown inside a handler and an output-schema rejection still classify as `ValidationError`.
40
+
41
+ ## Dependencies
42
+
43
+ - `zod` ^4.6.1 → ^4.6.2
@@ -9,9 +9,9 @@ Three small surface changes plus a documentation policy. The framework gains a `
9
9
 
10
10
  ## Added
11
11
 
12
- - **`disabledTool(def, meta)` wrapper** — new `@cyanheads/mcp-ts-core/tools` export (also re-exported from the framework root). Marks a tool definition as present-in-manifest but skipped at MCP registration so `tools/list` clients can't invoke it while operators reading `/.well-known/mcp.json` and the HTML landing page still see the gated tool with an operator-facing `reason`, optional `hint`, and optional `since`. Public `ToolDefinition` interface and the `tool()` builder are untouched — the wrapper attaches an internal `__mcpDisabled` field that only `ToolRegistry` and `buildServerManifest()` read. ([#96](https://github.com/cyanheads/mcp-ts-core/issues/96))
12
+ - **`disabledTool(def, meta)` wrapper** — new `@cyanheads/mcp-ts-core/tools` export (also re-exported from the framework root). Marks a tool definition as present-in-manifest but skipped at MCP registration so `tools/list` clients can't invoke it while operators reading the HTML landing page still see the gated tool with an operator-facing `reason`, optional `hint`, and optional `since`. Public `ToolDefinition` interface and the `tool()` builder are untouched — the wrapper attaches an internal `__mcpDisabled` field that only `ToolRegistry` and `buildServerManifest()` read. ([#96](https://github.com/cyanheads/mcp-ts-core/issues/96))
13
13
  - **`DisabledMetadata` type** — `{ reason: string; hint?: string; since?: string }`. Re-exported from `@cyanheads/mcp-ts-core` and `/tools`.
14
- - **`ManifestTool.disabled`** — optional `DisabledMetadata` field threaded through `buildServerManifest()`. Surfaces in `/.well-known/mcp.json` `definitions.tools` for discovery agents that need to know a tool is gated without invoking it.
14
+ - **`ManifestTool.disabled`** — optional `DisabledMetadata` field threaded through `buildServerManifest()`. Read by the HTML landing page, which renders the gate for operators who need to know a tool is unavailable without invoking it.
15
15
  - **Landing page `disabled` bucket** — new fourth bucket rendered after `read | unspecified | write | destructive`. Cards use a muted dashed-border variant (`tool-card--disabled`), replace the invocation `<details>` with a callout containing reason + optional hint + optional `since`, and keep the schema preview so operators can still read the tool's contract. Companion "would be `<mutability>`" pill surfaces the underlying classification, suppressed when underlying is `unspecified`.
16
16
  - **Landing page `unspecified` bucket** — new third bucket between `read` and `write`. Pills, chip, and card spine use muted/italic styling to read as indeterminate, distinct from the `write` bucket's deliberate-mutation signal. ([#92](https://github.com/cyanheads/mcp-ts-core/issues/92))
17
17
 
@@ -4,7 +4,7 @@
4
4
  * @module src/mcp-server/tools/utils/toolHandlerFactory
5
5
  */
6
6
  import type { CallToolResult, ContentBlock, InputRequiredResult, ServerContext } from '@modelcontextprotocol/server';
7
- import { ZodError, type ZodObject, type ZodRawShape } from 'zod';
7
+ import { ZodError, type ZodObject, type ZodRawShape, z } from 'zod';
8
8
  import type { Context } from '../../../core/context.js';
9
9
  import { type HandlerServices } from '../../handlerContext.js';
10
10
  import type { NotifierSources } from '../../notifications.js';
@@ -47,6 +47,20 @@ export declare function buildToolErrorResult(code: JsonRpcErrorCode, message: st
47
47
  * `structuredContent.error`.
48
48
  */
49
49
  export declare function formatInputValidationMessage(toolName: string, error: ZodError): string;
50
+ /**
51
+ * Validates raw tool arguments against the definition's `input` schema, or
52
+ * throws the rejection a client receives on the wire: `InvalidParams`
53
+ * (`-32602`), the message {@link formatInputValidationMessage} renders, and the
54
+ * Zod issues as `data.issues`.
55
+ *
56
+ * The single argument-rejection path. {@link createToolHandler} and the
57
+ * `runToolContract` test helper both route through it, so a test written to
58
+ * the helper pins the code, message, and `content[]` text a deployment
59
+ * actually produces (#416). Anything that classifies a `ZodError` as
60
+ * `ValidationError` — a handler's own validation, the output-schema parse —
61
+ * is a different failure and does not come through here.
62
+ */
63
+ export declare function parseToolArguments<TDefinition extends AnyToolDefinition>(def: TDefinition, input: unknown): z.infer<TDefinition['input']>;
50
64
  /**
51
65
  * Builds an error `CallToolResult` from a raw thrown value. Classifies via
52
66
  * {@link ErrorHandler.classifyOnly} when the value isn't already an
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAC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C,EACxC,aAAa,EAAE,YAAY,EAAE,GAC5B,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,mBAAmB,CAAC,CAkBvD;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,iBAAiB,EACtB,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,eAAe,GACzB,CACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,cAAc,GAAG,mBAAmB,CAAC,CA4EjD"}
@@ -97,6 +97,26 @@ export function formatInputValidationMessage(toolName, error) {
97
97
  .join(', ');
98
98
  return `Input validation error: Invalid arguments for tool ${toolName}: ${detail}`;
99
99
  }
100
+ /**
101
+ * Validates raw tool arguments against the definition's `input` schema, or
102
+ * throws the rejection a client receives on the wire: `InvalidParams`
103
+ * (`-32602`), the message {@link formatInputValidationMessage} renders, and the
104
+ * Zod issues as `data.issues`.
105
+ *
106
+ * The single argument-rejection path. {@link createToolHandler} and the
107
+ * `runToolContract` test helper both route through it, so a test written to
108
+ * the helper pins the code, message, and `content[]` text a deployment
109
+ * actually produces (#416). Anything that classifies a `ZodError` as
110
+ * `ValidationError` — a handler's own validation, the output-schema parse —
111
+ * is a different failure and does not come through here.
112
+ */
113
+ export function parseToolArguments(def, input) {
114
+ const parsed = def.input.safeParse(input);
115
+ if (!parsed.success) {
116
+ throw new McpError(JsonRpcErrorCode.InvalidParams, formatInputValidationMessage(def.name, parsed.error), { issues: parsed.error.issues });
117
+ }
118
+ return parsed.data;
119
+ }
100
120
  /**
101
121
  * Builds an error `CallToolResult` from a raw thrown value. Classifies via
102
122
  * {@link ErrorHandler.classifyOnly} when the value isn't already an
@@ -396,11 +416,7 @@ export function createToolHandler(def, services, notifiers) {
396
416
  // to here (see `deferInputValidation`) so a rejection carries the
397
417
  // structured error envelope; the message and `InvalidParams`
398
418
  // classification match what the SDK produced before (#377).
399
- const parsedInput = def.input.safeParse(input);
400
- if (!parsedInput.success) {
401
- throw new McpError(JsonRpcErrorCode.InvalidParams, formatInputValidationMessage(def.name, parsedInput.error), { issues: parsedInput.error.issues });
402
- }
403
- const validatedInput = parsedInput.data;
419
+ const validatedInput = parseToolArguments(def, input);
404
420
  // Read by the success-attributes thunk below, which the measurement
405
421
  // evaluates after the callback settles.
406
422
  let ctx;
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAAE,QAAQ,EAAkD,CAAC,EAAE,MAAM,KAAK,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAWzE,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,MAAM,wBAAwB,GAAG,CAAC,MAAe,EAAkB,EAAE,CAAC;IACpE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;CACxD,CAAC;AAEF;;;;;;;;;GASG;AACH,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A4B,CAAC;gBACnF,OAAO,sBAAsB,CAC3B,GAAG,EACH,UAAU,EACV,eAAe,EACf,iBAAiB,CAAC,GAAG,EAAE,eAAe,EAAE,UAAU,CAAC,CACpD,CAAC;YACJ,CAAC,EACD,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,EACrC,cAAc,EACd,GAAG,EAAE;gBACH,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzD,OAAO,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC;oBAClD,CAAC,CAAC,EAAE,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE;oBACpC,CAAC,CAAC,EAAE,CAAC;YACT,CAAC,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,0EAA0E;YAC1E,+DAA+D;YAC/D,uEAAuE;YACvE,+CAA+C;YAC/C,IAAI,qBAAqB,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC,MAAM,CAAC;YAEtD,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE;gBAC9B,SAAS,EAAE,QAAQ,GAAG,CAAC,IAAI,EAAE;gBAC7B,OAAO,EAAE,UAAU;aACpB,CAAC,CAAC;YACH,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -12,8 +12,31 @@
12
12
  */
13
13
  import type { Context } from 'hono';
14
14
  import type { ServerManifest } from '../../../core/serverManifest.js';
15
+ /**
16
+ * Reverse-DNS key carrying the resolved HTTP session posture in the card's
17
+ * `_meta`. Namespaced to this framework because the value is an extension,
18
+ * not a spec field.
19
+ */
20
+ export declare const SESSION_MODE_META_KEY = "io.github.cyanheads.mcp-ts-core/sessionMode";
15
21
  /** Shape of the SEP-1649 Server Card document. */
16
22
  export interface ServerCard {
23
+ /**
24
+ * Extension data, keyed by reverse-DNS namespace.
25
+ *
26
+ * Carries {@link SESSION_MODE_META_KEY} — the session mode the server
27
+ * actually runs in, `stateful` or `stateless`, already resolved so `auto`
28
+ * never appears. A client reading only this document can decide whether to
29
+ * hold an `Mcp-Session-Id`.
30
+ *
31
+ * `_meta` because SEP-2127 closes the card's top-level field set
32
+ * (`$schema`, `name`, `version`, `description`, `title?`, `websiteUrl?`,
33
+ * `repository?`, `icons?`, `remotes?`, `_meta?`) and sanctions `_meta` as
34
+ * the one extension point. The SEP's rationale reserves `_meta` against
35
+ * advertising MCP capabilities or negotiated extension support; session
36
+ * posture is neither — it is a property of how this deployment is run,
37
+ * fixed before any client connects.
38
+ */
39
+ _meta?: Record<string, unknown>;
17
40
  /** JSON Schema identifier — hint to validators. */
18
41
  $schema?: string;
19
42
  authentication: ServerCardAuth;
@@ -1 +1 @@
1
- {"version":3,"file":"serverCard.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/transports/http/serverCard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK/D,kDAAkD;AAClD,MAAM,WAAW,UAAU;IACzB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE;QACZ,KAAK,EAAE,OAAO,CAAC;QACf,SAAS,EAAE,OAAO,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IACF,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE;QACT,oCAAoC;QACpC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,6DAA6D;IAC7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AU,CAyBpF;AA4BD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,OACnD,OAAO,KAAG,QAAQ,CAmB9B"}
@@ -13,6 +13,12 @@
13
13
  import { resolvePublicOrigin } from './publicOrigin.js';
14
14
  import { logger } from '../../../utils/internal/logger.js';
15
15
  import { requestContextService, withExtra } from '../../../utils/internal/requestContext.js';
16
+ /**
17
+ * Reverse-DNS key carrying the resolved HTTP session posture in the card's
18
+ * `_meta`. Namespaced to this framework because the value is an extension,
19
+ * not a spec field.
20
+ */
21
+ export const SESSION_MODE_META_KEY = 'io.github.cyanheads.mcp-ts-core/sessionMode';
16
22
  /**
17
23
  * Build the SEP-1649 Server Card from the manifest + request origin.
18
24
  * Pure — same inputs produce the same output.
@@ -37,6 +43,7 @@ export function buildServerCard(manifest, origin) {
37
43
  ...(manifest.extensions && { extensions: manifest.extensions }),
38
44
  ...(manifest.server.homepage && { documentation: manifest.server.homepage }),
39
45
  generated_at: manifest.builtAt,
46
+ _meta: { [SESSION_MODE_META_KEY]: manifest.transport.sessionMode },
40
47
  };
41
48
  return card;
42
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serverCard.js","sourceRoot":"","sources":["../../../../src/mcp-server/transports/http/serverCard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAyCtF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,QAAwB,EAAE,MAAc;IACtE,MAAM,kBAAkB,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;IAE5F,MAAM,IAAI,GAAe;QACvB,WAAW,EAAE,QA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AAC,CAAC,MAAM,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAC7C,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC"}
@@ -258,6 +258,11 @@ export interface RunToolContractOptions {
258
258
  * applies `format()`, enrichment, and collected content, and converts thrown
259
259
  * values to the same dual-surface error envelope used by the production tool
260
260
  * pipeline. It intentionally skips transport auth and telemetry.
261
+ *
262
+ * Arguments that fail the `input` schema are rejected through
263
+ * `parseToolArguments` — the same call the production handler factory makes —
264
+ * so the envelope is `InvalidParams` (`-32602`) with the tool-naming message a
265
+ * client receives, not a `ValidationError` the wire never carries.
261
266
  */
262
267
  export declare function runToolContract<TDefinition extends AnyToolDefinition>(definition: TDefinition, input: z.input<TDefinition['input']>, options?: RunToolContractOptions): Promise<CallToolResult>;
263
268
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EAEP,aAAa,EACb,cAAc,EACd,QAAQ,EACT,MAAM,mBAAmB,CAAC;AAkB3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAMpF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CACjC,OAAO,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,GAAG,SAAS,aA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ect, createContentStore, createContextState, createEnrich, createEnrichmentStore, readContentStore, readEnrichmentStore, stashContentStore, stashEnrichmentStore, } from '../core/context.js';
9
9
  import { contextInputsFrom, createRequestInput, isInputRequiredSignal, } from '../mcp-server/inputRequired.js';
10
- import { buildToolSuccessResult, classifyAndBuildToolErrorResult, renderToolContent, } from '../mcp-server/tools/utils/toolHandlerFactory.js';
10
+ import { buildToolSuccessResult, classifyAndBuildToolErrorResult, parseToolArguments, renderToolContent, } from '../mcp-server/tools/utils/toolHandlerFactory.js';
11
11
  import { StorageService } from '../storage/core/StorageService.js';
12
12
  import { InMemoryProvider, } from '../storage/providers/inMemory/inMemoryProvider.js';
13
13
  /**
@@ -254,6 +254,11 @@ export function createFetchMock(initialRoutes = [], options = {}) {
254
254
  * applies `format()`, enrichment, and collected content, and converts thrown
255
255
  * values to the same dual-surface error envelope used by the production tool
256
256
  * pipeline. It intentionally skips transport auth and telemetry.
257
+ *
258
+ * Arguments that fail the `input` schema are rejected through
259
+ * `parseToolArguments` — the same call the production handler factory makes —
260
+ * so the envelope is `InvalidParams` (`-32602`) with the tool-naming message a
261
+ * client receives, not a `ValidationError` the wire never carries.
257
262
  */
258
263
  export async function runToolContract(definition, input, options = {}) {
259
264
  const ctx = createMockContext({
@@ -261,7 +266,7 @@ export async function runToolContract(definition, input, options = {}) {
261
266
  ...(definition.errors && { errors: definition.errors }),
262
267
  });
263
268
  try {
264
- const validatedInput = definition.input.parse(input);
269
+ const validatedInput = parseToolArguments(definition, input);
265
270
  const output = await definition.handler(validatedInput, ctx);
266
271
  const validatedOutput = definition.output.parse(output);
267
272
  return buildToolSuccessResult(definition, ctx, validatedOutput, renderToolContent(definition, validatedOutput, ctx));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ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qB,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC,MAAM,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,IAAI,KAAK,CACb,2DAA2D,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CACtF,CAAC;AACJ,CAAC"}
@@ -4,7 +4,7 @@ description: >
4
4
  Scaffold a new MCP tool definition. Use when the user asks to add a tool, create a new tool, or implement a new capability for the server.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "2.25"
7
+ version: "2.26"
8
8
  audience: external
9
9
  type: reference
10
10
  ---
@@ -221,8 +221,8 @@ export const submitObservations = getServerConfig().enableWrites
221
221
  | Surface | Disabled tools? |
222
222
  |:---|:---|
223
223
  | `tools/list` (MCP protocol — what clients call) | **No** — disabled tools are skipped at registration |
224
- | `/.well-known/mcp.json` `definitions.tools` (Server Card) | **Yes**, with `disabled` field discovery agents see them as present-but-uncallable |
225
- | `/` (HTML landing page) | **Yes**, in a 4th muted bucket after `read \| write \| destructive` |
224
+ | `/.well-known/mcp.json` (Server Card) | **No** the card carries no per-tool entries at all, so a discovery agent reading it cannot see a disabled tool |
225
+ | `/` (HTML landing page) | **Yes**, in a 4th muted bucket after `read \| write \| destructive` — the only surface where a disabled tool is visible |
226
226
 
227
227
  The wrapper preserves all original definition fields (handler, schemas, auth scopes, error contracts) — when re-enabled, the tool already conforms to every lint rule.
228
228
 
@@ -4,7 +4,7 @@ description: >
4
4
  Testing patterns for MCP tool/resource handlers using `createMockContext` and Vitest. Covers mock context options, handler testing, McpError assertions, format testing, Vitest config setup, and test isolation conventions.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.9"
7
+ version: "1.10"
8
8
  audience: external
9
9
  type: reference
10
10
  ---
@@ -124,6 +124,8 @@ toolContractSuite(searchTool, {
124
124
 
125
125
  Use `runToolContract(definition, input, { context })` from `/testing` when a custom test runner or an imperative assertion is a better fit. It intentionally skips transport auth and telemetry; those belong in transport/integration tests.
126
126
 
127
+ Arguments that fail the `input` schema are rejected the way the production handler factory rejects them: `InvalidParams` (`-32602`), with a message naming the tool and every failing field. That is the code a client sees on the wire, so assert it — not `ValidationError` (`-32007`), which stays the classification for a `ZodError` a handler throws itself and for an output-schema rejection.
128
+
127
129
  ---
128
130
 
129
131
  ## `createMockContext` options
@@ -4,7 +4,7 @@ description: >
4
4
  Land working-tree changes as logical commits — the work grouped by concern, topped by a release commit (version bump, changelog, regenerated artifacts). Verify, commit. Stops at "committed locally on main" — or, when the project releases through a release PR, at "release branch pushed, PR open". No tag, no push to main, no publish: the release-and-publish skill merges, tags, and ships from here. Distilled from the git_wrapup_instructions protocol.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "1.16"
7
+ version: "1.17"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -82,7 +82,7 @@ Every file that declares a version must be updated. Skip any file that doesn't e
82
82
  - `server.json` — top-level `version` AND every `packages[].version` entry
83
83
  - `manifest.json` (if present) — `version`. Verify `name` is the bare package name (e.g. `bls-mcp-server`, not `@cyanheads/bls-mcp-server`)
84
84
  - `.claude-plugin/plugin.json` and `.codex-plugin/plugin.json` (if present) — `version`. Packaging validation fails on a mismatch; `.codex-plugin/mcp.json` is connection config and carries none
85
- - `README.md` — version badge
85
+ - `README.md` — version badge. Packaging validation fails on a mismatch with `package.json`; a literal `-` in a prerelease is escaped as `--` (`Version-0.14.0--rc.1-`)
86
86
  - `CLAUDE.md` / `AGENTS.md` — if they pin a version string
87
87
  - `Dockerfile` — OCI labels if they pin the version
88
88
 
@@ -269,7 +269,7 @@ If the working tree isn't clean or the release commit isn't at HEAD, something w
269
269
  ## Checklist
270
270
 
271
271
  - [ ] Diff reviewed end-to-end before version bump
272
- - [ ] Version bumped in every declaring file (`package.json`, `server.json`, `manifest.json`, `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, README badge, `CLAUDE.md`/`AGENTS.md` if they pin a version) — verify by command, not by eye: `v=$(jq -r .version package.json); grep -rl "$v" package.json server.json manifest.json .claude-plugin/plugin.json .codex-plugin/plugin.json README.md | wc -l` must equal the count of files that exist, and `grep -c "Version-$v-" README.md` must print `1`. The README badge is the one no lint reads, so it is the one that ships stale
272
+ - [ ] Version bumped in every declaring file (`package.json`, `server.json`, `manifest.json`, `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, README badge, `CLAUDE.md`/`AGENTS.md` if they pin a version) — verify by command, not by eye: `v=$(jq -r .version package.json); grep -rl "$v" package.json server.json manifest.json .claude-plugin/plugin.json .codex-plugin/plugin.json README.md | wc -l` must equal the count of files that exist, and `grep -c "Version-$v-" README.md` must print `1`. `lint:packaging` checks the README badge against `package.json`, so a stale badge now fails `devcheck` instead of shipping unnoticed — the grep still catches a badge written in a shape the check skips
273
273
  - [ ] GH issues addressed by this work commented with what landed (if working from GH issues)
274
274
  - [ ] Docs updated for any new or changed features
275
275
  - [ ] Changelog authored at `changelog/<major.minor>.x/<version>.md`
@@ -4,7 +4,7 @@ description: >
4
4
  Finalize documentation and project metadata for a ship-ready MCP server. Use after implementation is complete, tests pass, and devcheck is clean. Safe to run at any stage — each step checks current state and only acts on what still needs work.
5
5
  metadata:
6
6
  author: cyanheads
7
- version: "2.16"
7
+ version: "2.17"
8
8
  audience: external
9
9
  type: workflow
10
10
  ---
@@ -204,7 +204,7 @@ If the project ships as an `.mcpb` bundle for Claude Desktop (check for `manifes
204
204
  **`package.json` scripts:**
205
205
 
206
206
  - `bundle` — builds the `.mcpb` (`mcpb pack`, then `scripts/clean-mcpb.ts` prunes dev deps and strips dependency-shipped agent docs)
207
- - `lint:packaging` — validates `manifest.json` ↔ `server.json` env var consistency (run by `devcheck`)
207
+ - `lint:packaging` — validates `manifest.json` ↔ `server.json` env var consistency, plus the version-parity checks below (run by `devcheck`, which gates the step on `manifest.json`, a plugin manifest, `.mcpbignore`, or `README.md`)
208
208
 
209
209
  **Cross-file consistency:**
210
210
 
@@ -219,8 +219,9 @@ If the project ships as an `.mcpb` bundle for Claude Desktop (check for `manifes
219
219
  - Server description aligned across all surfaces: `package.json`, `manifest.json`, `server.json` (condensed, hard 100-char limit), README header `<p><b>`, and GitHub repo description (`gh repo edit --description`)
220
220
  - `package.json` `keywords` include baseline terms: `mcp`, `mcp-server`, `model-context-protocol`, `typescript`, `bun`, `stdio`, `streamable-http`, plus data-domain terms. GitHub repo topics (`gh repo edit --add-topic`) should match.
221
221
 
222
- **README install badges:**
222
+ **README badges:**
223
223
 
224
+ - The static version badge (`img.shields.io/badge/Version-<x.y.z>-`) must carry the `package.json` `version` — `lint:packaging` enforces the match, and errors on a badge whose segment is not a readable version. shields.io escapes a literal `-` as `--`, so a prerelease is written `Version-0.14.0--rc.1-`. A live `img.shields.io/npm/v/<pkg>` badge cannot drift and is skipped
224
225
  - If `manifest.json` exists, the README should include the Claude Desktop install badge linking to `releases/latest/download/<name>.mcpb`
225
226
  - If the package is published to npm, include Cursor and VS Code install badges
226
227
  - See `references/readme.md` for badge format and config generation commands
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/mcp-ts-core",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-core",
5
5
  "description": "Agent-native TypeScript framework for MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.",
6
6
  "files": [
@@ -309,7 +309,7 @@
309
309
  "hono": "^4.13.7",
310
310
  "jose": "^6.2.12",
311
311
  "pino": "^10.3.1",
312
- "zod": "^4.6.1"
312
+ "zod": "^4.6.2"
313
313
  },
314
314
  "peerDependencies": {
315
315
  "@duckdb/node-api": "^1.5.5-r.1",
package/scripts/build.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import { execFile } from 'node:child_process';
17
- import { readFileSync } from 'node:fs';
17
+ import { existsSync, readFileSync } from 'node:fs';
18
18
  import { readdir, stat } from 'node:fs/promises';
19
19
  import { dirname, join } from 'node:path';
20
20
  import { fileURLToPath } from 'node:url';
@@ -22,6 +22,32 @@ import { fileURLToPath } from 'node:url';
22
22
  const ROOT_DIR = join(dirname(fileURLToPath(import.meta.url)), '..');
23
23
  const DIST_DIR = join(ROOT_DIR, 'dist');
24
24
 
25
+ /** Where `bunx @cyanheads/mcp-ts-core init` writes the build tsconfig. */
26
+ const SCAFFOLD_BUILD_PROJECT = 'tsconfig.build.json';
27
+
28
+ /**
29
+ * Build tsconfig locations, in precedence order. A project may keep its project
30
+ * tsconfigs in `config/` or at the root, and this script ships to both
31
+ * verbatim, so the default is probed rather than hardcoded.
32
+ */
33
+ const BUILD_PROJECT_CANDIDATES = ['config/tsconfig.build.json', SCAFFOLD_BUILD_PROJECT];
34
+
35
+ /**
36
+ * The tsconfig to build: an explicit `--project <path>` verbatim — a missing
37
+ * one still reaches the compiler and fails there — otherwise the first
38
+ * candidate location present. With neither present the scaffold's layout is
39
+ * named, so the compiler error points at the file the project should have.
40
+ */
41
+ function resolveProject(argv: string[]): string {
42
+ const flagIndex = argv.indexOf('--project');
43
+ const explicit = flagIndex === -1 ? undefined : argv[flagIndex + 1];
44
+ if (explicit !== undefined) return explicit;
45
+ return (
46
+ BUILD_PROJECT_CANDIDATES.find((candidate) => existsSync(join(ROOT_DIR, candidate))) ??
47
+ SCAFFOLD_BUILD_PROJECT
48
+ );
49
+ }
50
+
25
51
  async function exec(
26
52
  cmd: string[],
27
53
  label: string,
@@ -92,11 +118,7 @@ function formatBytes(bytes: number): string {
92
118
  async function main() {
93
119
  // Read package info
94
120
  const pkg = JSON.parse(readFileSync(join(ROOT_DIR, 'package.json'), 'utf-8'));
95
- const projectIdx = process.argv.indexOf('--project');
96
- const project =
97
- projectIdx !== -1
98
- ? (process.argv[projectIdx + 1] ?? 'config/tsconfig.build.json')
99
- : 'config/tsconfig.build.json';
121
+ const project = resolveProject(process.argv);
100
122
 
101
123
  console.log(`\x1b[1mBuilding ${pkg.name}@${pkg.version}\x1b[0m`);
102
124
  console.log(`\x1b[2m tsconfig: ${project}\x1b[0m`);
@@ -33,7 +33,10 @@ import { fileURLToPath } from 'node:url';
33
33
  /**
34
34
  * Agent-doc entries under `node_modules/` that must not ship in a bundle.
35
35
  * KEEP IN SYNC with `AGENT_DOC_ENTRY` in `scripts/lint-packaging.ts`
36
- * (post-bundle content check) — a unit test asserts the two are identical.
36
+ * (post-bundle content check) — edit both literals together. The assertion that
37
+ * they match lives in the mcp-ts-core repository's own test suite; `tests/` is
38
+ * not part of the published package, so nothing enforces the pair in a server
39
+ * these scripts were copied into.
37
40
  */
38
41
  export const AGENT_DOC_ENTRY =
39
42
  /^node_modules\/.*(?:\/framework-skills\/|\/skills\/|\/\.claude\/|\/\.agents\/|\/SKILL\.md$)/;
@@ -41,7 +44,10 @@ export const AGENT_DOC_ENTRY =
41
44
  /**
42
45
  * Platform-specific native binding packages, which must not ship in a bundle.
43
46
  * KEEP IN SYNC with `NATIVE_BINDING_ENTRY` in `scripts/lint-packaging.ts`
44
- * (post-bundle content check) — a unit test asserts the two are identical.
47
+ * (post-bundle content check) — edit both literals together. The assertion that
48
+ * they match lives in the mcp-ts-core repository's own test suite; `tests/` is
49
+ * not part of the published package, so nothing enforces the pair in a server
50
+ * these scripts were copied into.
45
51
  *
46
52
  * `mcpb pack` archives the whole project directory, so a native dependency
47
53
  * contributes the build host's platform slice and nothing else — for
package/scripts/clean.ts CHANGED
@@ -1,12 +1,16 @@
1
1
  /**
2
2
  * @fileoverview Utility script to clean build artifacts and temporary directories.
3
3
  * @module scripts/clean
4
- * By default, it removes the 'dist' and 'logs' directories.
5
- * Custom directories can be specified as command-line arguments.
4
+ * By default, it removes the 'dist' and 'logs' directories plus every
5
+ * TypeScript build-info file the project's tsconfigs write — in the root and
6
+ * in 'config/', where a tsconfig kept there resolves its relative
7
+ * `tsBuildInfoFile` against itself.
8
+ * Custom directories can be specified as command-line arguments, which
9
+ * replace the default set entirely.
6
10
  * Works on all platforms using Node.js path normalization.
7
11
  *
8
12
  * @example
9
- * // Default directories (dist, logs):
13
+ * // Default targets (dist, logs, build info):
10
14
  * // bun run scripts/clean.ts
11
15
  *
12
16
  * // Custom directories:
@@ -21,6 +25,38 @@ interface CleanResult {
21
25
  status: 'cleaned' | 'skipped' | 'error';
22
26
  }
23
27
 
28
+ /**
29
+ * A TypeScript build-info file: the plain `.tsbuildinfo`, a `<name>.tsbuildinfo`,
30
+ * and the lane-suffixed `.tsbuildinfo.<lane>` forms a multi-tsconfig project
31
+ * writes (`tsBuildInfoFile: ".tsbuildinfo.worker"`).
32
+ */
33
+ const BUILD_INFO_FILE = /\.tsbuildinfo(\.[^.]*)?$/;
34
+
35
+ /**
36
+ * Directories a tsconfig may write its build info into. A `tsBuildInfoFile` is
37
+ * resolved against the tsconfig that declares it, so a project keeping its
38
+ * tsconfigs in `config/` leaves build info there rather than at the root.
39
+ */
40
+ const BUILD_INFO_DIRS = ['.', 'config'];
41
+
42
+ /** Every build-info file under the scanned directories, as root-relative paths. */
43
+ async function findBuildInfoFiles(root: string): Promise<string[]> {
44
+ const found = await Promise.all(
45
+ BUILD_INFO_DIRS.map(async (dir) => {
46
+ let entries: string[];
47
+ try {
48
+ entries = await readdir(resolve(root, dir));
49
+ } catch {
50
+ return []; // directory absent — nothing to clean there
51
+ }
52
+ return entries
53
+ .filter((entry) => BUILD_INFO_FILE.test(entry))
54
+ .map((entry) => (dir === '.' ? entry : `${dir}/${entry}`));
55
+ }),
56
+ );
57
+ return found.flat();
58
+ }
59
+
24
60
  /**
25
61
  * Validates that a resolved path stays within the project root.
26
62
  * Rejects absolute paths, '..' traversal, and paths that escape cwd.
@@ -46,7 +82,7 @@ const clean = async (): Promise<void> => {
46
82
  try {
47
83
  const root = process.cwd();
48
84
  const args = process.argv.slice(2);
49
- const buildInfoFiles = (await readdir(root)).filter((f) => f.endsWith('.tsbuildinfo'));
85
+ const buildInfoFiles = await findBuildInfoFiles(root);
50
86
  const dirsToClean = [...new Set(args.length > 0 ? args : ['dist', 'logs', ...buildInfoFiles])];
51
87
 
52
88
  console.log(`Cleaning directories: ${dirsToClean.join(', ')}`);
@@ -624,6 +624,13 @@ function classifyAuditVulns(output: string): { direct: string[]; upstream: strin
624
624
  // Define file extensions for linting and formatting
625
625
  const LINT_EXTS = ['.ts', '.tsx', '.js', '.jsx'];
626
626
 
627
+ /**
628
+ * Worker tsconfig locations, in precedence order. A project keeps its project
629
+ * tsconfigs in `config/` or at the root — the `init` scaffold writes the root
630
+ * form — and this script ships to both verbatim.
631
+ */
632
+ const WORKER_PROJECT_CANDIDATES = ['config/tsconfig.worker.json', 'tsconfig.worker.json'];
633
+
627
634
  const ALL_CHECKS: Check[] = [
628
635
  // Fast checks first (local operations, no network)
629
636
  {
@@ -703,18 +710,23 @@ const ALL_CHECKS: Check[] = [
703
710
  flag: '--no-packaging',
704
711
  canFix: false,
705
712
  // Validates env var alignment between manifest.json (MCPB bundle) and
706
- // server.json (MCP Registry), plus plugin marketplace manifests (#240), and
707
- // the bundle-content guards on .mcpbignore (#343). Runs when any of those
708
- // inputs is present; skipped cleanly when none exist — consumers on an
709
- // HTTP-only deploy are unaffected.
713
+ // server.json (MCP Registry), plus plugin marketplace manifests (#240), the
714
+ // bundle-content guards on .mcpbignore (#343), and the README version badge
715
+ // (#418). Runs when any of those inputs is present; skipped cleanly when
716
+ // none exist — consumers on an HTTP-only deploy are unaffected. README.md is
717
+ // a trigger in its own right: the badge check must gate a project that
718
+ // carries no bundle or plugin metadata at all, which the other three inputs
719
+ // only covered incidentally.
710
720
  getCommand: () => {
711
- const hasManifest = existsSync(path.join(ROOT_DIR, 'manifest.json'));
712
- const hasPluginManifest =
713
- existsSync(path.join(ROOT_DIR, '.claude-plugin/plugin.json')) ||
714
- existsSync(path.join(ROOT_DIR, '.codex-plugin/plugin.json')) ||
715
- existsSync(path.join(ROOT_DIR, '.codex-plugin/mcp.json'));
716
- const hasMcpbIgnore = existsSync(path.join(ROOT_DIR, '.mcpbignore'));
717
- if (!hasManifest && !hasPluginManifest && !hasMcpbIgnore) return null;
721
+ const inputs = [
722
+ 'manifest.json',
723
+ '.claude-plugin/plugin.json',
724
+ '.codex-plugin/plugin.json',
725
+ '.codex-plugin/mcp.json',
726
+ '.mcpbignore',
727
+ 'README.md',
728
+ ];
729
+ if (!inputs.some((input) => existsSync(path.join(ROOT_DIR, input)))) return null;
718
730
  return ['bun', 'run', 'scripts/lint-packaging.ts'];
719
731
  },
720
732
  tip: (c) =>
@@ -864,14 +876,20 @@ const ALL_CHECKS: Check[] = [
864
876
  canFix: false,
865
877
  // The workerd type environment is its own program: Cloudflare's ambient
866
878
  // globals cannot share one with @types/node's (#397). It reads the built
867
- // declarations, so it only has something to check after a build.
879
+ // declarations, so it only has something to check after a build. The
880
+ // tsconfig is looked for in both supported layouts — `config/` and the
881
+ // project root, which is where the `init` scaffold writes its tsconfigs
882
+ // (#440) — and the step skips only when neither carries one.
868
883
  getCommand: (ctx) => {
869
- if (!existsSync(path.join(ctx.rootDir, 'config', 'tsconfig.worker.json'))) return null;
884
+ const project = WORKER_PROJECT_CANDIDATES.find((candidate) =>
885
+ existsSync(path.join(ctx.rootDir, candidate)),
886
+ );
887
+ if (!project) return null;
870
888
  if (!existsSync(path.join(ctx.rootDir, 'dist'))) return null;
871
889
  return [
872
890
  path.join(ctx.rootDir, 'node_modules', '.bin', 'tsc'),
873
891
  '--project',
874
- 'config/tsconfig.worker.json',
892
+ project,
875
893
  '--noEmit',
876
894
  ];
877
895
  },
@@ -1030,8 +1048,21 @@ const UI = {
1030
1048
  return `${c.bold(c.yellow(`🔶 Skipping ${check.name}...`))}${c.dim(` (${reason})`)}`;
1031
1049
  },
1032
1050
 
1051
+ /**
1052
+ * The running-log line for a finished step. A result `isSuccess` demoted to a
1053
+ * warning is reported as one here too, on `printSummary`'s own guard
1054
+ * (`exitCode === 0 && warning`), so the two surfaces cannot disagree about a
1055
+ * single outcome (#344). A `{ success: false, warning }` return keeps its
1056
+ * non-zero exit and so still renders as a failure.
1057
+ */
1033
1058
  formatCheckResult(result: CommandResult, _mode: UIMode): string {
1034
- const { checkName, exitCode, duration } = result;
1059
+ const { checkName, exitCode, duration, warning } = result;
1060
+ if (exitCode === 0 && warning) {
1061
+ return [
1062
+ `${c.bold(c.yellow('⚠️'))} ${c.yellow(checkName)} ${c.yellow(`finished with a warning in ${duration}ms.`)}`,
1063
+ c.yellow(warning.replace(/^/gm, ' | ')),
1064
+ ].join('\n');
1065
+ }
1035
1066
  if (exitCode === 0) {
1036
1067
  return `${c.bold(c.green('✅'))} ${c.yellow(checkName)} ${c.green(`finished successfully in ${duration}ms.`)}`;
1037
1068
  }
@@ -54,6 +54,11 @@
54
54
  * path variables (the host delivers anything else as the literal string),
55
55
  * and an optional string option has `"default": ""` so a blank answer
56
56
  * arrives as empty rather than as the unsubstituted placeholder.
57
+ * 12. README version badge parity: a shields.io `Version-<semver>-` badge in
58
+ * `README.md` must carry the `package.json` `version`. The badge is the
59
+ * package's headline version on GitHub and npmjs.com and ships in the
60
+ * tarball, so a half-finished bump is publicly visible. Skipped when the
61
+ * README, the badge, or the package version is absent (issue #418).
57
62
  *
58
63
  * Every check skips cleanly when its input is absent — consumers who deleted
59
64
  * `manifest.json` for an HTTP-only deploy, or who haven't built a bundle,
@@ -99,8 +104,10 @@ const USER_CONFIG_REF = /^\$\{user_config\.([\w-]+)\}$/;
99
104
  /**
100
105
  * Root dev directories the scaffold template excludes from the bundle, and
101
106
  * whose `.mcpbignore` patterns must be anchored with `/` to avoid also
102
- * stripping nested runtime paths like `node_modules/x/framework-skills/`. Keep in step
103
- * with the directory entries in `templates/_.mcpbignore`.
107
+ * stripping nested runtime paths like `node_modules/x/framework-skills/`. Keep
108
+ * in step with the directory entries in this project's `.mcpbignore` — seeded
109
+ * from the mcp-ts-core repository's `templates/_.mcpbignore`, whose `_` prefix
110
+ * `init` drops on copy.
104
111
  */
105
112
  export const KNOWN_DEV_DIRS = ['framework-skills/', '.agents/', '.claude/'];
106
113
 
@@ -121,7 +128,10 @@ export const CRITICAL_RUNTIME_PATHS = [
121
128
  * `framework-skills/` is this framework's tree; `skills/` covers any other
122
129
  * dependency that vendors agent skills.
123
130
  * KEEP IN SYNC with `AGENT_DOC_ENTRY` in `scripts/clean-mcpb.ts` (the strip
124
- * step this check verifies) — a unit test asserts the two are identical.
131
+ * step this check verifies) — edit both literals together. The assertion that
132
+ * they match lives in the mcp-ts-core repository's own test suite; `tests/` is
133
+ * not part of the published package, so nothing enforces the pair in a server
134
+ * these scripts were copied into.
125
135
  */
126
136
  export const AGENT_DOC_ENTRY =
127
137
  /^node_modules\/.*(?:\/framework-skills\/|\/skills\/|\/\.claude\/|\/\.agents\/|\/SKILL\.md$)/;
@@ -129,7 +139,10 @@ export const AGENT_DOC_ENTRY =
129
139
  /**
130
140
  * Platform-specific native binding packages that must not ship in a bundle.
131
141
  * KEEP IN SYNC with `NATIVE_BINDING_ENTRY` in `scripts/clean-mcpb.ts` (the
132
- * strip step this check verifies) — a unit test asserts the two are identical.
142
+ * strip step this check verifies) — edit both literals together. The assertion
143
+ * that they match lives in the mcp-ts-core repository's own test suite;
144
+ * `tests/` is not part of the published package, so nothing enforces the pair
145
+ * in a server these scripts were copied into.
133
146
  */
134
147
  export const NATIVE_BINDING_ENTRY = /^node_modules\/@duckdb\/node-bindings-[^/]+\//;
135
148
 
@@ -673,6 +686,62 @@ export function checkPluginManifests(
673
686
  return errors;
674
687
  }
675
688
 
689
+ /**
690
+ * The shields.io static version badge, anchored on the `Version-` label and the
691
+ * `-` that closes the version segment. A literal `-` inside a badge segment is
692
+ * escaped as `--`, so the segment is "runs of non-dash characters joined by
693
+ * escaped dashes" — which also keeps the scan linear, since the alternation
694
+ * cannot match the same character two ways. Anchoring on the label and the
695
+ * trailing `-` tolerates colour, extension, and query-string variation without
696
+ * enumerating them, and matches no other badge: a live `img.shields.io/npm/v/…`
697
+ * badge has no `badge/Version-` path.
698
+ */
699
+ const README_VERSION_BADGE = /img\.shields\.io\/badge\/Version-([^-]*(?:--[^-]*)*)-/;
700
+
701
+ /**
702
+ * A version the badge can be compared against once its `--` escapes are
703
+ * decoded: the semver core, then at most one `-` prerelease segment and one
704
+ * `+` build segment. The two are separate optionals rather than one repeated
705
+ * `(?:[-+]…)*`, because `-` is itself a member of the segment character class
706
+ * — a repeated group can split a run of dashes two ways and backtracks
707
+ * exponentially on a segment the check is about to reject (CodeQL `js/redos`,
708
+ * CWE-1333). `+` is outside the class, so each segment's end is determined and
709
+ * the scan stays linear.
710
+ */
711
+ const READABLE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
712
+
713
+ /**
714
+ * Check 12: README version badge parity. When `README.md` carries a shields.io
715
+ * `Version-<semver>-` badge, its version must equal `package.json` `version` —
716
+ * the badge is the package's headline version on GitHub and npmjs.com, and it
717
+ * ships in the tarball, so a half-finished bump is publicly visible.
718
+ *
719
+ * Skipped when the README, the badge, or the package version is absent: a
720
+ * server that replaced the static badge with a live `npm/v` one has nothing to
721
+ * check, and a version-less `package.json` is the same fail-safe the
722
+ * plugin-manifest parity check applies. A badge that exists but cannot be read
723
+ * is drift the check cannot rule out, so it fails rather than skips.
724
+ */
725
+ export function checkReadmeVersionBadge(readme: string, packageVersion?: string): string[] {
726
+ if (!packageVersion) return [];
727
+
728
+ const segment = README_VERSION_BADGE.exec(readme)?.[1];
729
+ if (segment === undefined) return [];
730
+
731
+ const badgeVersion = segment.replaceAll('--', '-');
732
+ if (!READABLE_VERSION.test(badgeVersion)) {
733
+ return [
734
+ `README.md version badge segment is "${segment}" — not a readable version, so it cannot be ` +
735
+ `checked against the package.json version "${packageVersion}"; write the badge as ` +
736
+ `"Version-${packageVersion.replaceAll('-', '--')}-"`,
737
+ ];
738
+ }
739
+ if (badgeVersion === packageVersion) return [];
740
+ return [
741
+ `README.md version badge is "${badgeVersion}" — must equal the package.json version "${packageVersion}"`,
742
+ ];
743
+ }
744
+
676
745
  /** Read `packaging.pluginManifests` from devcheck.config.json; default on. */
677
746
  function pluginManifestsEnabled(): boolean {
678
747
  const cfg = tryReadJson<{ packaging?: { pluginManifests?: boolean } }>(
@@ -805,6 +874,12 @@ async function main(): Promise<void> {
805
874
  }
806
875
  }
807
876
 
877
+ // ── README version badge (check 12) ──
878
+ const readmePath = resolve('README.md');
879
+ if (existsSync(readmePath)) {
880
+ errors.push(...checkReadmeVersionBadge(readFileSync(readmePath, 'utf-8'), pkg?.version));
881
+ }
882
+
808
883
  // ── Plugin marketplace manifests (check 10) ──
809
884
  if (unscopedName && pkg?.name) {
810
885
  if (pluginManifestsEnabled()) {