# MCP TypeScript SDK: fix SSE stream terminated

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/mcp-typescript-sdk-sse-stream-disconnected-terminated
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, SDK 1.30.0 sends periodic SSE comments to prevent idle Streamable HTTP event streams from timing out. The release also includes the timer lifecycle follow-up. Upgrade the server SDK to `1.30.0`.

**Not for:** cancelled POST requests that never settle; see [mcp-typescript-cancelled-post-never-settles](https://whatworks.dev/t/mcp-typescript-cancelled-post-never-settles.md).

Subjects: mcp

Do first: Upgrade the server-side MCP TypeScript SDK to `1.30.0`.

## Symptom
`SSE stream disconnected: TypeError: terminated` recurs about every five minutes in whynixx’s Cline/Cursor report. newmanwang reports the same failure, ghost supplies a reproduction, and mattzcarey says their team encountered and addressed it in another transport.

## Cause
An SSE connection can remain silent long enough for an idle watchdog to close it. The merged PR adds SSE comment frames to open GET, POST response and replay streams. These comments keep traffic flowing without creating MCP messages.

## Fix
1. Upgrade to [1.30.0](https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/1.30.0), which includes the heartbeat PR and [its timer lifecycle follow-up](https://github.com/modelcontextprotocol/typescript-sdk/pull/2547).
2. Leave `keepAliveMs` at its `15000` millisecond default, or set a finite positive interval on `StreamableHTTPServerTransport`. [PR #2538](https://github.com/modelcontextprotocol/typescript-sdk/pull/2538) states that `0` disables it.
3. For JSON-only request/response servers, the [official SDK example](https://github.com/modelcontextprotocol/typescript-sdk/blob/1.30.0/src/examples/server/jsonResponseStreamableHttp.ts) gives an alternative: answer GET with `405`, `Allow: POST`, and `Method Not Allowed`. This alternative does not provide GET SSE push.

## Fixed in
Fixed in `1.30.0` (released 2026-07-27); [PR #2538](https://github.com/modelcontextprotocol/typescript-sdk/pull/2538) merged 2026-07-23.

## If it still fails
- Keep-alive targets idle disconnections; the sources do not claim it prevents every network failure.
- The follow-up PR disables heartbeats for non-finite `keepAliveMs` values.
- The JSON-only workaround does not apply when server-to-client GET SSE push is needed.

Not for: cancelled POST requests that never settle; see mcp-typescript-cancelled-post-never-settles.

## Sources
- [SSE stream disconnected: TypeError: terminated](https://github.com/modelcontextprotocol/typescript-sdk/issues/1211), whynixx, opened 2025-12-02; closed as completed on 2026-10-05: "SSE stream disconnected: TypeError: terminated".
- [fix: send SSE keep-alive comment frames from Streamable HTTP server transport (v1.x)](https://github.com/modelcontextprotocol/typescript-sdk/pull/2538), mattzcarey, merged 2026-07-23 (closed).
- [1.30.0](https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/1.30.0), released 2026-07-27.
- [Fix SSE keep-alive timer lifecycle in Streamable HTTP server transport (v1.x)](https://github.com/modelcontextprotocol/typescript-sdk/pull/2547), felixweinberger, merged 2026-07-27 (closed).

## Checked
2026-11-24; read the issue and comments API records, merged PR API record, release API record; also read linked corroborating issue / PR records; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.