Title: Issue · GitHub
Open Graph Title: Issue · modelcontextprotocol/python-sdk
X Title: Issue · modelcontextprotocol/python-sdk
Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk
Open Graph Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk
X Description: The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HTTP transport swallows non-2xx status codes causing client to hang","articleBody":"## Summary\n\nWhen an MCP server returns non-2xx HTTP status codes (401/403/404/5xx), the Streamable HTTP and SSE transports do not reliably propagate the error to the caller. In the Streamable HTTP transport, `post_writer` catches exceptions and logs them, but the caller blocks indefinitely waiting for a response on the read stream. HTTP 404 responses are also converted to `JSONRPCError(code=32600)`, losing the original HTTP status information.\n\n## Expected Behavior\n\n- Non-2xx HTTP responses should be surfaced as exceptions to the caller, not silently logged\n- The original HTTP status code should be preserved and accessible\n- Auth-related errors (401/403) should be distinguishable from other failures\n\n## Current Behavior\n\n- `post_writer` in Streamable HTTP transport catches and logs errors without forwarding them through the read stream\n- Callers hang indefinitely waiting for a response\n- HTTP 404 is converted to `JSONRPCError(code=32600)`, destroying HTTP-level context\n\n## Affected Code\n\n- `src/mcp/client/streamable_http.py` (post_writer)\n- `src/mcp/client/sse.py` (sse_reader)\n\n## Related\n\n- #1742 — broader typed error classes design","author":{"url":"https://github.com/maxisbey","@type":"Person","name":"maxisbey"},"datePublished":"2026-02-19T20:29:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/2110/python-sdk/issues/2110"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:2f3a3c04-a968-45c7-2b53-f6fd4cf31d09 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3FA:1E445D:3BE62F:531F8D:6A5A4DA6 |
| html-safe-nonce | b7d4b24e9e6e03893f28f9fbba06b4e9969d879b237e8015ebd959fb36f725fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0ZBOjFFNDQ1RDozQkU2MkY6NTMxRjhEOjZBNUE0REE2IiwidmlzaXRvcl9pZCI6IjE4NTAwNDg0MjQyNzc4NTU2NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ffd7222cbc296e07e84c74f87fa458f567245e5c290d5af612c54c1d2aed5b42 |
| hovercard-subject-tag | repository:862584018 |
| 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/modelcontextprotocol/python-sdk/issues/2110 |
| twitter:image | https://opengraph.githubassets.com/44e74832095b4ecb9f3c5ef60baec63d8623cd816dbde9fa716ca4874a428fad/modelcontextprotocol/python-sdk |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/44e74832095b4ecb9f3c5ef60baec63d8623cd816dbde9fa716ca4874a428fad/modelcontextprotocol/python-sdk |
| og:image:alt | The official Python SDK for Model Context Protocol servers and clients - Issue · modelcontextprotocol/python-sdk |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a793cd1fa898929111edad5857ee1f24ecf4bf7702525e67357cabc9df136fc3 |
| turbo-cache-control | no-cache |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-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 | 311929384671aa49f385b6fcc680ae3933943203 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width