feature: Async support without using Resource by bzsurbhi · Pull Request #650 · modelcontextprotocol/modelcontextprotocol · GitHub
Skip to content

feature: Async support without using Resource - #650

Closed
bzsurbhi wants to merge 2 commits into
modelcontextprotocol:mainfrom
bzsurbhi:feature/async-no-resource
Closed

feature: Async support without using Resource#650
bzsurbhi wants to merge 2 commits into
modelcontextprotocol:mainfrom
bzsurbhi:feature/async-no-resource

Conversation

@bzsurbhi

@bzsurbhi bzsurbhi commented Jun 5, 2025

Copy link
Copy Markdown

Added support for long-running operations by implementing a basic polling mechanism. Inspired from 617 and 549

Motivation and Context

  • Client → Server - CallToolAsyncRequest
  • Server → Client - CallToolAsyncResult
  • Client → Server(poll) - CheckToolAsyncStatusRequest
  • Server → Client - CheckToolAsyncStatusResult(status)
  • Once status is ACTIVE
    ** Client -> Server - GetToolAsyncRequest
    ** Server -> Client - GetToolAsyncResult(returns CallToolResult)

lLJ1JiCm3BttAwoTntQVD4HL2XgW2Gt4FSfC2KkTAd4dqCI_uopjnjW4dBYqgUFt_9myzoAmyjpMDclaRRHf534KrY3nGUW1_HfzbasdC2F3Hh5n1DDfbdBXxBnBcG0xPyDOXNVIOwsiXGsf6eUWVDNMaXk6i49iSclM-94b59m9GQAQG26WHo798yK2GsiPDknMI0V8Z1mZk8Zkr06KRwXRYKODi9NmuXsvDjZt36a94R9j

How Has This Been Tested?

Breaking Changes

Non breaking changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@connor4312

connor4312 commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

@MQ37

MQ37 commented Aug 5, 2025

Copy link
Copy Markdown

What is the reasoning behind tools/async/join? When a client disconnects and reconnects, and still has the token, it can still poll the status of the tool call. Once the status is ACTIVE (i.e., finished), the client can retrieve the result. What is the need for tools/async/join in this scenario? I suppose the tool will continue running even when the client is disconnected until it hits a hard timeout, and in the meantime, the client can reconnect and poll for the status.

@davemssavage

davemssavage commented Aug 16, 2025

Copy link
Copy Markdown

Having been the original author of #617 I think I've come to the conclusion that with a little creative use of a zero progress notification and some juggling of logic on the client side the existing protocol is able to support much of this use case already.

See modelcontextprotocol/python-sdk#1209 for an example of how this can be implemented in the python client.

Caveat to the above is I'm not sure I'm a big fan of the zero progress notification (even though it does minimise protocol changes) as it feels a bit to implicit and would need good documentation for all client and servers so they know how to implement this behaviour properly.

A more robust solution might be to create a specific protocol notification as an acknowledgement that a call tool has been received which then gives the client an sse event id to resume later. That could be then handled within the sdks rather than relying on clients and tool builders to implement long running tool calls in a specific way.

@dsp-ant

dsp-ant commented Nov 24, 2025

Copy link
Copy Markdown
Member

Tasks is a very similar feature that supports this now.

@dsp-ant dsp-ant closed this Nov 24, 2025
@davemssavage

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Draft

Development

Successfully merging this pull request may close these issues.

6 participants