modelcontextprotocol / modelcontextprotocol/php-sdk
[Client] Implement SSE reconnect with Last-Event-ID
オープン
まだ誰も着手していません。
Client
enhancement
improves spec compliance
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
Context
Per the MCP Streamable HTTP transport spec, when an SSE stream disconnects the client SHOULD reconnect using Last-Event-ID to resume the stream without losing notifications. src/Client/Transport/HttpTransport.php::processSSEStream currently abandons the stream on EOF.
Scope
- Track the most recent
id:line per active stream. - On unexpected EOF (stream still expected open — pending request unresolved, or session active), reconnect with:
GET <endpoint>+Accept: text/event-streamMcp-Session-IdheaderLast-Event-ID: <id>header
- Configurable retry policy: backoff (1s, 2s, 4s, capped at 10s) + max attempts (default 5).
- Respect
retry:SSE field when present.
Conformance scenarios unblocked
sse-retry.
Dependencies
Independent — can run in parallel with auth work.
Acceptance
- Unit tests for ID tracking + reconnect with Last-Event-ID.
- Conformance:
sse-retrypasses.
cc @soyuka
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/Client/Transport/HttpTransport.php::processSSEStream から始め、既存の SSE 解析とストリーム状態の処理を追跡します。イベント ID の追跡と再接続についてユニットテストのカバレッジを追加し、その後 sse-retry 適合シナリオを実行します。再接続が Last-Event-ID を使用して再開され、retry ポリシーが守られれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- api, networking
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 66/100