How do I set a timeout on an MCP tool call?
Set a timeout per request in your MCP client SDK, and when it expires before a response arrives, send a cancellation notification and stop waiting rather than hanging indefinitely; the spec expects every implementation to do this and expects SDKs to let you configure it per request rather than one fixed value for the whole connection.
A slow tool that’s actually working can send progress notifications, and the spec allows a client to reset its timeout clock each time one arrives, since a progress update means the server hasn’t stalled. That doesn’t remove the risk on its own: the spec also says a client should still enforce a hard maximum regardless of how many progress notifications show up, so a server stuck emitting progress forever can’t hold a call open indefinitely. What are the ways a single tool call can fail covers the other failure shapes a timeout doesn’t catch, like a call that returns the wrong result without ever being slow.