2.14.0
Use this when you need to run long operations asynchronously while doing other work.
The MCP task protocol lets you request operations to run in the background. The call returns a Task object immediately, letting you track progress, cancel operations, or await results.
Requesting Background Execution
Passtask=True to run an operation as a background task:
Task API
All task types share a common interface.Getting Results
Callawait task.result() or simply await task to block until the task completes:
Checking Status
Check the current status without blocking:Waiting with Control
Usetask.wait() for more control over waiting:
Cancellation
Cancel a running task:Status Updates
Register callbacks to receive real-time status updates as the server reports progress:Handler Template
Graceful Degradation
You can always passtask=True regardless of whether the server supports background tasks. Per the MCP specification, servers without task support execute the operation immediately and return the result inline.

