8000 Implement asynchronous task execution with result retrieval after connection loss · Issue #769 · modelcontextprotocol/python-sdk · GitHub
[go: up one dir, main page]

Skip to content
Implement asynchronous task execution with result retrieval after connection loss #769
Open
@istarwyh

Description

@istarwyh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0