Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.Needs confirmation that the PR is actually required or needed.
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 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.
However, the same MCP server works fine under the following conditions:
- When accessed via Google Cloud Proxy
- When transport is changed to SSE
- When using the JS SDK, streamable-http transport works without issues
This suggests a compatibility or configuration issue specifically between python-sdk's streamable-http transport and direct access to Cloud Run URLs.
Reproduction Steps
- Deploy an MCP server to Cloud Run using this official guide:
https://cloud.google.com/blog/topics/developers-practitioners/build-and-deploy-a-remote-mcp-server-to-google-cloud-run-in-under-10-minutes - Use:
- Transport:
streamable-http - Endpoint: Public URL of Cloud Run MCP server
- Transport:
- Attempt to connect using <cloud_run_url>/mcp
- Observe: API status remains in
pendingand no data is received
Observations
- Switching transport to SSE resolves the issue.
- Using a Cloud Proxy to access the MCP server also works with streamable-http.
- JS SDK does not face this issue under the same deployment conditions.
- The Cloud Run URL is publicly accessible and works with other tools.
Environment
- SDK:
python-sdk(v1.9.4) - MCP Server: Deployed on Cloud Run
- Python version: [3.12.11]
- OS - Docker image: [linux/amd64]
Expected Behavior
The SDK should establish a connection to the Cloud Run-hosted MCP server and transition the API status from pending to active.
Additional Notes
This might point to either:
- SDK's HTTP streaming implementation not being fully compatible with Cloud Run’s networking behavior
- Some internal headers or keep-alive expectations that differ between SSE and streamable-http
Any guidance, workaround, or fix would be appreciated.
Example Code
from mcp.server.fastmcp import FastMCP
# Create server
mcp = FastMCP("Echo Server")
@mcp.tool()
def echo(text: str) -> str:
"""Echo the input text"""
return text
def main():
mcp.run(transport="streamable-http", host="0.0.0.0", port=8080)
if __name__ == "__main__":
main()Python & MCP Python SDK
SDK Version: 1.9.4
Python Version: 3.12.11
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds confirmationNeeds confirmation that the PR is actually required or needed.Needs confirmation that the PR is actually required or needed.
Activity
eiseleMichael commentedon Jun 30, 2025
A quick workaround would be to use FastAPI to wrap your FastMCP server, this is how we are running them currently in Cloud Run.
and use uvicorn (or any other server) to run it.
In your docker file:
santosarns commentedon Jul 15, 2025
Any update on possible workarounds tried? Still fail to connect trying to wrap FastMCP using fastAPI, when deployed locally, connection has no issues. @sidgangs99
Have you tried this out? @eiseleMichael
sachin-philip commentedon Aug 9, 2025
@santosarns , @sidgangs99 did you manage to solve this without FastAPI wrapper?
adefemi171 commentedon Jan 10, 2026
Also facing same issue
maxisbey commentedon Aug 10, 2026
Thanks for the report. The v2 rework changed the code this targets, so it no longer applies as-is. Closing this as part of a wider backlog cleanup following the v2 launch. If it's still relevant, feel free to reopen.
AI Disclaimer