Title: SSE client rejects valid `retry:` field and ignores reconnection timing (Streamable HTTP) · Issue #1047 · modelcontextprotocol/java-sdk · GitHub
Open Graph Title: SSE client rejects valid `retry:` field and ignores reconnection timing (Streamable HTTP) · Issue #1047 · modelcontextprotocol/java-sdk
X Title: SSE client rejects valid `retry:` field and ignores reconnection timing (Streamable HTTP) · Issue #1047 · modelcontextprotocol/java-sdk
Description: Bug description The client SSE line parser in ResponseSubscribers rejects the standard SSE retry: field, throwing: io.modelcontextprotocol.spec.McpTransportException: Invalid SSE response. Status code: 200 Line: retry: 500 Per the SSE sp...
Open Graph Description: Bug description The client SSE line parser in ResponseSubscribers rejects the standard SSE retry: field, throwing: io.modelcontextprotocol.spec.McpTransportException: Invalid SSE response. Status c...
X Description: Bug description The client SSE line parser in ResponseSubscribers rejects the standard SSE retry: field, throwing: io.modelcontextprotocol.spec.McpTransportException: Invalid SSE response. Status c...
Opengraph URL: https://github.com/modelcontextprotocol/java-sdk/issues/1047
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SSE client rejects valid `retry:` field and ignores reconnection timing (Streamable HTTP)","articleBody":"**Bug description**\n\nThe client SSE line parser in `ResponseSubscribers` rejects the standard SSE `retry:` field, throwing:\n\n```\nio.modelcontextprotocol.spec.McpTransportException: Invalid SSE response. Status code: 200 Line: retry: 500\n```\n\nPer the SSE specification, `retry:` sets the stream's reconnection time, and unknown fields MUST be ignored (never error the stream). Because of this, the Streamable HTTP client:\n1. can error a live SSE stream when the server sends a `retry:` line, and\n2. does not honor the server-provided reconnection delay, reconnecting immediately.\n\nThis is the MUST-level `client-sse-retry-timing` failure already noted as a known limitation in `conformance-tests/VALIDATION_RESULTS.md`.\n\n**Environment**\n- java-sdk `main` (2.0.1-SNAPSHOT)\n- Java 17+\n- Transport: `HttpClientStreamableHttpTransport` (client), SSE / Streamable HTTP\n\n**Steps to reproduce**\nRun the official MCP conformance `sse-retry` client scenario:\n\n```bash\n./mvnw clean package -DskipTests -pl conformance-tests/client-jdk-http-client -am\nnpx -y @modelcontextprotocol/conformance client \\\n --command \"java -jar conformance-tests/client-jdk-http-client/target/client-jdk-http-client-2.0.1-SNAPSHOT.jar\" \\\n --scenario sse-retry\n```\n\nObserved:\n```\nError: Invalid SSE response. Status code: 200 Line: retry: 500\n[client-sse-retry-timing ] FAILURE Client MUST respect the retry field (reconnected ~0ms instead of 500ms)\n[client-sse-last-event-id] WARNING Client SHOULD send Last-Event-ID on reconnection\nOVERALL: FAILED\n```\n\n**Expected behavior**\n- The SSE parser parses/ignores `retry:` (and any unknown SSE field) without erroring the stream.\n- On reconnection after a drop, the client waits the server-specified `retry` interval before reconnecting.\n\n**Minimal reproducible example**\nFeeding the SSE lines `id: e1` / `retry: 500` / `data: hello` / (blank) to the SSE line subscriber currently throws `McpTransportException` instead of yielding a single event.\n\n**Proposed scope (two parts)**\n1. Parser robustness (small, self-contained): parse `retry:` and ignore unknown fields in `ResponseSubscribers`. *(Implemented locally with unit tests.)*\n2. Reconnect timing: honor the parsed `retry` value before reconnecting in `HttpClientStreamableHttpTransport` / `DefaultMcpTransportStream`. This touches the `McpTransportStream` SPI, so I'd like to confirm the preferred approach before opening a PR.\n\nThe related `Last-Event-ID` SHOULD warning appears covered by #830, so I would keep it out of scope here.\n\nHappy to open a PR for part 1 immediately and follow up on part 2 per maintainer guidance.\n","author":{"url":"https://github.com/imankhadiv","@type":"Person","name":"imankhadiv"},"datePublished":"2026-06-30T00:31:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1047/java-sdk/issues/1047"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7aad81fa-1a58-890d-8405-05be185c48c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B93A:1A4414:109C7B8:17D41A7:6A5A09DA |
| html-safe-nonce | 5ffe8aadad8e719ca8f997658c9563889a99cc2145988f486ff9eb1b72dc6c36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTNBOjFBNDQxNDoxMDlDN0I4OjE3RDQxQTc6NkE1QTA5REEiLCJ2aXNpdG9yX2lkIjoiOTkxNjg3OTUxOTQxNjU3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 64ea35c8ba6189c78d4cf79d614d4346012976ee40943c2386ab4e4e209d6c54 |
| hovercard-subject-tag | issue:4772626292 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/java-sdk/1047/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b2e482453a5cd1de7841903c96d01e29f4827db537851bd0ccf102f145530c3f/modelcontextprotocol/java-sdk/issues/1047 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b2e482453a5cd1de7841903c96d01e29f4827db537851bd0ccf102f145530c3f/modelcontextprotocol/java-sdk/issues/1047 |
| og:image:alt | Bug description The client SSE line parser in ResponseSubscribers rejects the standard SSE retry: field, throwing: io.modelcontextprotocol.spec.McpTransportException: Invalid SSE response. Status c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | imankhadiv |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/java-sdk git https://github.com/modelcontextprotocol/java-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 919609219 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/java-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 919609219 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/java-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 491710c7a8eecca9d0a06bd157646f2685d8c87b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width