Long MCP tool calls: progress, cancellation and timeouts under the 2026-07-28 spec
How a slow MCP tool call reports progress, how clients cancel it on stdio and HTTP, and the timeouts the TypeScript SDK and Claude Code actually use.
Most MCP tool calls finish before anyone notices. A file read, a lookup, a small query, done in a second. The ones that cause trouble are the slow ones: a repo-wide search, a database export, a build, a crawl. They're where agents hang, where users hit stop and the server keeps going anyway, and where a client gives up at 60 seconds on a job that needed 90.
MCP has three small pieces for this, and the 2026-07-28 revision changed how two of them work. Progress notifications tell the client the work is still moving. Cancellation tells the server to quit. Timeouts decide when the client stops waiting. Here's how each one works now, and what real clients actually do with them.
How progress works
Progress is opt-in from the client's side. When a client wants updates for a request, it puts a progressToken in the request's _meta. The progress spec says the token must be a string or an integer, and it has to be unique across all active requests. The client picks it however it likes, and a counter is fine.
The server can then send notifications/progress messages carrying that token, a progress number, an optional total, and an optional human-readable message:
{
"jsonrpc": "2.0",
"method": "notifications/progress",
"params": {
"progressToken": "export-17",
"progress": 3200,
"total": 12000,
"message": "Exported 3,200 of 12,000 rows"
}
}
A few rules are easy to trip over. progress must go up with every notification, even when you don't know the total, so you can't send 40 and then 35 because your estimate changed. Both numbers can be floats. You must stop sending once the operation is done. And the spec says both sides should rate-limit, so a server that fires a notification for every row it touches is doing it wrong. Batch them so you send one every second or two, or one per chunk of real work.
The server is also free to send nothing at all. A token in the request is a request, not a contract. That matters for the timeout section below, because some clients lean on progress to decide whether a call is still alive.
Where progress travels on Streamable HTTP
Under Streamable HTTP, every request is its own POST, and the server decides per request whether to answer with one JSON object or an SSE stream scoped to that request. Progress only works in the second case. The server opens the stream, sends notifications/progress events, and then sends the final JSON-RPC response, which should end the stream.
Those notifications have to relate to the request that opened the stream. They don't go on the long-lived subscriptions/listen stream, which only carries change notifications like tools/list_changed. So if your tool sometimes takes a while, answer it with SSE, not plain JSON. Otherwise you have nowhere to put the updates.
There's one deployment detail people learn the hard way. The transport spec says servers should send X-Accel-Buffering: no on SSE responses, because proxies such as nginx otherwise buffer the stream and deliver your progress events in one clump at the end. Your server can be emitting perfect updates while the client sees a dead connection for four minutes.
Cancellation depends on the transport
The cancellation spec splits by transport, and this is the part that changed the most in practice.
On Streamable HTTP, closing the SSE response stream is the cancellation. The server must treat a client disconnect as cancellation of that request, and no notifications/cancelled message is expected. Since each request has its own stream, there's no ambiguity about which call the client walked away from. The server should stop as soon as it reasonably can and must not send anything else for that request.
On stdio there's no per-request stream to close, so the client must send a notification naming the request ID, with an optional reason:
{
"jsonrpc": "2.0",
"method": "notifications/cancelled",
"params": { "requestId": "123", "reason": "User pressed stop" }
}
A server that gets one should stop the work, free whatever it was holding, and skip the response. It's allowed to ignore the notice if it doesn't know the request, already finished it, or the work can't be stopped. And the client should ignore any response that shows up after it cancelled. Servers, for their part, may only send notifications/cancelled for one thing, tearing down a subscriptions/listen stream.
The spec is also upfront about the race. A cancel can land after the work has finished and after the response has gone out. Both sides have to handle that without falling over, which in practice means the server treats "cancel for a request I don't recognize" as a no-op, not an error.
A dropped connection is a cancel, and nothing resumes it
The changelog removed SSE resumability. The Last-Event-ID header and SSE event IDs are gone, and a broken response stream loses the in-flight request. The client must re-issue it as a new request with a new ID.
Put that next to the cancellation rule and you get the case that bites. A flaky mobile connection or a proxy idle timeout drops the stream halfway through a long call. The server reads that as cancellation, but it may have already written half its output, or all of it. The client, following the spec, sends the same call again under a new ID. If the tool has side effects, that retry is exactly the double write our piece on idempotent tool calls is about. Any slow tool that changes state needs an idempotency key or a natural one, like "export for date range X to file Y", so the second attempt finds the first one's work instead of redoing it.
The same changelog removed ping and moved log levels into per-request _meta through io.modelcontextprotocol/logLevel. So there's no protocol-level heartbeat anymore. On HTTP, the request's own stream is the thing that keeps proving the call is alive. If you want to keep an otherwise quiet stream open, the transport spec says servers are encouraged to send SSE comment lines (a line starting with a colon) as keep-alives on long-lived streams, and clients have to ignore them.
Timeouts: what the spec asks for
The cancellation page also covers timeouts. Every sender should set a timeout on every request. When it expires, the sender should cancel and stop waiting, which on HTTP means closing the stream and on stdio means sending notifications/cancelled. SDKs should let you set the timeout per request.
Then comes the important line. Implementations may reset the timeout clock whenever a progress notification arrives for that request, since that shows work is happening. But they should always enforce a maximum timeout no matter how much progress comes in, so a buggy server that reports progress forever can't hold the connection open forever.
What real clients actually do
The TypeScript SDK maps onto that almost exactly. Its DEFAULT_REQUEST_TIMEOUT_MSEC is 60,000. Per-request options include timeout, onprogress for the callback, resetTimeoutOnProgress, which defaults to false, and maxTotalTimeout, which has no default. For a multi round-trip request that the SDK fills in for you, maxTotalTimeout covers the whole flow, and each retry leg only gets the time that's left. A client calling a slow export might pass something like this:
const options = {
timeout: 60_000, // per-quiet-gap limit
resetTimeoutOnProgress: true, // each progress event restarts it
maxTotalTimeout: 15 * 60_000, // hard ceiling either way
onprogress: (p) => console.log(p.progress, p.total, p.message),
};
Leave the defaults alone and a ten-minute export dies at one minute, progress or no progress, because the reset is off.
Claude Code takes a different line, and its docs spell out the numbers. A per-server timeout field in milliseconds is a hard wall-clock limit per tool call, and progress notifications don't extend it. Values under 1000 are ignored and fall through to the MCP_TOOL_TIMEOUT environment variable, which defaults to about 28 hours when unset. HTTP and SSE servers also get a timer that runs until the server's first response byte, set to the largest of 60 seconds, the tool timeout and MCP_TIMEOUT.
On top of that, Claude Code has an idle timeout. A tool call that sends no response and no progress notification for the idle window gets aborted with an error. The window is five minutes for HTTP, SSE and WebSocket servers and 30 minutes for stdio, and CLAUDE_CODE_MCP_TOOL_IDLE_TIMEOUT changes it. A call in the main conversation that's still running after two minutes moves to a background task. If the user stops it there, Claude Code cancels the call, and its docs say plainly that stopping doesn't guarantee the server stops.
So if you build a server, the same tool can behave differently depending on who calls it. Against the SDK's defaults, progress doesn't save a call that runs past 60 seconds. Against Claude Code, progress is what keeps a quiet ten-minute HTTP call from being killed at minute five. The safe move covers both. Return slow calls as SSE, send a real progress event at least every 30 seconds or so, open the stream quickly so the first byte beats any 60-second timer, and document how long the tool can take so client authors can set their limits.
When the call is too long for any of this
Progress and timeouts are for calls measured in minutes. If a job can run for an hour, or needs to outlive the client process, holding a request open is the wrong shape. The 2026-07-28 revision moved tasks into an official extension, io.modelcontextprotocol/tasks, where the server hands back a task handle and the client polls with tasks/get. Our MCP extensions piece covers how that opt-in layer works, and the background responses and webhooks post shows the same idea on the model API side.
For anything shorter, the server work is pretty small. Honor the progress token when you get one. When the stream closes, really stop, don't finish the job quietly in the background. Make any slow tool that changes state safe to run twice. And talk often enough that nobody's idle timer has to guess whether you're still there.