Starts Nov 23Live Cohort 3 of Vibe Coding & AI Agents (Nov 23, 18:30 MSK): 3 weeks, 9 live hands-on sessionsCohort 3 (Nov 23) →
ReleaseInsight · On RadarRaft→ original

How to Run Long Tasks in MCP: Raft Tested Tasks with 13 Requests and 6 Server Crashes

MCP is the protocol through which an AI model calls tools. The Tasks extension exists for long operations, such as recognizing a batch of documents. Raft tested it by hand: 13 test requests, 45 measurements of result-wait time, and six process crashes in the middle of a task. The team concludes that task state should live in external storage rather than in server memory, and that a hybrid scheme is the way to go.

AI-processed from Raft; edited by Hamidun News
How to Run Long Tasks in MCP: Raft Tested Tasks with 13 Requests and 6 Server Crashes
Source: Raft. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceRaft ↗
Editor-in-Chief
There are no sessions in the new MCPany server behind a load balancer will accept a request
TaskId works as an access key128 bits of randomness plus an owner check
Key metric #3Code written for Tasks from the November 2025 spec will have to be rewritten from scratch

MCP is the protocol through which an AI model calls external tools: a database, a repository, a cloud service. While a tool responds in seconds, everything is simple. But if it recognizes a batch of documents, scans a repository, or builds a report, the client gets tired of keeping the request open and drops the connection.

For such cases, the July revision of the protocol introduced the official Tasks extension: the server immediately replies "task accepted," and the client then asks on its own whether the result is ready. Claims about "async out of the box" quickly appeared around it, and the Raft team decided to check them by hand: they sent 13 requests to a test server, took 45 measurements of waiting time, and crashed the process in the middle of a task six times.

How we tested

The authors cloned the specification and extension repositories, installed current SDKs, and built test benches. They sent 13 requests to a TypeScript server, ranging from standard ones to deliberately broken ones. Then they wrote a hybrid server and ran two measurements. The first shows how many model turns are consumed by waiting for a long task (45 measurements in total). The second shows what happens to a task if the process crashes: they killed the process mid-work six times and checked whether the result was lost. Separately, they stood up working client–server pairs in Go, C#, Rust, and Java. Environment versions: Node.js 24, TypeScript SDK 2.4.0, Python 2.3.0, C# 2.4.0, Rust 3.11.0, Java 2.2.0, Go 1.8.0.

There are two honest caveats. The team did not test commercial clients such as ChatGPT, Claude, and Cursor itself; information about them comes from publications and trackers. And the "model" in the status-polling measurement is a script with a fixed pause between calls, not a real LLM. So the figures on model turns show the mechanics of waiting, not the behavior of a live agent.

Stateless: what it changes for long tasks

The main architectural change in this revision is that the protocol has become fully stateless. There is no longer a mandatory handshake between client and server. Each request carries the protocol version and the client's capabilities itself, so any server behind a load balancer can process it, without binding the client to a specific node.

For long operations, this leads to a strict rule. There is no session, and the server remembers nothing about the "current user" or the "current task." Operation state, access rights, and organization membership must not be kept in process memory or in the connection. All of it must live in external storage. That way, the failure of one node does not kill the task: another node reads its status from storage and keeps responding to the client.

The second change matters to those building infrastructure. The HTTP transport now duplicates the method and tool name in headers. Gateways and proxies can route traffic without parsing the request body, for example, sending frequent status polling to a separate pool of machines. If the header and the body disagree, the server must return an error. The error codes for an unsupported version and for an extension the client lacks have also changed, the old ones are declared deprecated, and there is a year to stop using them. On the TypeScript SDK 2.4.0 server, these requirements were confirmed, and an old client received a response without trouble: backward compatibility is enabled by default in the SDK.

A quick check for someone else's server: send a request in which the header and the body deliberately contradict each other. If there is no error, the server does not cross-check them, and you cannot trust the routing rules on the gateway.

Tasks: simple on paper, harder in practice

The mechanics are clear. The server does not keep the request open; it immediately issues a task identifier. The client periodically asks for status at the interval the server suggested, until the result arrives. A task can pause and request input from the user, and the client passes the answer in a separate call. Cancellation works softly: the server confirms the command with an empty response, but work already in progress may well run to completion.

The new version differs radically from the experimental Tasks of the November 2025 spec. Previously, the client initiated background execution; now the server makes that decision, but only if the client has declared support for the extension in advance. Some of the old methods have been removed entirely. A tool's own error is now returned inside the result, and protocol errors are reserved for protocol failures. The formats of the two versions are incompatible, so code written for last year's Tasks will have to be rewritten from scratch.

There is also a non-obvious security detail. There is no task list, so the task identifier becomes an access key to the result. It must be unpredictable (the experiments used 128 bits of randomness) and the owner must be checked on every access. For an unknown identifier and for an expired one, the server must respond identically, so that an outsider cannot check whether someone else's task exists.

What about the SDKs, and what to do

The team looked for the extension directly in the package code, and where the SDK allowed, they stood up a working pairing. The picture is uneven. The TypeScript server package version 0.2.3 turned out to be a client and receiver only for the old Tasks. In some places the extension mechanism exists, but a ready-made Tasks module does not. In one test run, all 12 calls out of 12 created a task. In three Java jar files, not a single mention of the extension was found, and in one of the packages there are no task types, although working client–server pairs were launched.

The practical conclusion is this. Building production on native Tasks today is risky: SDK and client support is uneven. It is wiser to take the hybrid scheme. The server keeps state and rights in external storage and describes tasks in a format compatible with future Tasks. Clients that do not understand the extension get a regular tool with status polling. That way, a process crash does not lose work, and moving to the native variant will not require changing the architecture.

Story

Key Questions Answered

How we tested?

The authors cloned the specification and extension repositories, installed current SDKs, and built test benches. They sent 13 requests to a TypeScript server, ranging from standard ones to deliberately broken ones. Then they wrote a hybrid server and ran two measurements. The first shows how many model turns are consumed by waiting for a long task (45 measurements in total).

What are the key details on Stateless: what it changes for long tasks?

The main architectural change in this revision is that the protocol has become fully stateless. There is no longer a mandatory handshake between client and server. Each request carries the protocol version and the client's capabilities itself, so any server behind a load balancer can process it, without binding the client to a specific node. For long operations, this leads to a strict rule.

What are the key details on Tasks: simple on paper, harder in practice?

The mechanics are clear. The server does not keep the request open; it immediately issues a task identifier. The client periodically asks for status at the interval the server suggested, until the result arrives. A task can pause and request input from the user, and the client passes the answer in a separate call. Cancellation works softly: the server confirms the command with an empty response, but work already in progress may well run to completion.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…