Skip to content

Implement asynchronous task execution with result retrieval after connection loss #769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
istarwyh opened this issue May 21, 2025 · 0 comments

Comments

@istarwyh
Copy link

Currently, the MCP SDK doesn't provide a built-in mechanism for asynchronous task execution where the client can retrieve results after a connection loss. This feature would be valuable for long-running tasks or scenarios where network stability is a concern.

Feature request:
Implement a way for MCP Client to submit an asynchronous task to MCP Server, disconnect, and later retrieve the task execution results.

Proposed workflow:

  1. MCP Client submits a task to MCP Server
  2. MCP Server returns a unique task ID
  3. MCP Client can disconnect
  4. MCP Server continues processing the task
  5. MCP Client can reconnect later and query the task status/results using the task ID

Possible implementation ideas:

  • Add a new API endpoint for submitting async tasks
  • Implement a task queue on the server side
  • Add a method to query task status and retrieve results
  • Consider using a persistent storage solution for task results

This feature would enhance MCP's capabilities for handling long-running tasks and improve resilience in unstable network conditions.

Any thoughts or suggestions on how to best implement this feature would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant