StreamableHTTPServerTransport: option to send SSE keepalive comments on open streams
メンテナーはふだん 1 日以内に返信
@Urdemonlord がすでに取り組んでいます。
2026年11月21日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- backend, networking
調査の方向性
Start with the StreamableHTTPServerTransport class and its internal _webStandardTransport, where _streamMapping holds each open SSE stream's controller. Find where the standalone GET stream and POST SSE responses are created, then decide where a periodic : keepalive comment could be written and how the new option gets through the constructor. Done means the option is accepted, comments appear on open streams at the configured interval, and it is off by default. Settle the option name and default with maintainers before coding, since the issue leaves both open.
索引モデルが issue の本文から書いたものです。
説明
Problem
StreamableHTTPServerTransport writes nothing on an open SSE stream between messages. The standalone GET stream usually carries no traffic for long periods, and a long-running tool call's POST stream can be quiet too. Proxies and load balancers with an idle timeout (AWS ALB and nginx default to 60 seconds, Cloudflare to 100) then close the connection, and clients see the stream drop and reconnect.
There is no public way to add a heartbeat. To keep streams alive today, a server has to reach into _webStandardTransport._streamMapping and enqueue an SSE comment on each stream's controller, which breaks on any internal change and forces an exact version pin.
Proposal
An option on the transport, for example:
new StreamableHTTPServerTransport({
sessionIdGenerator: () => randomUUID(),
keepAliveIntervalMs: 20_000, // write ": keepalive\n\n" on every open SSE stream
});
- SSE comment lines are ignored by clients (per the SSE spec), so this needs no protocol change and no client support.
- Applies to the standalone GET stream and to POST responses streamed as SSE.
- Off by default, or a conservative default below common proxy timeouts.
The MCP ping request is an alternative, but it makes every client send a POST per interval per stream, where a comment costs one line on an already-open connection.
Versions
Observed on @modelcontextprotocol/sdk 1.29.0.
- 主要言語
- TypeScript
- スター
- 13.8k
- フォーク
- 2.5k
- 平均マージ
- 6日 23時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
modelcontextprotocol/typescript-sdk のほかの issue
-
v2
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
modelcontextprotocol/typescript-sdk#3270 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`対応中かも @mgoldsborough が 6 日前に担当しました。 オープンv2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
modelcontextprotocol/typescript-sdk#3249 ·
メンテナーはふだん 1 日以内に返信
-
v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
modelcontextprotocol/typescript-sdk#3243 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` reply対応中かも @Tidehyc が 8 日前に担当しました。 オープンv2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
modelcontextprotocol/typescript-sdk#3235 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
UriTemplate.match() throws a TypeError on an empty expression it accepts対応中かも @yunusemrejs が 12 日前に担当しました。 オープンv1 v2
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
modelcontextprotocol/typescript-sdk#3221 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
modelcontextprotocol/typescript-sdk の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Vessel9817/onion-site-template#512 ·
メンテナーはふだん 1 日以内に返信
-
nightly-tests
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
メンテナーはふだん 1 日以内に返信
-
approved
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
fritzprix/libr-agent#3266 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
better-auth/better-auth#13101 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信