[4.0] Add polling support for long-running operations with MCP Tasks and client fallback

Open
#3,990 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@alzimmermsft is already working on this.

Since Oct 19, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement needs-team-attention remote-mcp server-Azure.Mcp tools-Core

Release Tracker: microsoft/mcp-pr#691 (Theme 1.2)
Initiative: microsoft/mcp#3105 (Product and Platform)
Priority: P0 (Required for 4.0 GA)

Objective

Standardize polling and long-running operations (LROs) in Azure MCP Server to prevent client timeouts and stalled conversations during multi-minute Azure operations. This feature owns both the official MCP Tasks lifecycle and stateless polling fallback for clients that do not advertise Tasks support.

Boundary with Pagination (#3112)

  • This issue (#3990) owns starting long-running operations, issuing task or operation handles, polling status, reporting progress, retrieving results, and cooperative cancellation where supported. It also owns the fallback contract for clients without Tasks support.
  • #3112 owns only pagination of collection/query results. Page continuation tokens are not LRO operation handles.
  • Pagination and polling are separate features. Neither feature is a prerequisite for the other.

Scope

  • Integrate the finalized MCP Tasks specification through the updated official ModelContextProtocol C# SDK (#3991).
  • Implement the full task lifecycle across the command execution pipeline: task creation and handle issuance, status inspection and progress reporting, output retrieval upon completion, and cooperative cancellation propagation.
  • Define and implement a stateless fallback for clients without Tasks support: start an operation and return an operation handle, inspect its status in subsequent tool calls, and retrieve its terminal result or error without requiring MCP Tasks capability negotiation.
  • Define fallback polling guidance and invalid or expired handle behavior. Document cancellation behavior and any service-specific limitations.
  • Support durable task tracking, request-scoped tenant and identity isolation, and recovery across transient transport disconnects in both stdio and remote HTTP modes. Apply identity isolation and reconnect safety to fallback operation handles as well.
  • Deliver an initial service pilot covering high-latency operations (deployments, database restorations, failover drills, and backup recovery operations).
  • Ensure polling and reconnect recovery do not resubmit the initiating mutating operation.

Dependencies

  • Stabilized MCP Specification and C# SDK upgrade for Tasks integration: #3991.

Related issues

  • #3112: Separate pagination feature for collection/query results.
  • #1426: Poll interval configuration and recorded-test performance. Keep this design question separate; distinguish server-side waiting from client-driven status polling.
  • #3229: Missing progress notifications during Event Hubs updates can cause client timeouts. This remains a separately tracked bug, not a duplicate of this feature.
  • #3255: Fabric-specific polling and result retrieval for getDefinition and other LROs. Coordinate relevant patterns without absorbing the Fabric feature into this Azure MCP issue.

4.0 Exit Criteria

  • End-to-end Tasks lifecycle (create, poll status, retrieve output, cancel) validated across both stdio and HTTP transports.
  • Clients without Tasks support can start an operation, poll its status, and retrieve its terminal result or error across both transports.
  • Invalid and expired fallback handles return explicit errors, and task/operation handles enforce tenant and identity isolation.
  • Task and fallback operation recovery verified under transport reconnects without duplicating mutating operations in Azure.
  • Polling guidance and cancellation behavior documented for both Tasks and fallback clients.
  • Recorded and unit test coverage added for Tasks and fallback lifecycles, terminal errors, reconnect recovery, and tenant isolation.
Dominant language
C#
Stars
3.9k
Forks
689
Avg merge
2d 11h
Merged PRs (30d)
143

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/mcp

All issues in microsoft/mcp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.