MCP exposes multiple primitives, each with methods for discovery, retrieval, and execution. Discovery and retrieval are often times, more fairly straightforward and non-blocking requests.
However, a tools/call is one request and one response. The MCP client waits on that request until the MCP server returns the tool result.
For a database lookup that takes milliseconds, that works quite well. For a batch of eighteen image resizes, a CI run or a step that waits for a person to approve something, it breaks quickly.
Tasks is the MCP extension that lets an MCP server answer such a call immediately with a task handle, then report progress and the final result through short follow-up requests.
This article guides you through what an MCP tasks is, how it works, and why it is important using a practical example.
Let's assume you are building an MCP tool that turns a folder of images into thumbnails. This folder consist of six images, and when a batch of six images is sent to an MCP tool, it generates three widths thumbnail variations per image. This means the tool results will consist of eighteen images in total. This runs long enough that holding one request open for it is a gamble.
This article follows that single call from the moment the MCP client sends it to the moment the result arrives, and shows what Tasks changes along the way.
What goes wrong with one long request
Picture the thumbnail call without Tasks. Your MCP client sends tools/call with the six images, and then it waits on that open request while your server resizes eighteen thumbnails. Three things can go wrong while it waits:
| Problem | What happens to the thumbnail call |
|---|---|
| Timeouts | The client, or a proxy between the client and your server, gives up on a request that stays open too long. |
| Lost results | If the client exits or the connection drops at thumbnail twelve, the finished work has nowhere to go. |
| No visibility | Nobody can see how far the batch has got, and the client has no way to ask it to stop. |
A task separates starting the work from collecting its result. Your server answers the call right away with a task handle. The client then checks on the batch with short requests whenever it wants.
Here is the whole journey of that one call. Each section below covers one or two of its numbered steps, in order. The worker and task store are how a thumbnail server like yours might do the work internally. They are implementation choices, not protocol participants.
The client says it can handle a task
The journey starts at step 1(from the journey image), before your server does any work. Both sides opt in to the extension with the same identifier, io.modelcontextprotocol/tasks. Your server advertises it support for Tasks once, and the client declares it on every request it sends:
// MCP client: in every request's params._meta
"io.modelcontextprotocol/clientCapabilities": {
"extensions": { "io.modelcontextprotocol/tasks": {} }
}
// MCP server: in its server/discover capabilities
"capabilities": {
"tools": {},
"extensions": { "io.modelcontextprotocol/tasks": {} }
}The client never asks for a task, it simply can't. It only says it can handle one. Your server decides, on each request, whether to create a task.
For a batch of eighteen thumbnails, the answer is a task. If someone sent your tool a single small image, your server could reasonably return an ordinary result instead. A server must never return a task to a request that didn't declare the extension. In that case it falls back to an ordinary result if it can still do the work, or returns error -32021 if it can't.
The consequence for anyone writing a client is that a call may come back in either shape. Check resultType on every response instead of assuming a task.
Your server answers with a task handle
Your server accepts the batch. Before it returns anything, it saves a task (step 2): a record it keeps for this one tools/call. The record has an unguessable ID, a status and a status message, and once the batch finishes it also holds the result. The client never sees the resizing itself, only this record.
The specification requires the server to save the task before it responds, so the client's first check always finds it. Then your server returns a task handle in place of the tool result (step 3):
{
"resultType": "task", // "this is a task handle, not the tool result"
"taskId": "a1288bf1-305f-46ac-a49c-5c02a2828bc7", // keep this to check back
"status": "working",
"statusMessage": "Starting the image batch.", // human-readable progress
"createdAt": "2026-10-27T10:41:57.590Z",
"lastUpdatedAt": "2026-10-27T10:41:57.590Z",
"ttlMs": 3600000, // the server may discard the task after one hour
"pollIntervalMs": 500, // "please check no more than every 500 ms"
}ttlMs and pollIntervalMs are values your server chooses, not protocol defaults. It may change either one while the batch runs.
The batch runs while the client checks in
The tools/call response has already been sent, so the resizing can't happen inside that request. Something outside it, such as a worker or a job queue, has to own the batch and update the task record as each thumbnail is written (step 4).
Meanwhile, the client loops through step 5: it waits pollIntervalMs and calls tasks/get with the taskId. Each answer reports where the batch is:
{
"taskId": "a1288bf1-305f-46ac-a49c-5c02a2828bc7",
"status": "working",
"statusMessage": "Created 6 of 18 thumbnails.",
}Over Streamable HTTP, the client also sets the Mcp-Name header to the taskId on every tasks/* request. If your server runs on several instances, a load balancer can use the header to route each check to the instance that holds the task.
Every answer carries a status, and the client decides what to do next by reading it. A task really is a small state machine:
| Status | What the client does |
|---|---|
working | Wait pollIntervalMs, then call tasks/get again. |
input_required | Show the requests in inputRequests, then reply with tasks/update. |
completed | Read result. Check its isError too, because tool errors land here. |
failed | Read error, a JSON-RPC error that prevented a normal result. |
cancelled | Stop waiting. Thumbnails already written may still exist. |
The client drops off and comes back
Step 6 is the moment Tasks exists for. Say the client process exits at thumbnail twelve. Without Tasks, that was the lost-results problem introduced at the start. With Tasks, nothing on the server notices: the batch keeps running and the record keeps updating.
When a client comes back, even over a brand-new connection, it calls tasks/get with the taskId it saved. The task ID is how you resume. Calling the tool again would start a second batch of eighteen thumbnails. Calling tasks/get follows the original one.
The result arrives
When the last thumbnail is written, the next tasks/get returns status: completed (step 7). Its result field holds exactly what an ordinary tools/call would have returned, the same list of eighteen thumbnails. There is no separate "fetch result" request.
When the batch doesn't finish on its own
The diagram shows the happy path. Two more paths can end or pause the journey.
The client cancels. If the user no longer wants the thumbnails, the client sends tasks/cancel and gets an empty acknowledgement. Cancellation is cooperative. Your server stops at the next point where it checks, for example between images, so the image in progress may still finish. The client then reads the real outcome with tasks/get: cancelled, or completed if the batch got there first. That is different from the client simply leaving, which never stops the work.
The task needs input. Suppose your tool found existing thumbnails and wanted permission to overwrite them. It would move the task to input_required and place standard requests, such as an elicitation, in the tasks/get response. The client shows them to the user, answers with tasks/update, and goes back to checking in. The batch in this article may never need an input, but approval steps are one of the main reasons Tasks exists.
Across the whole journey, the client used four methods:
| Method | What the client used it for |
|---|---|
tools/call | Start the batch. The response is a task handle or an ordinary result. |
tasks/get | Check progress and, once finished, read the result. |
tasks/cancel | Ask your server to stop. The reply is an empty acknowledgement. |
tasks/update | Answer a request the task is waiting on, such as an approval. |
When to reach for Tasks
The thumbnail batch is one shape of a common problem. Tasks fit work like this:
| Good fit | Usually unnecessary |
|---|---|
| Batch work: image or media processing, imports, migrations | Lookups and simple API calls |
| Pipelines and deployments that take minutes | Work that reliably finishes in a few seconds |
Approval steps that wait for a person (input_required) | Streaming output back as it is generated |
| Wrapping an API that already returns a job ID |
The official Tasks overview lists more use cases. The statuses, methods and rules in this article come from the Tasks specification.
Wrapping up
This article started with one tools/call asking for eighteen thumbnails, and a client that would otherwise sit on an open request, hoping nothing drops. Tasks don't make the batch any faster. They change what the client is waiting on.
Instead of the result, your server hands back a task handle, and the taskId inside it becomes the client's claim ticket. The client checks in with tasks/get no more often than pollIntervalMs asks, watches the count climb, and can walk away at thumbnail twelve without losing anything. When it comes back, even over a new connection, the same ID picks up the same batch. Calling the tool again would only start another one.
Two details are worth carrying into your own code. A problem inside the tool, like an unreadable image, still ends as a completed task with isError: true, because failed is reserved for JSON-RPC errors. And since your server decides per request whether to create a task at all, a client that declares support must still be ready for an ordinary result.
That is the whole extension: a record on the server, a handful of methods, and a status that tells the client what to do next. The next time a tool you're building takes longer than a request should stay open, you'll know what to return instead.
If you'd like to build the thumbnail server end to end, Build Your First MCP Task walks through the MCP server and MCP client step by step, including reconnecting to a running task and cancelling one.


