[Client] Implement SSE reconnect with Last-Event-ID
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 66/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- php
- Domain
- api, networking
Research direction
Start with src/Client/Transport/HttpTransport.php::processSSEStream and trace the existing SSE parsing and stream state handling. Add unit coverage for event ID tracking and reconnection, then run the sse-retry conformance scenario; done means reconnects resume with Last-Event-ID and the retry policy is respected.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/php-sdk
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan OpenServer
Difficulty 1/5 Under an hour Newbie friendliness 78/100
modelcontextprotocol/php-sdk#468 · 2 comments ·
-
needs confirmation needs maintainer action Server
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#398 · 1 reaction ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
modelcontextprotocol/php-sdk#510 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
modelcontextprotocol/php-sdk#504 ·
All issues in modelcontextprotocol/php-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Save States Menu Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pluginsGLPI/datainjection#673 ·