Asynchronous operations in MCP #491
Replies: 4 comments 8 replies
-
|
I really like the overall idea for dealing with long running jobs. Some minor nitpicks and comments:
|
Beta Was this translation helpful? Give feedback.
-
|
Using resources to model status updates is an interesting idea, but it also competes a bit with MCP's existing progress feature. I've been thinking about a design that handles asynchronous tasks and streaming results in a unified way, and I'm curious to hear what others think. The high-level flow is:
I've tried to keep the design transport-agnostic, but here is how I see it mapping onto the Streamable HTTP transport:
Footnotes |
Beta Was this translation helpful? Give feedback.
-
|
The resource-based approach was discussed during the Hosting WG meeting this morning, and I wanted to bring up a few issues that were not discussed. (We were short on time, so I thought it would be best to discuss them here.)
|
Beta Was this translation helpful? Give feedback.
-
|
Following our discussion in the Hosting WG meeting, I've created a specification PR that implements long-running operations support with minimal changes #549. Let me know if these make sense |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
Introduction
Purpose
This proposal outlines the design for supporting asynchronous operations in the Model Context Protocol (MCP) framework. The design enables long-running operations to be executed asynchronously without blocking the client, with progress tracking and result retrieval through resources.
Scope
The design covers:
Background
Currently, MCP tools are executed synchronously within the request-response cycle. This can lead to timeouts or poor user experience for long-running operations. By supporting asynchronous execution, MCP can handle operations of any duration while providing feedback to users.
Design Overview
Key concepts
async_supportedparameter.resource://tasks/{id}.High-level flow
Detailed design
AsyncResource class
Tool class extension
Tool decorator extension
ResourceManager extension
Update CallToolResult
ToolManager extension
API changes
Tool response format
AsyncResource format
Usage
Server
Client
Scope
Beta Was this translation helpful? Give feedback.
All reactions