@cyanheads/mcp-ts-core 0.6.16 → 0.6.17

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.6.16
3
+ **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.6.17
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.6.16-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.6.17-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,26 @@
1
+ ---
2
+ summary: HTTP transport hardening for issue #50 — per-server notifier race fix, bounded-timeout close with close_failures metric, and FinalizationRegistry diagnostic for per-request McpServer/transport retention
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.6.17 — 2026-04-24
7
+
8
+ Groundwork for investigating the HTTP heap leak tracked in [#50](https://github.com/cyanheads/mcp-ts-core/issues/50). Fixes a real cross-request correctness bug surfaced during the read-through, tightens the per-request close path so silent hangs can no longer accumulate retained closures, and adds observability to attribute whether instances are actually being reclaimed.
9
+
10
+ ## Fixed
11
+
12
+ - **`src/mcp-server/tools/tool-registration.ts`** + **`src/mcp-server/resources/resource-registration.ts`** — `registerAll(server)` no longer mutates `this.services.notifyResourceListChanged` / `this.services.notifyResourceUpdated` on a shared registry-wide services object. Under concurrent HTTP requests, request A's `registerAll(serverA)` followed by request B's `registerAll(serverB)` would overwrite the notifier closure, so A's in-flight tool handler could notify `serverB` (or a closed server). Notifiers are now bound per-`registerAll()` call and threaded through to each handler factory.
13
+
14
+ ## Changed
15
+
16
+ - **`src/mcp-server/tools/utils/toolHandlerFactory.ts`** + **`src/mcp-server/resources/utils/resourceHandlerFactory.ts`** — extracted `HandlerNotifiers` / `ResourceHandlerNotifiers` types for per-server notifier closures. `HandlerFactoryServices` and `ResourceHandlerFactoryServices` no longer carry `notifyResourceListChanged` / `notifyResourceUpdated` fields. `createToolHandler` / `createResourceHandler` take a new third argument (`notifiers`). Internal API change — consumer servers that call `createApp()` are unaffected.
17
+ - **`src/mcp-server/transports/http/httpTransport.ts`** — non-SSE per-request cleanup converted from fire-and-forget `transport.close()` / `server.close()` (errors swallowed as `debug` logs) to parallel awaited close under a 5 s bounded timeout via `Promise.all` over a tagged tuple. Failures increment `mcp.http.close_failures{surface,trigger}` and log at `warning`. Error-path transport close uses the same contract.
18
+
19
+ ## Added
20
+
21
+ - **`mcp.http.close_failures`** counter (tags: `surface` = `transport`|`server`, `trigger` = `success`|`error`). Counts per-request close operations that threw or timed out. Previously invisible; these can now be alerted on.
22
+ - **`mcp.http.per_request.created`** and **`mcp.http.per_request.finalized`** counters (tag: `kind` = `server`|`transport`). Every per-request `McpServer` and `McpSessionTransport` is registered with a module-level `FinalizationRegistry`; the `created` counter increments on construction and the `finalized` counter increments when GC actually reclaims the instance. A persistent, traffic-proportional gap between the two is the signature of the retention observed in [#50](https://github.com/cyanheads/mcp-ts-core/issues/50); a gap that closes within minutes is just GC timing. Purely additive observability — no behavior change.
23
+
24
+ ## Dependencies
25
+
26
+ - **`hono`** — `4.12.14` → `4.12.15` (patch; upstream JWT single-line PEM fix — no impact on this package's auth middleware).
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1776999021032,"env":"testing","version":"0.0.0-test","pid":86369,"requestId":"5A3IA-UDJMH","timestamp":"2026-04-24T02:50:21.031Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"23bfa95f73c6306b49af5af611c211f5627953a27b2672c47a26914b29a3f59a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"23bfa95f73c6306b49af5af611c211f5627953a27b2672c47a26914b29a3f59a","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"5A3IA-UDJMH","timestamp":"2026-04-24T02:50:21.031Z","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:68: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:168:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:101: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":1776999021988,"env":"testing","version":"0.6.16","pid":86376,"requestId":"FYH8P-9160M","timestamp":"2026-04-24T02:50:21.987Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"FYH8P-9160M","timestamp":"2026-04-24T02:50:21.987Z","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:119: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:168: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":1776999022001,"env":"testing","version":"0.6.16","pid":86376,"requestId":"81W3G-Q7S7S","timestamp":"2026-04-24T02:50:22.001Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"81W3G-Q7S7S","timestamp":"2026-04-24T02:50:22.001Z","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:168: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":1776999022005,"env":"testing","version":"0.6.16","pid":86376,"requestId":"LU31O-DL3UV","timestamp":"2026-04-24T02:50:22.005Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"LU31O-DL3UV","timestamp":"2026-04-24T02:50:22.005Z","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:119: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:168: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":1777035202992,"env":"testing","version":"0.0.0-test","pid":91763,"requestId":"V4825-UTOU7","timestamp":"2026-04-24T12:53:22.991Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"6fbbc6dbcf04ad4188bc053d558761052204d5efe21654ce3c1fde4bfe71af06","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"6fbbc6dbcf04ad4188bc053d558761052204d5efe21654ce3c1fde4bfe71af06","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"V4825-UTOU7","timestamp":"2026-04-24T12:53:22.991Z","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:68: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:168:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:101: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":1777035203308,"env":"testing","version":"0.6.17","pid":91765,"requestId":"EUM41-S0KKZ","timestamp":"2026-04-24T12:53:23.308Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EUM41-S0KKZ","timestamp":"2026-04-24T12:53:23.308Z","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:203: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:168: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":1777035203322,"env":"testing","version":"0.6.17","pid":91765,"requestId":"SLXDQ-BVY9J","timestamp":"2026-04-24T12:53:23.322Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"SLXDQ-BVY9J","timestamp":"2026-04-24T12:53:23.322Z","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:168: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":1777035203325,"env":"testing","version":"0.6.17","pid":91765,"requestId":"HMNFC-KC5AD","timestamp":"2026-04-24T12:53:23.325Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"HMNFC-KC5AD","timestamp":"2026-04-24T12:53:23.325Z","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:203: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:168: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":1776999021032,"env":"testing","version":"0.0.0-test","pid":86369,"requestId":"5A3IA-UDJMH","timestamp":"2026-04-24T02:50:21.031Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"23bfa95f73c6306b49af5af611c211f5627953a27b2672c47a26914b29a3f59a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"23bfa95f73c6306b49af5af611c211f5627953a27b2672c47a26914b29a3f59a","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"5A3IA-UDJMH","timestamp":"2026-04-24T02:50:21.031Z","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:68: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:168:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:101: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":1776999021988,"env":"testing","version":"0.6.16","pid":86376,"requestId":"FYH8P-9160M","timestamp":"2026-04-24T02:50:21.987Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"FYH8P-9160M","timestamp":"2026-04-24T02:50:21.987Z","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:119: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:168: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":1776999022001,"env":"testing","version":"0.6.16","pid":86376,"requestId":"81W3G-Q7S7S","timestamp":"2026-04-24T02:50:22.001Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"81W3G-Q7S7S","timestamp":"2026-04-24T02:50:22.001Z","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:168: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":1776999022005,"env":"testing","version":"0.6.16","pid":86376,"requestId":"LU31O-DL3UV","timestamp":"2026-04-24T02:50:22.005Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"LU31O-DL3UV","timestamp":"2026-04-24T02:50:22.005Z","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:119: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:168: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":1777035202992,"env":"testing","version":"0.0.0-test","pid":91763,"requestId":"V4825-UTOU7","timestamp":"2026-04-24T12:53:22.991Z","operation":"HandleToolRequest","input":{"message":"blocked"},"critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"6fbbc6dbcf04ad4188bc053d558761052204d5efe21654ce3c1fde4bfe71af06","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"6fbbc6dbcf04ad4188bc053d558761052204d5efe21654ce3c1fde4bfe71af06","toolName":"scoped_echo","input":{"message":"blocked"},"requestId":"V4825-UTOU7","timestamp":"2026-04-24T12:53:22.991Z","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:68: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:168:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:101: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":1777035203308,"env":"testing","version":"0.6.17","pid":91765,"requestId":"EUM41-S0KKZ","timestamp":"2026-04-24T12:53:23.308Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EUM41-S0KKZ","timestamp":"2026-04-24T12:53:23.308Z","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:203: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:168: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":1777035203322,"env":"testing","version":"0.6.17","pid":91765,"requestId":"SLXDQ-BVY9J","timestamp":"2026-04-24T12:53:23.322Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"SLXDQ-BVY9J","timestamp":"2026-04-24T12:53:23.322Z","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:168: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":1777035203325,"env":"testing","version":"0.6.17","pid":91765,"requestId":"HMNFC-KC5AD","timestamp":"2026-04-24T12:53:23.325Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"HMNFC-KC5AD","timestamp":"2026-04-24T12:53:23.325Z","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:203: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:168: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 +1 @@
1
- {"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,wDAAwD,CAAC;AAchE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B;IAGlD;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB1D,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAgD/B"}
1
+ {"version":3,"file":"resource-registration.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,wDAAwD,CAAC;AAchE,qBAAa,gBAAgB;IAKzB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,QAAQ;IALlB,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqB;gBAG3C,YAAY,EAAE,qBAAqB,EAAE,EACrC,QAAQ,EAAE,8BAA8B;IAGlD;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1D,iFAAiF;IACjF,OAAO,CAAC,gBAAgB;YAUV,gBAAgB;CAoD/B"}
@@ -25,10 +25,13 @@ export class ResourceRegistry {
25
25
  */
26
26
  async registerAll(server) {
27
27
  this.registeredNames.clear();
28
- // Bind resource notification functions to this server instance so
29
- // resource handlers can notify clients of resource changes via ctx.
30
- this.services.notifyResourceListChanged = () => server.sendResourceListChanged();
31
- this.services.notifyResourceUpdated = (uri) => server.server.sendResourceUpdated({ uri });
28
+ // Per-server notifier closures. Bound once per registerAll() call and
29
+ // passed through to each handler factory never mutated on a shared
30
+ // services object (which would race under concurrent HTTP requests).
31
+ const notifiers = {
32
+ notifyResourceListChanged: () => server.sendResourceListChanged(),
33
+ notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
34
+ };
32
35
  const context = requestContextService.createRequestContext({
33
36
  operation: 'ResourceRegistry.registerAll',
34
37
  });
@@ -38,7 +41,7 @@ export class ResourceRegistry {
38
41
  // still expose truthful MCP resource behavior.
39
42
  server.setResourceRequestHandlers();
40
43
  for (const resourceDef of this.resourceDefs) {
41
- await this.registerResource(server, resourceDef);
44
+ await this.registerResource(server, resourceDef, notifiers);
42
45
  }
43
46
  }
44
47
  /** Throws at startup if a resource with the same name was already registered. */
@@ -49,7 +52,7 @@ export class ResourceRegistry {
49
52
  }
50
53
  this.registeredNames.add(name);
51
54
  }
52
- async registerResource(server, def) {
55
+ async registerResource(server, def, notifiers) {
53
56
  const resourceName = def.name ?? def.uriTemplate;
54
57
  const registrationContext = requestContextService.createRequestContext({
55
58
  operation: 'ResourceRegistry.registerResource',
@@ -58,7 +61,7 @@ export class ResourceRegistry {
58
61
  logger.debug(`Registering resource: '${resourceName}'`, registrationContext);
59
62
  this.assertUniqueName(resourceName);
60
63
  await ErrorHandler.tryCatch(() => {
61
- const handler = createResourceHandler(def, this.services);
64
+ const handler = createResourceHandler(def, this.services, notifiers);
62
65
  const title = def.title ?? resourceName;
63
66
  const mimeType = def.mimeType ?? 'application/json';
64
67
  const metadata = {
@@ -1 +1 @@
1
- {"version":3,"file":"resource-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/resources/resource-registration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAkB,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EACL,qBAAqB,GAEtB,MA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GAAG,CAAC,IAAI,EAAE,CAAC;gBAC3C,GAAG,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;gBAC/C,GAAG,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC;gBACxD,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;aACvC,CAAC;YAEF,IAAI,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC7C,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,WAAW,EAAE;oBACrD,IAAI,EAAE,GAAG,CAAC,IAAI;iBACf,CAAC,CAAC;gBAEH,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7D,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CACtE,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,KAAK,CAAC,CACxB,CAAC;YACJ,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,aAAa,YAAY,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;QAC3F,CAAC,EACD;YACE,SAAS,EAAE,uBAAuB,YAAY,EAAE;YAChD,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -13,9 +13,17 @@ type SdkExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
13
13
  /** Services required by the handler factory to construct Context. */
14
14
  export interface ResourceHandlerFactoryServices {
15
15
  logger: Logger;
16
+ storage: StorageService;
17
+ }
18
+ /**
19
+ * Per-server notifier closures bound at registration time.
20
+ * Split from {@link ResourceHandlerFactoryServices} so each per-request
21
+ * McpServer gets its own notifier closures — preventing a concurrent
22
+ * registerAll() from overwriting an in-flight handler's notifier target.
23
+ */
24
+ export interface ResourceHandlerNotifiers {
16
25
  notifyResourceListChanged?: () => void;
17
26
  notifyResourceUpdated?: (uri: string) => void;
18
- storage: StorageService;
19
27
  }
20
28
  /**
21
29
  * Creates an MCP resource read handler from a resource definition.
@@ -29,6 +37,6 @@ export interface ResourceHandlerFactoryServices {
29
37
  * - Formats response via `format` or JSON default
30
38
  * - Catches errors and re-throws for the SDK
31
39
  */
32
- export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices): (uri: URL, variables: Variables, extra: SdkExtra) => Promise<ReadResourceResult>;
40
+ export declare function createResourceHandler(def: AnyResourceDefinition, services: ResourceHandlerFactoryServices, notifiers: ResourceHandlerNotifiers): (uri: URL, variables: Variables, extra: SdkExtra) => Promise<ReadResourceResult>;
33
41
  export {};
34
42
  //# sourceMappingURL=resourceHandlerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,oCAAoC,CAAC;AAK5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQzD,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAOvE,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,EAAE,cAAc,CAAC;CACzB;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,GACvC,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAoElF"}
1
+ {"version":3,"file":"resourceHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACd,MAAM,oCAAoC,CAAC;AAK5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAEhG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAQzD,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAOvE,qEAAqE;AACrE,MAAM,WAAW,8BAA8B;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,qBAAqB,EAC1B,QAAQ,EAAE,8BAA8B,EACxC,SAAS,EAAE,wBAAwB,GAClC,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAoElF"}
@@ -61,7 +61,7 @@ function wrapSample(sdkContext) {
61
61
  * - Formats response via `format` or JSON default
62
62
  * - Catches errors and re-throws for the SDK
63
63
  */
64
- export function createResourceHandler(def, services) {
64
+ export function createResourceHandler(def, services, notifiers) {
65
65
  const mimeType = def.mimeType ?? 'application/json';
66
66
  const formatter = def.format ?? defaultResponseFormatter;
67
67
  return async (uri, variables, callContext) => {
@@ -96,8 +96,8 @@ export function createResourceHandler(def, services) {
96
96
  signal: sdkContext.signal,
97
97
  elicit: wrapElicit(sdkCaps),
98
98
  sample: wrapSample(sdkCaps),
99
- notifyResourceListChanged: services.notifyResourceListChanged,
100
- notifyResourceUpdated: services.notifyResourceUpdated,
99
+ notifyResourceListChanged: notifiers.notifyResourceListChanged,
100
+ notifyResourceUpdated: notifiers.notifyResourceUpdated,
101
101
  uri,
102
102
  });
103
103
  // Execute handler with performance measurement
@@ -1 +1 @@
1
- {"version":3,"file":"resourceHandlerFactory.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/utils/resourceHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAE9E,OA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AkB;IAmGhC;;;;;OAKG;YACW,gBAAgB;CA6C/B"}
@@ -28,12 +28,13 @@ export class ToolRegistry {
28
28
  // Reset per-server uniqueness tracking — registries are shared across
29
29
  // per-request McpServer instances in HTTP mode (GHSA-345p-7cg4-v4c7).
30
30
  this.registeredNames.clear();
31
- // Bind resource notification functions to this server instance so
32
- // tool handlers can notify clients of resource changes via ctx.
33
- if (this.services) {
34
- this.services.notifyResourceListChanged = () => server.sendResourceListChanged();
35
- this.services.notifyResourceUpdated = (uri) => server.server.sendResourceUpdated({ uri });
36
- }
31
+ // Per-server notifier closures. Bound once per registerAll() call and
32
+ // passed through to each handler factory never mutated on a shared
33
+ // services object (which would race under concurrent HTTP requests).
34
+ const notifiers = {
35
+ notifyResourceListChanged: () => server.sendResourceListChanged(),
36
+ notifyResourceUpdated: (uri) => server.server.sendResourceUpdated({ uri }),
37
+ };
37
38
  const context = requestContextService.createRequestContext({
38
39
  operation: 'ToolRegistry.registerAll',
39
40
  });
@@ -55,10 +56,10 @@ export class ToolRegistry {
55
56
  // Register standard tools (regular and auto-task)
56
57
  for (const toolDef of standardTools) {
57
58
  if (toolDef.task) {
58
- await this.registerAutoTaskTool(server, toolDef);
59
+ await this.registerAutoTaskTool(server, toolDef, notifiers);
59
60
  }
60
61
  else {
61
- await this.registerTool(server, toolDef);
62
+ await this.registerTool(server, toolDef, notifiers);
62
63
  }
63
64
  }
64
65
  // Register escape-hatch task tools via experimental API
@@ -81,7 +82,7 @@ export class ToolRegistry {
81
82
  * Registers a standard tool definition.
82
83
  * Requires `services` to have been passed to the constructor for Context creation.
83
84
  */
84
- async registerTool(server, tool) {
85
+ async registerTool(server, tool, notifiers) {
85
86
  const registrationContext = requestContextService.createRequestContext({
86
87
  operation: 'ToolRegistry.registerTool',
87
88
  toolName: tool.name,
@@ -92,7 +93,7 @@ export class ToolRegistry {
92
93
  if (!this.services) {
93
94
  throw new Error(`Cannot register tool '${tool.name}': HandlerFactoryServices not provided to ToolRegistry`);
94
95
  }
95
- const handler = createToolHandler(tool, this.services);
96
+ const handler = createToolHandler(tool, this.services, notifiers);
96
97
  const title = tool.title ?? tool.annotations?.title ?? this.deriveTitleFromName(tool.name);
97
98
  // Type assertion required: SDK's conditional types don't resolve with erased generics
98
99
  server.registerTool(tool.name, {
@@ -116,7 +117,7 @@ export class ToolRegistry {
116
117
  * Auto-generates task handlers from the definition's `handler` function.
117
118
  * The framework manages the full task lifecycle: create, background run, store result.
118
119
  */
119
- async registerAutoTaskTool(server, tool) {
120
+ async registerAutoTaskTool(server, tool, notifiers) {
120
121
  const registrationContext = requestContextService.createRequestContext({
121
122
  operation: 'ToolRegistry.registerAutoTaskTool',
122
123
  toolName: tool.name,
@@ -157,7 +158,7 @@ export class ToolRegistry {
157
158
  pollInterval: 1000,
158
159
  });
159
160
  // Fire-and-forget: run handler in background
160
- void this.runAutoTaskHandler(tool, validatedInput, services, formatter, {
161
+ void this.runAutoTaskHandler(tool, validatedInput, services, notifiers, formatter, {
161
162
  taskId: task.taskId,
162
163
  taskStore: extra.taskStore,
163
164
  ttlMs: taskTtlMs,
@@ -181,7 +182,7 @@ export class ToolRegistry {
181
182
  * Creates Context with `progress` and `signal`, stores result/error on completion.
182
183
  * Enforces a deadline matching the task entry TTL to prevent leaked resources.
183
184
  */
184
- async runAutoTaskHandler(tool, input, services, formatter, opts) {
185
+ async runAutoTaskHandler(tool, input, services, notifiers, formatter, opts) {
185
186
  const { taskId, taskStore, ttlMs, callerAuth } = opts;
186
187
  const abortController = new AbortController();
187
188
  // Enforce handler execution deadline matching the task entry TTL.
@@ -222,8 +223,8 @@ export class ToolRegistry {
222
223
  storage: services.storage,
223
224
  signal: abortController.signal,
224
225
  taskCtx: { store: taskStore, taskId },
225
- notifyResourceListChanged: services.notifyResourceListChanged,
226
- notifyResourceUpdated: services.notifyResourceUpdated,
226
+ notifyResourceListChanged: notifiers.notifyResourceListChanged,
227
+ notifyResourceUpdated: notifiers.notifyResourceUpdated,
227
228
  });
228
229
  const result = await Promise.resolve(tool.handler(input, ctx));
229
230
  const validatedResult = tool.output.parse(result);
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,oBAAoB,GAErB,MAAM,gDAAgD,CAAC;AAExD,OAAO,EACL,iBAAiB,GAElB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAU3E,uEAAuE;AACvE,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAWzC,MAAM,OAAO,YAAY;IAKb;IACA;IALV,oEAAoE;IACnD,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAErD,YACU,QAAsB,EACtB,QAAiC;QADjC,aAAQ,GAAR,QAAQ,CAAc;QACtB,aAAQ,GAAR,QAAQ,CAAyB;IACxC,CAAC;IAEJ;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,MAAiB;QACxC,sEAAsE;QACtE,sEAAsE;QACtE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAE7B,kEAAkE;QAClE,gEAAgE;QAChE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC;YACjF,I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AAK,CAAC,gBAAgB,CACxC,IAAI,CAAC,IAAI,EACT;gBACE,KAAK;gBACL,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,WAAW,EAAE,IAAI,CAAC,KAAK;gBACvB,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;gBACjD,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;gBAC1D,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;gBACxC,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,EACD,IAAI,CAAC,YAAY,CAClB,CAAC;YAEF,MAAM,CAAC,KAAK,CACV,cAAc,IAAI,CAAC,IAAI,2CAA2C,EAClE,mBAAmB,CACpB,CAAC;QACJ,CAAC,EACD;YACE,SAAS,EAAE,uBAAuB,IAAI,CAAC,IAAI,EAAE;YAC7C,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"tool-registration.js","sourceRoot":"","sources":["../../../src/mcp-server/tools/tool-registration.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,oBAAoB,GAErB,MAAM,gDAAgD,CAAC;AAExD,OAAO,EACL,iBAAiB,GAGlB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OA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CAAC,KAAK,CACV,cAAc,IAAI,CAAC,IAAI,2CAA2C,EAClE,mBAAmB,CACpB,CAAC;QACJ,CAAC,EACD;YACE,SAAS,EAAE,uBAAuB,IAAI,CAAC,IAAI,EAAE;YAC7C,OAAO,EAAE,mBAAmB;YAC5B,SAAS,EAAE,gBAAgB,CAAC,oBAAoB;YAChD,QAAQ,EAAE,IAAI;SACf,CACF,CAAC;IACJ,CAAC;CACF"}
@@ -12,9 +12,18 @@ type SdkExtra = RequestHandlerExtra<ServerRequest, ServerNotification>;
12
12
  /** Services required by the handler factory to construct Context. */
13
13
  export interface HandlerFactoryServices {
14
14
  logger: Logger;
15
+ storage: StorageService;
16
+ }
17
+ /**
18
+ * Per-server notifier closures bound at registration time.
19
+ * Split from {@link HandlerFactoryServices} so each per-request McpServer gets
20
+ * its own notifier closures — preventing a concurrent registerAll() from
21
+ * overwriting an in-flight handler's notifier target (and potentially
22
+ * notifying the wrong server).
23
+ */
24
+ export interface HandlerNotifiers {
15
25
  notifyResourceListChanged?: () => void;
16
26
  notifyResourceUpdated?: (uri: string) => void;
17
- storage: StorageService;
18
27
  }
19
28
  /**
20
29
  * Creates an MCP tool handler from a tool definition.
@@ -29,6 +38,6 @@ export interface HandlerFactoryServices {
29
38
  * - Formats response via `format` or JSON default
30
39
  * - Catches errors and returns `isError: true`
31
40
  */
32
- export declare function createToolHandler(def: AnyToolDefinition, services: HandlerFactoryServices): (input: Record<string, unknown>, extra: SdkExtra) => Promise<CallToolResult>;
41
+ export declare function createToolHandler(def: AnyToolDefinition, services: HandlerFactoryServices, notifiers: HandlerNotifiers): (input: Record<string, unknown>, extra: SdkExtra) => Promise<CallToolResult>;
33
42
  export {};
34
43
  //# sourceMappingURL=toolHandlerFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFactory.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/utils/toolHandlerFactory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA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EAAE,MAAM,qBAAqB,CAAC;AAM7D,KAAK,QAAQ,GAAG,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAOvE,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAgCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,iBAAiB,EACtB,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,gBAAgB,GAC1B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,cAAc,CAAC,CA4F9E"}
@@ -46,7 +46,7 @@ function wrapSample(sdkContext) {
46
46
  * - Formats response via `format` or JSON default
47
47
  * - Catches errors and returns `isError: true`
48
48
  */
49
- export function createToolHandler(def, services) {
49
+ export function createToolHandler(def, services, notifiers) {
50
50
  const formatter = def.format ?? defaultResponseFormatter;
51
51
  return async (input, callContext) => {
52
52
  // The SDK types `extra` as Record<string, unknown> at the boundary
@@ -77,8 +77,8 @@ export function createToolHandler(def, services) {
77
77
  signal: sdkContext.signal,
78
78
  elicit: wrapElicit(sdkCaps),
79
79
  sample: wrapSample(sdkCaps),
80
- notifyResourceListChanged: services.notifyResourceListChanged,
81
- notifyResourceUpdated: services.notifyResourceUpdated,
80
+ notifyResourceListChanged: notifiers.notifyResourceListChanged,
81
+ notifyResourceUpdated: notifiers.notifyResourceUpdated,
82
82
  });
83
83
  // Execute handler with performance measurement.
84
84
  // Wrap with Promise.resolve — handler may return sync or async.
@@ -1 +1 @@
1
- {"version":3,"file":"toolHandlerFact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C,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,CAAC,aAAa,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,wBAAsB,kBAAkB,CACtC,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,EACvC,aAAa,EAAE,cAAc,EAC7B,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAuB9B"}
@@ -24,7 +24,7 @@ import { generateSecureSessionId } from '../../../mcp-server/transports/http/ses
24
24
  import { SessionStore } from '../../../mcp-server/transports/http/sessionStore.js';
25
25
  import { logger } from '../../../utils/internal/logger.js';
26
26
  import { logStartupBanner } from '../../../utils/internal/startupBanner.js';
27
- import { createObservableGauge } from '../../../utils/telemetry/metrics.js';
27
+ import { createCounter, createObservableGauge } from '../../../utils/telemetry/metrics.js';
28
28
  /**
29
29
  * Extends the base StreamableHTTPTransport to include a session ID.
30
30
  */
@@ -35,6 +35,90 @@ class McpSessionTransport extends StreamableHTTPTransport {
35
35
  this.sessionId = sessionId;
36
36
  }
37
37
  }
38
+ /** Max time (ms) we wait for per-request transport/server close to complete
39
+ * before giving up and logging a failure. Silent hangs here accumulate
40
+ * retained closures — bounded wait surfaces the issue as a metric. */
41
+ const PER_REQUEST_CLOSE_TIMEOUT_MS = 5_000;
42
+ let closeFailureCounter;
43
+ function getCloseFailureCounter() {
44
+ closeFailureCounter ??= createCounter('mcp.http.close_failures', 'Per-request HTTP close failures (transport or server close threw or timed out)', '{failures}');
45
+ return closeFailureCounter;
46
+ }
47
+ // ---------------------------------------------------------------------------
48
+ // Finalization-lag diagnostic (issue #50)
49
+ //
50
+ // The HTTP transport constructs a fresh `McpServer` + `McpSessionTransport`
51
+ // per request (SDK 1.26 GHSA-345p-7cg4-v4c7). Production heap graphs show
52
+ // linear growth proportional to request volume, which suggests some of
53
+ // these per-request instances are being retained past their scope.
54
+ //
55
+ // Compare `mcp.http.per_request.created_total` against
56
+ // `mcp.http.per_request.finalized_total` (both tagged with `kind`) to
57
+ // detect retention. A persistent gap that grows with traffic is the
58
+ // signature of the leak; a gap that closes within minutes is just GC
59
+ // timing.
60
+ // ---------------------------------------------------------------------------
61
+ let perRequestCreatedCounter;
62
+ let perRequestFinalizedCounter;
63
+ function getPerRequestCreatedCounter() {
64
+ perRequestCreatedCounter ??= createCounter('mcp.http.per_request.created', 'Per-request McpServer/McpSessionTransport instances created', '{instances}');
65
+ return perRequestCreatedCounter;
66
+ }
67
+ function getPerRequestFinalizedCounter() {
68
+ perRequestFinalizedCounter ??= createCounter('mcp.http.per_request.finalized', 'Per-request McpServer/McpSessionTransport instances reclaimed by GC', '{instances}');
69
+ return perRequestFinalizedCounter;
70
+ }
71
+ /** Lazy so the registry only exists when HTTP transport is active. The
72
+ * FinalizationRegistry callback itself does not run during this process's
73
+ * exit teardown — so we deliberately don't try to drain it. */
74
+ let perRequestFinalizationRegistry;
75
+ function getPerRequestFinalizationRegistry() {
76
+ perRequestFinalizationRegistry ??= new FinalizationRegistry((kind) => {
77
+ getPerRequestFinalizedCounter().add(1, { kind });
78
+ });
79
+ return perRequestFinalizationRegistry;
80
+ }
81
+ function trackPerRequestInstance(obj, kind) {
82
+ getPerRequestCreatedCounter().add(1, { kind });
83
+ getPerRequestFinalizationRegistry().register(obj, kind);
84
+ }
85
+ /** Await a promise with a bounded timeout. Rejects with the timeout error
86
+ * if the promise doesn't settle first. */
87
+ function withTimeout(p, ms, label) {
88
+ let timer;
89
+ return Promise.race([
90
+ p,
91
+ new Promise((_, reject) => {
92
+ timer = setTimeout(() => reject(new Error(`${label} timed out after ${ms}ms`)), ms);
93
+ }),
94
+ ]).finally(() => {
95
+ if (timer !== undefined)
96
+ clearTimeout(timer);
97
+ });
98
+ }
99
+ /** Closes the per-request transport and server under a bounded timeout.
100
+ * Runs the two closes in parallel so one hanging close doesn't delay the
101
+ * other, and records each failure to `mcp.http.close_failures` with a
102
+ * `surface` tag. */
103
+ async function closePerRequestInstances(transport, server, sessionId, transportContext) {
104
+ const tasks = [
105
+ ['transport', transport.close()],
106
+ ['server', server.close()],
107
+ ];
108
+ await Promise.all(tasks.map(async ([surface, closePromise]) => {
109
+ try {
110
+ await withTimeout(closePromise, PER_REQUEST_CLOSE_TIMEOUT_MS, `${surface}.close`);
111
+ }
112
+ catch (err) {
113
+ getCloseFailureCounter().add(1, { surface, trigger: 'success' });
114
+ logger.warning(`Failed to close ${surface} after non-SSE response`, {
115
+ ...transportContext,
116
+ sessionId,
117
+ error: err instanceof Error ? err.message : String(err),
118
+ });
119
+ }
120
+ }));
121
+ }
38
122
  /**
39
123
  * Creates a Hono HTTP application for the MCP server.
40
124
  *
@@ -299,11 +383,13 @@ export async function createHttpApp(serverFactory, parentContext, manifest) {
299
383
  // allocating sessions for requests that will fail protocol validation.
300
384
  const sessionId = providedSessionId ?? generateSecureSessionId();
301
385
  const transport = new McpSessionTransport(sessionId);
386
+ trackPerRequestInstance(transport, 'transport');
302
387
  const handleRpc = async () => {
303
388
  // SDK 1.26.0: Protocol.connect() throws if already connected.
304
389
  // Create a fresh McpServer per request to prevent cross-client data leaks.
305
390
  // See GHSA-345p-7cg4-v4c7.
306
391
  const server = await serverFactory();
392
+ trackPerRequestInstance(server, 'server');
307
393
  await server.connect(transport);
308
394
  const response = await transport.handleRequest(c);
309
395
  if (response) {
@@ -324,26 +410,17 @@ export async function createHttpApp(serverFactory, parentContext, manifest) {
324
410
  });
325
411
  }
326
412
  // For non-SSE responses (standard JSON-RPC POST), close the per-request
327
- // server/transport in a microtask so the Response is returned first.
328
- // SSE streams must stay open — closing would abort the ReadableStream
413
+ // server/transport after the Response is handed back to Hono. SSE
414
+ // streams must stay open — closing would abort the ReadableStream
329
415
  // before Hono can consume it (see GHSA-345p-7cg4-v4c7 comment above).
416
+ //
417
+ // Closes run in parallel under a bounded timeout so silent hangs
418
+ // surface as `mcp.http.close_failures` instead of retaining the
419
+ // per-request McpServer/McpSessionTransport closures indefinitely.
330
420
  const isSSE = response.headers.get('content-type')?.includes('text/event-stream');
331
421
  if (!isSSE) {
332
422
  queueMicrotask(() => {
333
- transport.close().catch((closeErr) => {
334
- logger.debug('Failed to close transport after non-SSE response', {
335
- ...transportContext,
336
- sessionId,
337
- error: closeErr instanceof Error ? closeErr.message : String(closeErr),
338
- });
339
- });
340
- server.close().catch((closeErr) => {
341
- logger.debug('Failed to close server after non-SSE response', {
342
- ...transportContext,
343
- sessionId,
344
- error: closeErr instanceof Error ? closeErr.message : String(closeErr),
345
- });
346
- });
423
+ void closePerRequestInstances(transport, server, sessionId, transportContext);
347
424
  });
348
425
  }
349
426
  return response;
@@ -356,10 +433,13 @@ export async function createHttpApp(serverFactory, parentContext, manifest) {
356
433
  return await handleRpc();
357
434
  }
358
435
  catch (err) {
359
- // On error, close transport immediately (success-path cleanup is handled
360
- // inside handleRpc non-SSE via microtask, SSE left open for the stream).
361
- await transport.close().catch((closeErr) => {
362
- logger.debug('Failed to close transport after error', {
436
+ // On error, close transport immediately under the same bounded timeout
437
+ // + failure-metric contract as the success path. No `server` is in
438
+ // scope here — creation happens inside handleRpc — so only the transport
439
+ // is closed.
440
+ await withTimeout(transport.close(), PER_REQUEST_CLOSE_TIMEOUT_MS, 'transport.close').catch((closeErr) => {
441
+ getCloseFailureCounter().add(1, { surface: 'transport', trigger: 'error' });
442
+ logger.warning('Failed to close transport after error', {
363
443
  ...transportContext,
364
444
  sessionId,
365
445
  error: closeErr instanceof Error ? closeErr.message : String(closeErr),
@@ -1 +1 @@
1
- {"version":3,"file":"httpTransport.js","sourceRoot":"","sources":["../../../../src/mcp-server/transports/http/httpTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAmB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO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": "0.6.16",
3
+ "version": "0.6.17",
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",
@@ -263,7 +263,7 @@
263
263
  "@modelcontextprotocol/sdk": "^1.29.0",
264
264
  "@opentelemetry/api": "^1.9.1",
265
265
  "dotenv": "^17.4.2",
266
- "hono": "^4.12.14",
266
+ "hono": "^4.12.15",
267
267
  "jose": "^6.2.2",
268
268
  "pino": "^10.3.1",
269
269
  "zod": "^4.3.6"