Build Your First MCP Task

Intermediate

Build an MCP server and client that create thumbnail batches, then use Tasks to track progress, retrieve results and request cancellation.

7 steps 56 min Updated 2026-11-04
Your progress0 of 7 completed
0% complete Checking saved progress…

You’ll build

An MCP Task for image batches

Local runnable project

The MCP client declares Tasks support and calls create_thumbnails. The MCP server saves a task in its local store, starts the worker, and returns a task ID. The client uses tasks/get to retrieve status and the eventual result over Streamable HTTP.

You’ll learn

How the MCP server returns a task handle

How the MCP client polls and reconnects by task ID

Where the worker and local task store fit

How cancellation and tool errors appear

Some tools/call requests take longer than a request should stay open. Think of a test suite, a deployment, a data export, or a step that waits for a person to approve something. 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. The MCP client can disconnect, come back later with the task ID, and pick up the same work.

This guide is for developers who have built an MCP server and are new to Tasks. The first step explains how Tasks work with diagrams of the full exchange. The remaining steps guide you through implementing the extension on both an MCP server and an MCP client, using a batch of image resizes as the example. For the concepts on their own, without the build, read How MCP Tasks Work.

What you will build

Your MCP server will use Sharp to turn six images into eighteen thumbnails: three widths per image. Your MCP client will start the batch as a task, report its progress and retrieve the result. Then you will reconnect to a running task using its saved ID, cancel one, and handle a tool error.

Three generated sample images resized to 320 pixels wide: landscape, portrait and square.

Get started with Understand how MCP Tasks work and building your first task workflow below.

Find it across ATM

Search All Things MCP

ESC

Search the practical layer around the protocol.

Browse Guides Read the Blog

Your ATM account

Sign in or create an account

Continue with GitHub. If you’re new, your ATM account will be created automatically.