How do I cancel an in-flight MCP tool call?

Send a notifications/cancelled notification naming the request’s id, with an optional reason string, over the same connection the request went out on. The receiver should stop processing right away, free whatever it was holding, and skip sending a response, and the sender should ignore any response that shows up anyway. Both are “should,” not a guarantee: the notification can arrive after the call already finished, so a response and a cancellation can cross in transit, and either side may ignore a cancellation naming a request it doesn’t recognize or can’t actually stop partway through.

The mechanism is identical on stdio and Streamable HTTP; there’s no separate cancel verb per transport. What doesn’t work is closing the connection and assuming that counts: the current spec says a dropped stream should not be read as a cancellation, since disconnects happen for reasons that have nothing to do with the caller wanting to stop. A timeout is the other half of not waiting forever. A server that ignores the cancellation and keeps working just looks slow rather than broken, which is the shape a call-site’s own duration history is built to catch.

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