@cyanheads/mcp-ts-core 0.7.1 → 0.7.3

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/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Protocol
2
2
 
3
- **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.7.1
3
+ **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.7.3
4
4
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) · **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
5
5
 
6
6
  > **Developer note:** Never assume. Read related files and docs before making changes. Read full file content for context. Never edit a file before reading it.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div align="center">
7
7
 
8
- [![Version](https://img.shields.io/badge/Version-0.7.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
8
+ [![Version](https://img.shields.io/badge/Version-0.7.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
9
9
 
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
@@ -0,0 +1,16 @@
1
+ ---
2
+ summary: Ship vitest.config subpath export as .mjs (fixes Node 22.7+ type-strip failure under node_modules); new devcheck step guards against SDK-coupling antipatterns
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.7.2 — 2026-04-24
7
+
8
+ Two small, unrelated preventive changes. The vitest config fix unblocks consumer test runs on Node 22.7+ without `NODE_OPTIONS=--no-experimental-strip-types`. The new devcheck rule pins architectural decisions about how the framework must not work around SDK internals.
9
+
10
+ ## Fixed
11
+
12
+ - **`./vitest.config` subpath export is now `.mjs`, not `.ts` ([#64](https://github.com/cyanheads/mcp-ts-core/issues/64))** — shipping raw TypeScript under `node_modules/` triggers `ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING` on Node ≥22.7 when the module loader reaches the file before Vite's config handler. Node's type stripper refuses to operate inside `node_modules/` on purpose (supply-chain hygiene), so the failure was correct and the export was wrong. The source file moves from `vitest.config.base.ts` to `vitest.config.base.mjs`; consumers importing via `@cyanheads/mcp-ts-core/vitest.config` see no API change. Removes the need for `NODE_OPTIONS=--no-experimental-strip-types` in consumer test scripts.
13
+
14
+ ## Added
15
+
16
+ - **`Framework Antipatterns` devcheck step ([#68](https://github.com/cyanheads/mcp-ts-core/issues/68))** — new source-hygiene guard at `scripts/check-framework-antipatterns.ts`, wired into devcheck alongside `MCP Definitions` and `Docs Sync`. Three rules scan `src/` for SDK-coupling shortcuts tempting to reach for when working around MCP SDK error shapes: (1) downgraded `inputSchema` (`z.unknown()`, `z.any()`, `.passthrough()`) passed to `server.registerTool()` in framework-side tool registration; (2) post-register mutation of `RegisteredTool.inputSchema`; (3) transport-layer regex/string matching on the SDK's `"Input validation error"` wording. Each breaks `tools/list` schema advertising or couples the framework to SDK internals. Rules land with zero current violations — pre-emptive hygiene ahead of [#66](https://github.com/cyanheads/mcp-ts-core/issues/66) implementation.
@@ -0,0 +1,16 @@
1
+ ---
2
+ summary: format-parity numeric normalization rejects lossy digit-shift transforms while preserving locale support; fetchWithTimeout SSRF guard documented as best-effort with DNS-rebinding caveat
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.7.3 — 2026-04-24
7
+
8
+ Two small follow-ups to v0.7.0/v0.7.1 work. The format-parity numeric normalization landed in [#54](https://github.com/cyanheads/mcp-ts-core/pull/57) widened too far — it accepted lossy decimal-shift transforms because it stripped both `,` and `.` globally before the sentinel match. The SSRF helper docs claimed more than they deliver: there's a real DNS-rebinding / TOCTOU window between the helper's pre-validation lookup and `fetch`'s own resolution.
9
+
10
+ ## Fixed
11
+
12
+ - **`format-parity` numeric normalization preserves decimal marks ([#58](https://github.com/cyanheads/mcp-ts-core/issues/58))** — replaces the global `,`/`.` strip with a context-aware `THOUSANDS_GROUP_PATTERN` (`\b\d{1,3}(?:[SEP]\d{3})+\b`) that only collapses separators flanked by the canonical digit-grouping shape. Lossy transforms (`value / 10` rendered as `90,000,000.1`, `value / 100` as `9000000.01`) now correctly fail parity instead of false-positive matching. Mainstream locales preserved: en-US, de-DE, fr-FR, tr-TR, pt-BR, nl-NL, sv-SE, es-ES, de-CH all still pass via `toLocaleString` / `Intl.NumberFormat`. Acknowledged tradeoff: Indian lakh/crore groupings (`hi-IN`'s `90,00,00,001` — groups of 2 after the initial 3) don't fit the `\d{3}` shape and now fail parity where they previously passed via the global strip; documented inline as an acceptable cost to reject digit-shift transforms.
13
+
14
+ ## Documentation
15
+
16
+ - **`fetchWithTimeout` SSRF guard reframed as best-effort ([#60](https://github.com/cyanheads/mcp-ts-core/issues/60))** — adds explicit DNS-rebinding / TOCTOU caveat to `FetchWithTimeoutOptions.rejectPrivateIPs`, `assertNotPrivateUrl`, and `assertDnsNotPrivate` JSDoc. Node's pre-validation `dns.resolve4`/`resolve6` lookup is independent from the native `fetch` call's own resolution, so a malicious authoritative DNS server (or a low-TTL race) can return a public IP at validation and a private IP at fetch time. Workers path further restricted to literal-hostname/IP checks (no DNS API at the edge). Guidance updated to recommend network egress controls, a DNS-pinning fetch proxy, or a custom resolver that pins the validated address for strong SSRF isolation. `skills/api-utils/SKILL.md` row updated with matching language. No runtime behavior changes.
@@ -1 +1 @@
1
- {"version":3,"file":"format-parity-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8RlD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAwEpF"}
1
+ {"version":3,"file":"format-parity-rules.d.ts","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8TlD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,EAAE,CAwEpF"}
@@ -218,18 +218,43 @@ function collectPrimitives(value, out) {
218
218
  }
219
219
  /**
220
220
  * Common digit-group separators across locales, plus underscore (template-literal
221
- * style). Stripped from text before numeric sentinel matching so locale-aware
222
- * formatting (`toLocaleString`, `Intl.NumberFormat`) passes parity:
221
+ * style). Used both inside the `THOUSANDS_GROUP_PATTERN` character class and as
222
+ * the post-match strip pattern that collapses separators within an identified
223
+ * thousands-group run:
223
224
  * - `,` — en-US, hi-IN, others
224
225
  * - `.` — de-DE, tr-TR, pt-BR, nl-NL, id-ID, es-ES
225
226
  * - `'` `’` — de-CH (apostrophe or right single quote)
226
227
  * - ` ` variants — fr-FR, sv-SE (space, no-break, narrow no-break, thin)
227
228
  * - `٬` — Arabic thousands separator (U+066C)
228
229
  * - `_` — not a locale separator, but some template literals use it
230
+ */
231
+ const DIGIT_SEPARATOR_PATTERN = /[,._'    ’٬]/g;
232
+ /**
233
+ * Matches a thousands-group run: 1-3 leading digits followed by one or more
234
+ * groups of `(separator + exactly 3 digits)`. Context-aware — only collapses
235
+ * separators flanked by the canonical digit-grouping shape, leaving decimal marks
236
+ * and other non-grouping uses of `,` / `.` intact.
237
+ *
238
+ * Why context-aware: a global strip of `,` and `.` collapses both thousands
239
+ * separators (`900,000,001`) and decimal marks (`90,000,000.1` from a lossy
240
+ * `value / 10` transform) into the same digit run, falsely matching the sentinel.
241
+ * Restricting collapse to the `\d{1,3}(SEP\d{3})+` shape preserves locale support
242
+ * while rejecting digit-shift transforms — `90,000,000.1` collapses only the
243
+ * leading group to `90000000.1`, which does not contain `900000001`.
244
+ *
229
245
  * Compact (`1.5K`), scientific (`9e8`), and other lossy transforms still fail —
230
246
  * their digit sequences don't contain the sentinel's digits in order.
247
+ *
248
+ * Known weakness: non-standard thousands groupings — Indian lakh/crore
249
+ * (`90,00,00,001` — groups of 2 after the initial 3) — don't fit the `\d{3}`
250
+ * shape and won't be normalized. `hi-IN` `toLocaleString` output therefore fails
251
+ * parity. Acceptable tradeoff: mainstream locales are preserved and lossy
252
+ * transforms are correctly rejected.
231
253
  */
232
- const DIGIT_SEPARATOR_PATTERN = /[,._'    ’٬]/g;
254
+ const THOUSANDS_GROUP_PATTERN = /\b\d{1,3}(?:[,._'    ’٬]\d{3})+\b/g;
255
+ function normalizeDigitGroups(text) {
256
+ return text.replace(THOUSANDS_GROUP_PATTERN, (match) => match.replace(DIGIT_SEPARATOR_PATTERN, ''));
257
+ }
233
258
  function sentinelAppears(sentinel, text) {
234
259
  if (sentinel === null || sentinel === undefined)
235
260
  return false;
@@ -239,9 +264,12 @@ function sentinelAppears(sentinel, text) {
239
264
  if (text.includes(asString))
240
265
  return true;
241
266
  // Numeric sentinels may be rendered with locale-aware digit-group separators —
242
- // strip separators and retry. Non-numeric sentinels skip this normalization.
267
+ // collapse separators only inside well-formed thousands-group runs and retry.
268
+ // Context-aware matching avoids false positives from decimal marks (e.g. a
269
+ // `total / 10` lossy transform rendered as `90,000,000.1` would otherwise
270
+ // collapse to `900000001` and falsely satisfy the sentinel match).
243
271
  if (typeof sentinel === 'number' || typeof sentinel === 'bigint') {
244
- return text.replace(DIGIT_SEPARATOR_PATTERN, '').includes(asString);
272
+ return normalizeDigitGroups(text).includes(asString);
245
273
  }
246
274
  return false;
247
275
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format-parity-rules.js","sourceRoot":"","sources":["../../../src/linter/rules/format-parity-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AA2BH,yFAAyF;AACzF,SAAS,SAAS,CAAC,MAAe;IAChC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACrD,MAAM,CAAC,GAAG,MAA0E,CAAC;IACrF,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,MAAe;IACnC,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC;QACrF,MAAM,CAAC,GAAG,OAGT,CAAC;QACF,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,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C;QACb,OAAO;YACL;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,QAAQ,EAAE,SAAS;gBACnB,OAAO,EACL,SAAS,WAAW,yCAAyC;oBAC7D,IAAI,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK;oBACzD,yEAAyE;gBAC3E,cAAc,EAAE,MAAM;gBACtB,cAAc,EAAE,WAAW;aAC5B;SACF,CAAC;IACJ,CAAC;IAED,oBAAoB;IACpB,MAAM,WAAW,GAAqB,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QAChC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;YACpC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC;YAC1D,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,OAAO;gBACjB,OAAO,EACL,SAAS,WAAW,4CAA4C,WAAW,MAAM;oBACjF,kGAAkG;oBAClG,mFAAmF;oBACnF,sFAAsF;oBACtF,wJAAwJ;oBACxJ,4IAA4I;oBAC5I,6PAA6P;gBAC/P,cAAc,EAAE,MAAM;gBACtB,cAAc,EAAE,WAAW;aAC5B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777066676847,"env":"testing","version":"0.0.0-test","pid":94053,"requestId":"VIVWU-GN2HZ","timestamp":"2026-04-24T21:37:56.846Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"ddc6b8ca0ee55fbddaa374f844c82879a53ec845db514c7d0fec3555558447ac","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"ddc6b8ca0ee55fbddaa374f844c82879a53ec845db514c7d0fec3555558447ac","toolName":"scoped_echo","requestId":"VIVWU-GN2HZ","timestamp":"2026-04-24T21:37:56.846Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:105:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777066677159,"env":"testing","version":"0.7.1","pid":94056,"requestId":"DNNUR-YY6YG","timestamp":"2026-04-24T21:37:57.158Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"DNNUR-YY6YG","timestamp":"2026-04-24T21:37:57.158Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777066677172,"env":"testing","version":"0.7.1","pid":94056,"requestId":"SJIM1-GHBOR","timestamp":"2026-04-24T21:37:57.172Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"SJIM1-GHBOR","timestamp":"2026-04-24T21:37:57.172Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777066677175,"env":"testing","version":"0.7.1","pid":94056,"requestId":"N3O5S-8BURP","timestamp":"2026-04-24T21:37:57.175Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"N3O5S-8BURP","timestamp":"2026-04-24T21:37:57.175Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777071424611,"env":"testing","version":"0.0.0-test","pid":94680,"requestId":"QJ7DJ-1IAFL","timestamp":"2026-04-24T22:57:04.610Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"578ae2035d7fcd3b92a7ee55f52245a8b21a6e229b6f9f9c1a64bd4537627c68","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"578ae2035d7fcd3b92a7ee55f52245a8b21a6e229b6f9f9c1a64bd4537627c68","toolName":"scoped_echo","requestId":"QJ7DJ-1IAFL","timestamp":"2026-04-24T22:57:04.610Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:105:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777071425389,"env":"testing","version":"0.7.3","pid":94715,"requestId":"LQA7Q-40F5G","timestamp":"2026-04-24T22:57:05.388Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"LQA7Q-40F5G","timestamp":"2026-04-24T22:57:05.388Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777071425407,"env":"testing","version":"0.7.3","pid":94715,"requestId":"CA60Z-YLMPA","timestamp":"2026-04-24T22:57:05.407Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"CA60Z-YLMPA","timestamp":"2026-04-24T22:57:05.407Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777071425411,"env":"testing","version":"0.7.3","pid":94715,"requestId":"52E98-LLMA1","timestamp":"2026-04-24T22:57:05.411Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"52E98-LLMA1","timestamp":"2026-04-24T22:57:05.411Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777066676847,"env":"testing","version":"0.0.0-test","pid":94053,"requestId":"VIVWU-GN2HZ","timestamp":"2026-04-24T21:37:56.846Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"ddc6b8ca0ee55fbddaa374f844c82879a53ec845db514c7d0fec3555558447ac","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"ddc6b8ca0ee55fbddaa374f844c82879a53ec845db514c7d0fec3555558447ac","toolName":"scoped_echo","requestId":"VIVWU-GN2HZ","timestamp":"2026-04-24T21:37:56.846Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:105:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777066677159,"env":"testing","version":"0.7.1","pid":94056,"requestId":"DNNUR-YY6YG","timestamp":"2026-04-24T21:37:57.158Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"DNNUR-YY6YG","timestamp":"2026-04-24T21:37:57.158Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777066677172,"env":"testing","version":"0.7.1","pid":94056,"requestId":"SJIM1-GHBOR","timestamp":"2026-04-24T21:37:57.172Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"SJIM1-GHBOR","timestamp":"2026-04-24T21:37:57.172Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777066677175,"env":"testing","version":"0.7.1","pid":94056,"requestId":"N3O5S-8BURP","timestamp":"2026-04-24T21:37:57.175Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"N3O5S-8BURP","timestamp":"2026-04-24T21:37:57.175Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777071424611,"env":"testing","version":"0.0.0-test","pid":94680,"requestId":"QJ7DJ-1IAFL","timestamp":"2026-04-24T22:57:04.610Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"578ae2035d7fcd3b92a7ee55f52245a8b21a6e229b6f9f9c1a64bd4537627c68","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"578ae2035d7fcd3b92a7ee55f52245a8b21a6e229b6f9f9c1a64bd4537627c68","toolName":"scoped_echo","requestId":"QJ7DJ-1IAFL","timestamp":"2026-04-24T22:57:04.610Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:72:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:105:42)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777071425389,"env":"testing","version":"0.7.3","pid":94715,"requestId":"LQA7Q-40F5G","timestamp":"2026-04-24T22:57:05.388Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"LQA7Q-40F5G","timestamp":"2026-04-24T22:57:05.388Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777071425407,"env":"testing","version":"0.7.3","pid":94715,"requestId":"CA60Z-YLMPA","timestamp":"2026-04-24T22:57:05.407Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"CA60Z-YLMPA","timestamp":"2026-04-24T22:57:05.407Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777071425411,"env":"testing","version":"0.7.3","pid":94715,"requestId":"52E98-LLMA1","timestamp":"2026-04-24T22:57:05.411Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"52E98-LLMA1","timestamp":"2026-04-24T22:57:05.411Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:169:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -12,9 +12,9 @@ export interface FetchWithTimeoutOptions extends Omit<RequestInit, 'signal'> {
12
12
  /**
13
13
  * When `true`, rejects requests to private/reserved IP ranges and localhost.
14
14
  *
15
- * Use this when fetching user-controlled URLs to prevent SSRF attacks against
16
- * internal services (e.g., cloud metadata endpoints, internal APIs). Covered
17
- * ranges include RFC 1918, loopback (127.x, ::1), link-local (169.254.x),
15
+ * Use this when fetching user-controlled URLs to reduce the SSRF blast radius
16
+ * against internal services (e.g., cloud metadata endpoints, internal APIs).
17
+ * Covered ranges include RFC 1918, loopback (127.x, ::1), link-local (169.254.x),
18
18
  * CGNAT (100.64–127.x), and known internal hostnames (e.g., `metadata.google.internal`).
19
19
  *
20
20
  * On Node.js, DNS is also resolved and all A/AAAA records are validated against
@@ -24,6 +24,21 @@ export interface FetchWithTimeoutOptions extends Omit<RequestInit, 'signal'> {
24
24
  * When enabled, redirects are followed manually (up to {@link MAX_SSRF_REDIRECTS}
25
25
  * hops) with SSRF validation applied to each redirect target.
26
26
  *
27
+ * **Best-effort, not a hard guarantee.** Two structural gaps remain:
28
+ * - **DNS rebinding / TOCTOU.** Node's pre-validation lookup and the native
29
+ * `fetch` call's own DNS resolution are independent. A malicious authoritative
30
+ * DNS server (or a low-TTL record racing with cache eviction) can return a
31
+ * public IP at validation time and a private IP at fetch time. This helper
32
+ * does not pin the validated address to the connection.
33
+ * - **Workers have no DNS API**, so only literal-hostname/IP checks apply.
34
+ * A hostname that resolves (at the edge) to a private IP is not detected
35
+ * here.
36
+ *
37
+ * For strong SSRF isolation, layer this with network egress controls
38
+ * (Cloudflare egress rules, k8s NetworkPolicy, host firewall), a fetch proxy
39
+ * that performs DNS pinning, or an HTTP client that resolves once and connects
40
+ * to the validated address.
41
+ *
27
42
  * Default: `false` (no restriction).
28
43
  */
29
44
  rejectPrivateIPs?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"fetchWithTimeout.d.ts","sourceRoot":"","sources":["../../../src/utils/network/fetchWithTimeout.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAezE,4FAA4F;AAC5F,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC1E;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAmID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,QAAQ,CAAC,CAqKnB"}
1
+ {"version":3,"file":"fetchWithTimeout.d.ts","sourceRoot":"","sources":["../../../src/utils/network/fetchWithTimeout.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAezE,4FAA4F;AAC5F,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AA8ID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,QAAQ,CAAC,CAqKnB"}
@@ -72,6 +72,12 @@ function isPrivateIP(ip) {
72
72
  * DNS resolution failures (ENOTFOUND, etc.) are swallowed and left for the native
73
73
  * `fetch` to handle; only confirmed private IPs cause rejection.
74
74
  *
75
+ * **Best-effort guard, not a hard SSRF boundary.** This validation runs before the
76
+ * native `fetch` call performs its own DNS resolution. A malicious authoritative
77
+ * DNS server can return a public IP for this lookup and a private IP for the
78
+ * fetch's lookup (DNS rebinding / TOCTOU). Strong SSRF isolation requires
79
+ * out-of-band controls — see {@link FetchWithTimeoutOptions.rejectPrivateIPs}.
80
+ *
75
81
  * @param urlString - The fully-qualified URL string to validate.
76
82
  * @throws {McpError} `ValidationError` if the URL is malformed, the hostname is a known
77
83
  * internal name, the literal IP is private, or DNS resolves to a private address.
@@ -109,6 +115,11 @@ async function assertNotPrivateUrl(urlString) {
109
115
  * DNS resolution errors (e.g., `ENOTFOUND`) are silently swallowed — they are
110
116
  * not an SSRF signal and are better handled by the native `fetch` call.
111
117
  *
118
+ * **TOCTOU caveat:** the resolved addresses are not pinned to the subsequent
119
+ * `fetch` connection — the native fetch performs its own resolution and may
120
+ * receive a different answer (DNS rebinding, low-TTL race). This is a guard,
121
+ * not a guarantee.
122
+ *
112
123
  * @param hostname - The bare hostname to resolve (no brackets, no port).
113
124
  * @throws {McpError} `ValidationError` if any resolved address is private.
114
125
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fetchWithTimeout.js","sourceRoot":"","sources":["../../../src/utils/network/fetchWithTimeout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EACh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;YAC7B,gBAAgB,EAAE,SAAS,CAAC,QAAQ;SACrC,CAAC;QACF,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,KAAK,CAAC,2BAA2B,CAAC,GAAG,UAAU,CAAC;QAClD,CAAC;QACD,oBAAoB,EAAE,CAAC,uBAAuB,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/mcp-ts-core",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-core",
5
5
  "description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
6
6
  "main": "dist/core/index.js",
@@ -11,6 +11,7 @@
11
11
  "scripts/build-changelog.ts",
12
12
  "scripts/build.ts",
13
13
  "scripts/check-docs-sync.ts",
14
+ "scripts/check-framework-antipatterns.ts",
14
15
  "scripts/check-skills-sync.ts",
15
16
  "scripts/clean.ts",
16
17
  "scripts/devcheck.ts",
@@ -20,7 +21,7 @@
20
21
  "templates/",
21
22
  "CLAUDE.md",
22
23
  "tsconfig.base.json",
23
- "vitest.config.base.ts",
24
+ "vitest.config.base.mjs",
24
25
  "biome.json"
25
26
  ],
26
27
  "bin": {
@@ -92,7 +93,7 @@
92
93
  "import": "./dist/testing/fuzz.js"
93
94
  },
94
95
  "./tsconfig.base.json": "./tsconfig.base.json",
95
- "./vitest.config": "./vitest.config.base.ts",
96
+ "./vitest.config": "./vitest.config.base.mjs",
96
97
  "./biome": "./biome.json",
97
98
  "./package.json": "./package.json"
98
99
  },
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview Guards framework source against three SDK-coupling antipatterns
4
+ * tempting to reach for when fixing tool input-validation error shape (#66) or
5
+ * similar SDK-adjacent bugs. Each rule is narrow and mechanical — the goal is to
6
+ * pin an architectural decision so it does not have to be re-litigated per PR.
7
+ *
8
+ * Rules:
9
+ * 1. Framework must not downgrade the Zod `inputSchema` passed to
10
+ * `server.registerTool()` — the SDK rederives JSON Schema from it for
11
+ * `tools/list`, so `z.unknown()` / `z.any()` / `.passthrough()` breaks
12
+ * schema advertising. Consumer-side `.passthrough()` on output schemas
13
+ * is a documented escape hatch and stays legal (rule is scoped to
14
+ * `src/mcp-server/tools/`).
15
+ * 2. Mutating `RegisteredTool.inputSchema` after register breaks
16
+ * `tools/list` the same way — the SDK reads the stored Zod object at list
17
+ * time.
18
+ * 3. Matching the MCP SDK's error text at the transport layer (e.g. regex on
19
+ * `"Input validation error"`) is brittle across SDK versions. Any fix for
20
+ * #66 that intervenes at transport should use a structural signal, not a
21
+ * string match.
22
+ *
23
+ * Runs standalone (`bun run scripts/check-framework-antipatterns.ts`) and as
24
+ * a devcheck step.
25
+ *
26
+ * @module scripts/check-framework-antipatterns
27
+ */
28
+
29
+ import { spawnSync } from 'node:child_process';
30
+ import process from 'node:process';
31
+
32
+ interface Rule {
33
+ id: string;
34
+ /** Human-readable message printed when the rule fires. */
35
+ message: string;
36
+ /** Pathspecs to scan. Exclusions use `:!` prefix. */
37
+ pathspec: string[];
38
+ /** Extended regex (POSIX ERE) passed to `git grep -E`. */
39
+ pattern: string;
40
+ }
41
+
42
+ const RULES: Rule[] = [
43
+ {
44
+ id: 'inputSchema-downgrade',
45
+ pattern: 'inputSchema:\\s*z\\.(unknown|any)\\(\\)|inputSchema:[^,]*\\.passthrough\\(\\)',
46
+ pathspec: ['src/mcp-server/tools/', ':!**/*.test.ts'],
47
+ message: 'Framework must not downgrade tool inputSchema — breaks tools/list advertising',
48
+ },
49
+ {
50
+ id: 'inputSchema-mutation',
51
+ pattern: '\\.inputSchema\\s*=([^=]|$)',
52
+ pathspec: ['src/', ':!src/linter/', ':!**/*.test.ts'],
53
+ message: 'Post-register inputSchema mutation breaks tools/list advertising',
54
+ },
55
+ {
56
+ id: 'transport-text-match',
57
+ pattern: '[\'"`]Input validation error',
58
+ pathspec: ['src/mcp-server/transports/'],
59
+ message: 'Matching SDK error text in transport layer is brittle across SDK versions',
60
+ },
61
+ ];
62
+
63
+ interface Finding {
64
+ file: string;
65
+ line: string;
66
+ lineNo: number;
67
+ ruleId: string;
68
+ ruleMessage: string;
69
+ }
70
+
71
+ function runRule(rule: Rule): Finding[] {
72
+ const result = spawnSync('git', ['grep', '-nE', rule.pattern, '--', ...rule.pathspec], {
73
+ encoding: 'utf-8',
74
+ });
75
+
76
+ // git grep: exit 0 = matches, exit 1 = no matches, exit >=2 = error
77
+ if (result.status === 1) return [];
78
+ if (result.status !== 0) {
79
+ console.error(`git grep failed for rule '${rule.id}':`);
80
+ console.error(result.stderr);
81
+ process.exit(2);
82
+ }
83
+
84
+ return result.stdout
85
+ .trim()
86
+ .split('\n')
87
+ .filter(Boolean)
88
+ .map((raw) => {
89
+ // format: `path:line:content`
90
+ const firstColon = raw.indexOf(':');
91
+ const secondColon = raw.indexOf(':', firstColon + 1);
92
+ const file = raw.slice(0, firstColon);
93
+ const lineNo = Number(raw.slice(firstColon + 1, secondColon));
94
+ const line = raw.slice(secondColon + 1);
95
+ return { file, lineNo, line, ruleId: rule.id, ruleMessage: rule.message };
96
+ });
97
+ }
98
+
99
+ const findings = RULES.flatMap(runRule);
100
+
101
+ if (findings.length === 0) {
102
+ console.log(`No framework antipatterns found (${RULES.length} rule(s) scanned).`);
103
+ process.exit(0);
104
+ }
105
+
106
+ console.error(`Found ${findings.length} framework antipattern violation(s):`);
107
+ console.error('');
108
+ for (const f of findings) {
109
+ console.error(` ${f.file}:${f.lineNo} [${f.ruleId}]`);
110
+ console.error(` ${f.ruleMessage}`);
111
+ console.error(` ${f.line.trim()}`);
112
+ console.error('');
113
+ }
114
+ console.error(
115
+ 'See skills/api-linter/SKILL.md or scripts/check-framework-antipatterns.ts for rule rationale.',
116
+ );
117
+ process.exit(1);
@@ -416,6 +416,14 @@ const ALL_CHECKS: Check[] = [
416
416
  tip: (c) =>
417
417
  `Fix definition errors above — each diagnostic links to its rule in ${c.bold('skills/api-linter/SKILL.md')}.`,
418
418
  },
419
+ {
420
+ name: 'Framework Antipatterns',
421
+ flag: '--no-framework-antipatterns',
422
+ canFix: false,
423
+ getCommand: () => ['bun', 'run', 'scripts/check-framework-antipatterns.ts'],
424
+ tip: (c) =>
425
+ `Remove the flagged SDK-coupling shortcut. See ${c.bold('scripts/check-framework-antipatterns.ts')} for rule rationale.`,
426
+ },
419
427
  {
420
428
  name: 'Docs Sync',
421
429
  flag: '--no-docs-sync',
@@ -29,7 +29,7 @@ Utility exports from `@cyanheads/mcp-ts-core/utils`. Utilities with complex APIs
29
29
 
30
30
  | Export | API | Notes |
31
31
  |:-------|:----|:------|
32
- | `fetchWithTimeout` | `(url, timeoutMs, context: RequestContext, options?: FetchWithTimeoutOptions) -> Promise<Response>` | Wraps `fetch` with `AbortController` timeout. `FetchWithTimeoutOptions` extends `RequestInit` (minus `signal`) and adds `rejectPrivateIPs?: boolean` and `signal?: AbortSignal` (external cancellation). SSRF protection: blocks RFC 1918, loopback, link-local, CGNAT, cloud metadata. DNS validation on Node; hostname-only on Workers. Manual redirect following (max 5) with per-hop SSRF check. |
32
+ | `fetchWithTimeout` | `(url, timeoutMs, context: RequestContext, options?: FetchWithTimeoutOptions) -> Promise<Response>` | Wraps `fetch` with `AbortController` timeout. `FetchWithTimeoutOptions` extends `RequestInit` (minus `signal`) and adds `rejectPrivateIPs?: boolean` and `signal?: AbortSignal` (external cancellation). SSRF guard (best-effort, not hard isolation): blocks RFC 1918, loopback, link-local, CGNAT, cloud metadata. DNS validation on Node; hostname-only on Workers. Manual redirect following (max 5) with per-hop SSRF check. **DNS rebinding / TOCTOU gap** — the validation lookup and `fetch`'s own resolution are independent; pair with egress controls or a DNS-pinning fetch proxy for strong isolation. |
33
33
  | `withRetry` | `<T>(fn: () => Promise<T>, options?: RetryOptions) -> Promise<T>` | Executes `fn` with exponential backoff. Retries on transient errors (`ServiceUnavailable`, `Timeout`, `RateLimited`); non-transient errors fail immediately. On exhaustion, enriches the final error with attempt count in message and `data.retryAttempts`. **Place the retry boundary around the full pipeline** (fetch + parse), not just the network call. See `docs/service-resilience.md`. `RetryOptions`: `maxRetries` (default `3`), `baseDelayMs` (default `1000`), `maxDelayMs` (default `30000`), `jitter` (default `0.25`), `operation` (log label), `context` (RequestContext), `signal` (AbortSignal), `isTransient` (custom predicate). |
34
34
 
35
35
  ---
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * @fileoverview Base Vitest configuration for consumer servers.
3
+ * Shipped as `.mjs` (not `.ts`) so Node ≥22.7 does not attempt to strip
4
+ * types under `node_modules/` — `ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING`.
5
+ *
3
6
  * Extend this in your server's `vitest.config.ts`:
4
7
  *
5
8
  * ```ts