-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Labels
bugSomething isn't workingSomething isn't working
Description
π Bug Summary
The server intermittently disconnects due to an ERROR in streamable_http message router.
streamable_http - ERROR - Error in message router - ClosedResourceError

π§© Affected Component
Select the area of the project impacted:
-
mcpgateway
- API -
mcpgateway
- UI (admin panel) -
mcpgateway.wrapper
- stdio wrapper - Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
- Other (explain below)
π Steps to Reproduce
make serve
add a gateway with streamable_http transport type.
π€ Expected Behavior
What should have happened instead?
π Logs / Error Output
2025-08-21 07:46:26,221 - uvicorn.access - INFO - 127.0.0.1:45786 - "POST /mcp HTTP/1.1" 200
2025-08-21 07:46:26,222 - mcp.server.streamable_http - ERROR - Error in message router
Traceback (most recent call last):
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/mcp/server/streamable_http.py", line 831, in message_router
async for session_message in write_stream_reader:
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/abc/_streams.py", line 41, in anext
return await self.receive()
^^^^^^^^^^^^^^^^^^^^
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/streams/memory.py", line 111, in receive
return self.receive_nowait()
^^^^^^^^^^^^^^^^^^^^^
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
raise ClosedResourceError
anyio.ClosedResourceError
2025-08-21 07:46:26,241 - uvicorn.access - INFO - 127.0.0.1:45786 - "POST /mcp HTTP/1.1" 200
2025-08-21 07:46:26,241 - mcp.server.streamable_http - ERROR - Error in message router
Traceback (most recent call last):
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/mcp/server/streamable_http.py", line 831, in message_router
async for session_message in write_stream_reader:
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/abc/_streams.py", line 41, in anext
return await self.receive()
^^^^^^^^^^^^^^^^^^^^
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/streams/memory.py", line 111, in receive
return self.receive_nowait()
^^^^^^^^^^^^^^^^^^^^^
File "/home/mohanlaksh/.venv/mcpgateway/lib/python3.12/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
raise ClosedResourceError
anyio.ClosedResourceError
2025-08-21 08:56:11,451 - uvicorn.access - INFO - 127.0.0.1:60360 - "GET /admin/servers/ed196d49fa624d778cb3b4a8e2a2d12d HTTP/1.1" 401
[2025-08-21 09:29:11 +0000] [1745] [INFO] Handling signal: winch
π§ Environment Info
You can retrieve most of this from the /version
endpoint.
Key | Value |
---|---|
Version or commit | v0.5.0 |
Runtime | Python 3.12.3 |
Platform / OS | Ubuntu 22.04 |
Container | none |
π§© Additional Context (optional)
Add any configuration details, flags, or related issues.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working