-
Notifications
You must be signed in to change notification settings - Fork 971
Description
Enhancement Description
With either the now-deprecated SSE or with HTTP Streaming, a ping from server to client is helpful in keeping the connection alive and healthy.
The underlying MCP library includes a send_ping method for server-to-client ping.
Some other frameworks, like punkpeye/fastmcp offer an easy way to configure the server's ping behavior with an interval.
I have a case where I'd like to use THIS library and get configurable ping, easily.
Ideally I will be able to use something like this to tell it to do the right thing:
mcp.run(
transport="http", host="0.0.0.0", port=port, path="/mcp", stateless_http=True, ping=5000
)
This solves the problem in which a client drops a connection unnecessarily.
The alternative would be for the client to behave well and ping the server and maintain the session. Not all clients can do that. This makes the session more resilient.
Use Case
No response