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.

sources

keep reading

More on this.

Two ways to run Tessary.

Tessary is an open-source agent reliability platform. Cloud and self-hosted run the same workflow on the OpenTelemetry traces your agent already emits.

Tessary Cloud

We host it for you. Send your first trace with nothing to deploy and no model key.

what's includedper organization
traces
10,000 per calendar month
stored trace data
1 GB
retention
30 days
model credit
$10, one-time, for triage and root-cause analysis
credit card
not required

Self-hosted Tessary

Run the open-source code on your own infrastructure with one command. Add your own model key for triage and root-cause analysis.

Self-host Tessary for me by following https://github.com/tessaryai/tessary/blob/main/setup.md

docker compose -f oci://docker.io/tessaryai/tessary:compose up -d -y