Title: Streamable HTTP transport fails when accessing MCP server on Cloud Run using sdk · Issue #1053 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Streamable HTTP transport fails when accessing MCP server on Cloud Run using sdk · Issue #1053 · modelcontextprotocol/python-sdk
X Title: Streamable HTTP transport fails when accessing MCP server on Cloud Run using sdk · Issue #1053 · 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 Description When using...
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/1053
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Streamable HTTP transport fails when accessing MCP server on Cloud Run using sdk","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\n### Description\n\nWhen using the `python-sdk` with transport set to `streamable-http`, the connection to a remote MCP server deployed on **Google Cloud Run** does not establish. The API stays in a **pending** state, and no updates are received.\n\nHowever, the same MCP server works fine under the following conditions:\n\n* When accessed via **Google Cloud Proxy**\n* When transport is changed to **SSE**\n* When using the **JS SDK**, streamable-http transport works without issues\n\nThis suggests a compatibility or configuration issue specifically between `python-sdk`'s streamable-http transport and direct access to Cloud Run URLs.\n\n---\n\n### Reproduction Steps\n\n1. Deploy an MCP server to Cloud Run using this official guide:\n [https://cloud.google.com/blog/topics/developers-practitioners/build-and-deploy-a-remote-mcp-server-to-google-cloud-run-in-under-10-minutes](https://cloud.google.com/blog/topics/developers-practitioners/build-and-deploy-a-remote-mcp-server-to-google-cloud-run-in-under-10-minutes)\n2. Use:\n * Transport: `streamable-http`\n * Endpoint: Public URL of Cloud Run MCP server\n3. Attempt to connect using \u003ccloud_run_url\u003e/mcp\n4. Observe: API status remains in `pending` and no data is received\n\n---\n\n### Observations\n\n* Switching transport to **SSE** resolves the issue.\n* Using a **Cloud Proxy** to access the MCP server also works with streamable-http.\n* **JS SDK** does not face this issue under the same deployment conditions.\n* The Cloud Run URL is publicly accessible and works with other tools.\n\n---\n\n### Environment\n\n* SDK: `python-sdk` (v1.9.4)\n* MCP Server: Deployed on Cloud Run\n* Python version: \\[3.12.11]\n* OS - Docker image: \\[linux/amd64]\n\n---\n\n### Expected Behavior\n\nThe SDK should establish a connection to the Cloud Run-hosted MCP server and transition the API status from pending to active.\n\n---\n\n### Additional Notes\n\nThis might point to either:\n\n* SDK's HTTP streaming implementation not being fully compatible with Cloud Run’s networking behavior\n* Some internal headers or keep-alive expectations that differ between SSE and streamable-http\n\nAny guidance, workaround, or fix would be appreciated.\n\n\n### Example Code\n\n```Python\nfrom mcp.server.fastmcp import FastMCP\n\n# Create server\nmcp = FastMCP(\"Echo Server\")\n\n\n@mcp.tool()\ndef echo(text: str) -\u003e str:\n \"\"\"Echo the input text\"\"\"\n return text\n\n\ndef main():\n mcp.run(transport=\"streamable-http\", host=\"0.0.0.0\", port=8080)\n\n\nif __name__ == \"__main__\":\n main()\n```\n\n### Python \u0026 MCP Python SDK\n\n```Text\nSDK Version: 1.9.4\nPython Version: 3.12.11\n```","author":{"url":"https://github.com/sidgangs99","@type":"Person","name":"sidgangs99"},"datePublished":"2025-06-28T15:29:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1053/python-sdk/issues/1053"}
| 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:18a3e7a7-d2da-ea29-c54f-57e2cde58eb3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81B6:203C06:170423A:1F05864:6A62DDB9 |
| html-safe-nonce | 9eb6fa2b4d052edfd5bb23e7e8a223fb167532e03dbe341f651bb6beb0bf2894 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUI2OjIwM0MwNjoxNzA0MjNBOjFGMDU4NjQ6NkE2MkREQjkiLCJ2aXNpdG9yX2lkIjoiNjEzMTQ4ODM5MDA2NzE4MzAzMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 54f4801675c07e94b202ed5609ab681935390148c188b27f26ee552779540ca3 |
| hovercard-subject-tag | issue:3185110750 |
| 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/1053/issue_layout |
| twitter:image | https://opengraph.githubassets.com/96437cf72c2707a04982e098102733993522dc25802fcf78f06554c1e83b3830/modelcontextprotocol/python-sdk/issues/1053 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/96437cf72c2707a04982e098102733993522dc25802fcf78f06554c1e83b3830/modelcontextprotocol/python-sdk/issues/1053 |
| 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 | sidgangs99 |
| hostname | github.com |
| expected-hostname | github.com |
| None | df33b1b61ee7b9a0af988199bfc3503c9c1acafb1f1d40e1f140ea7c84f890dd |
| 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 | d41cd1bdb290013455c0ac430fa755621733f5eb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width