Title: streamable_http client hangs indefinitely when connecting to POST-only MCP servers (ex: GitHub MCP) · Issue #1941 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: streamable_http client hangs indefinitely when connecting to POST-only MCP servers (ex: GitHub MCP) · Issue #1941 · modelcontextprotocol/python-sdk
X Title: streamable_http client hangs indefinitely when connecting to POST-only MCP servers (ex: GitHub MCP) · Issue #1941 · modelcontextprotocol/python-sdk
Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description The streamable_http_cl...
Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/1941
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"streamable_http client hangs indefinitely when connecting to POST-only MCP servers (ex: GitHub MCP)","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nThe `streamable_http_client` transport hangs indefinitely when connecting to MCP servers that only support POST requests (not GET), such as GitHub's MCP server at `https://api.githubcopilot.com/mcp/`. The issue manifests when calling operations like `list_tools()` or other methods that return SSE responses. This is also likely what some of the other issues are experiencing as there are many hanging related issues:\nhttps://github.com/modelcontextprotocol/python-sdk/issues?q=is%3Aissue%20state%3Aopen%20hang however, I believe this could explain this issue in more detail potentially: https://github.com/modelcontextprotocol/python-sdk/issues/262\n\nI tried with and without a debugger, and noticed that with a debugger attached, the timing overhead masks the race condition and operations complete successfully. So this has been difficult to unmask.\n\nThe MCP SDK's `streamable_http_client` has a race condition in its GET stream handling:\n\n1. After initialization, `streamable_http_client` launches a background task (`handle_get_stream`) to receive server-initiated SSE messages via GET requests\n2. GitHub's MCP server doesn't support GET requests and returns `405 Method Not Allowed`\n3. The GET stream retries twice according to `MAX_RECONNECTION_ATTEMPTS` (with 1-second delays each), then the background task silently exits\n4. When subsequent POST requests return `text/event-stream` content (like `tools/list`), the transport's SSE response handling may wait for coordination with the GET stream task\n5. Since the GET stream task is dead, the POST SSE response waits indefinitely\n\nFull repro repo code that honestly isn't large: https://github.com/sicoyle/release-note-agent/blob/main/release_note_agent/release_note_agent.py#L12\n\n### Example Code\n\n```Python\nFull repro repo code that honestly isn't large with 2 cmds to run:\nhttps://github.com/sicoyle/release-note-agent/blob/main/release_note_agent/release_note_agent.py#L12\n```\n\n### Python \u0026 MCP Python SDK\n\n```Text\ni forked and tested my changes on an incoming PR to confirm the error and fix. Stay tuned for PR shortly\npy 3.13\nmcp python sdk at main\n```","author":{"url":"https://github.com/sicoyle","@type":"Person","name":"sicoyle"},"datePublished":"2026-01-23T15:40:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1941/python-sdk/issues/1941"}
| 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:1fa93e14-5346-b39a-56dc-93a086ebc73f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8220:92DB2:11A4F0A:179024F:6A5EF49D |
| html-safe-nonce | ee36a71197a9296f620e4a6ce3037b5c85eb660e5add8e758e3cb079c60987ce |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjIwOjkyREIyOjExQTRGMEE6MTc5MDI0Rjo2QTVFRjQ5RCIsInZpc2l0b3JfaWQiOiI0MTA0MjM1NTc0MDYwMDUzNjYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 147f5ac779bc805df2a6816b84c436f04c48281d989d75f4ee513700bf9feafb |
| hovercard-subject-tag | issue:3848003504 |
| 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/python-sdk/1941/issue_layout |
| twitter:image | https://opengraph.githubassets.com/19d2bfc744122ac954fe2b65a4765821ec7d27f323e34818f38ca0691baa1a97/modelcontextprotocol/python-sdk/issues/1941 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/19d2bfc744122ac954fe2b65a4765821ec7d27f323e34818f38ca0691baa1a97/modelcontextprotocol/python-sdk/issues/1941 |
| og:image:alt | Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sicoyle |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82d0004a35927bdb00c652a57f456c55aa0eda4ade1bc7956d7510fdea6e454b |
| turbo-cache-control | no-preview |
| 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 | d2d913dd727d2d7ac189fb4d05b10bc34ecd03ee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width