You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Due to the synchronous handling of messages in the order they come in (in lowlevel server.run method), if a single message takes longer, other requests are blocked.
This is also true for the PingRequest which should only serve as a healthcheck and be always handled immediately in my opinion.
This also prevents efficient use of asyncio - for example running multiple tool calls concurrently in a single client session.
I suppose there can still be legitimate reasons to process the messages synchronously "in order", but in that case would it be possible to extract at least the PingRequest to be handled immediately?
Thanks for all the amazing work! :)
The text was updated successfully, but these errors were encountered:
Describe the bug
Due to the synchronous handling of messages in the order they come in (in lowlevel server.run method), if a single message takes longer, other requests are blocked.
This is also true for the
PingRequest
which should only serve as a healthcheck and be always handled immediately in my opinion.This also prevents efficient use of asyncio - for example running multiple tool calls concurrently in a single client session.
python-sdk/src/mcp/server/lowlevel/server.py
Line 452 in 960b923
To Reproduce
Steps to reproduce the behavior:
This could be easily solved by processing messages concurrently, naive code:
I suppose there can still be legitimate reasons to process the messages synchronously "in order", but in that case would it be possible to extract at least the PingRequest to be handled immediately?
Thanks for all the amazing work! :)
The text was updated successfully, but these errors were encountered: