---
summary: "Fix HTTP SSE per-request retention leak ([#50](https://github.com/cyanheads/mcp-ts-core/issues/50)) — bind `closePerRequestInstances` to the request `AbortSignal` so ungraceful client disconnects close the per-request McpServer/Transport pair."
breaking: false
---

# 0.8.16 — 2026-05-05

12h+ production telemetry across 15 servers attributed unbounded heap growth (~200 KB × GET-rate) to per-request `McpServer` + `McpSessionTransport` pairs surviving SSE GET streams that never received a graceful `DELETE`. `@hono/mcp` `stream.onAbort` clears its internal stream map but never invokes `transport.close()`, so the framework's `onclose` chain never fired for the dominant disconnect mode. SSE branch now wires cleanup to `c.req.raw.signal.addEventListener('abort', …, { once: true })` (with a pre-aborted guard for the queued-microtask race), runs both closes through the existing bounded-timeout path, and tags failures with `trigger=sse-abort` on `mcp.http.close_failures` so the new pathway is attributable in the same telemetry that surfaced the leak.

## Fixed

- **HTTP SSE per-request retention leak** ([#50](https://github.com/cyanheads/mcp-ts-core/issues/50)) — `src/mcp-server/transports/http/httpTransport.ts` now binds `closePerRequestInstances(transport, server, …, 'sse-abort')` to the request's `AbortSignal` for SSE responses. Non-SSE responses continue to use the existing `queueMicrotask(…, 'success')` path; error-path close keeps the `'error'` trigger. `{ once: true }` on the abort listener and pre-aborted-signal queueMicrotask branch covered by new unit tests; `tests/integration/http-sse-abort.int.test.ts` boots a real server subprocess, opens and ungracefully aborts SSE streams, and asserts no close-failure warnings.

## Changed

- **`mcp.http.close_failures` `trigger` tag** gains `sse-abort` alongside the existing `success` and `error` values. The counter shape is unchanged; existing dashboards keep working and the new value attributes failures to the abort-driven path when they occur.
- **Dependency bumps:** `hono` `^4.12.16` → `^4.12.17`; dev `@cloudflare/vitest-pool-workers` `^0.15.2` → `^0.16.0`.
