Skip to content

add first-class support for tasks extension #6834

Description

@lloydrichards

What is the problem this feature would solve?

Add opt-in support for the io.modelcontextprotocol/tasks MCP extension, providing durable async tool execution without making tasks part of the base, version-neutral MCP schema.

This is distinct from the experimental task API in MCP v2025-11-25, which is not wire-compatible with the extension.

What is the feature you are proposing to solve the problem?

Introduce a small internal MCP extension boundary, then implement
io.modelcontextprotocol/tasks as its first consumer.

This extension must:

  • negotiate support using the extension identifier in the client's per-request capabilities and the server's revision-appropriate capabilities;
  • allow tools/call to return either its normal result or a task result with resultType: "task";
  • implement tasks/get, tasks/update, and tasks/cancel;
  • provide durable task creation before returning a task handle;
  • support polling, cancellation, and input_required task states;
  • expose task-specific schemas and APIs from a dedicated Tasks module, rather than adding them to McpSchema or McpServer.

The design should remain extension-local where core MCP code may expose only the minimal generic seams needed for extension negotiation, RPC registration, and an alternate result. It must not become a generic public task abstraction.


Context

The extension supersedes the experimental v2025-11-25 task design:

  • it is server-directed rather than enabled with params.task;
  • it uses per-request extension capabilities;
  • tasks/list and tasks/result are removed;
  • tasks/get returns the terminal underlying result or JSON-RPC error;
  • tasks/update carries responses to in-progress server input requests.

This work therefore depends on, or should be developed alongside, the stateless MCP protocol/lifecycle work. The current session-initialization model cannot safely stand in for per-request extension negotiation.

Acceptance criteria

  • A client that advertises io.modelcontextprotocol/tasks on an eligible request can receive either the ordinary result or CreateTaskResult.
  • A server never returns a task result to a client that did not advertise the extension on that request.
  • Task creation is durable before its handle is returned.
  • tasks/get returns task state and, once terminal, the original result or JSON-RPC error.
  • tasks/update submits responses for outstanding input requests.
  • tasks/cancel records cooperative cancellation.
  • Task support is opt-in and does not alter behavior for servers or clients that do not configure the extension.
  • Task types, storage, and helpers are exposed from a dedicated Tasks module, not the base McpSchema / McpServer API.
  • Tests cover negotiation, ordinary-result fallback, lifecycle, cancellation, input-required updates, and reconnect/polling behavior.
  • The implementation pins the Tasks extension draft/revision it targets.

Non-goals

  • Implementing the legacy v2025-11-25 experimental Tasks API.
  • General-purpose persistence backends beyond the task-store contract and a
    suitable in-memory implementation.
  • Supporting arbitrary third-party extensions in this issue.

What alternatives have you considered?

This would be part of the work for #6617 and #6706 after resolving #6829

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions