Skip to content

[MCP] Port run_agent tasks from 2025-11-25 experimental API to SEP-2663 / 2026-07-28 ext-tasks #115

Open

Description

@Birfy

Motivation

#102 / draft PR #106 correctly land run_agent as an MCP task on the 2025-11-25 experimental shape that mcp 1.30 still ships (capabilities.tasks, params.task, tasks/get|result|list|cancel). The PR body already records the spike finding: that experimental API is deprecated, and a host that speaks only the official Tasks extension keeps the plain synchronous call.

That official extension is now published:

Wire differences that matter for s1a-mcp (non-exhaustive; follow the spec):

  • Capability is per-request extensions["io.modelcontextprotocol/tasks"], not the old capabilities.tasks blob.
  • Server returns resultType: "task" / CreateTaskResult; clients poll tasks/get (and optionally tasks/update / tasks/cancel).
  • Status set is working | input_required | completed | failed | cancelled; tool-level isError: true stays completed with the tool result (protocol faults use failed).
  • Hosts that only negotiate the extension will never send the 2025-11-25 params.task flag that [Feat] Let run_agent run as an MCP task (2025-11-25 experimental tasks on the 1.x SDK) #106 keys off.

Until this port lands, Claude Code / other 2026-07-28 hosts that advertise the extension still cannot get a durable handle for a multi-minute Allrecipes / Flights run_agent.

Proposed work

  1. After [MCP] Adopt MCP Tasks so long run_agent can outlive the host session #102 / [Feat] Let run_agent run as an MCP task (2025-11-25 experimental tasks on the 1.x SDK) #106 merge (or in parallel behind a feature flag): spike which mcp / FastMCP release first speaks io.modelcontextprotocol/tasks. Record whether the mcp 2 / fastmcp 4 move from #74 is now a hard prerequisite.
  2. Advertise the extension in server discover capabilities; treat a client that only sends the extension (no experimental task param) as task-capable for run_agent.
  3. Map the existing in-memory task store + cancel/CancelScope path from [Feat] Let run_agent run as an MCP task (2025-11-25 experimental tasks on the 1.x SDK) #106 onto the extension methods; keep the experimental path working until hosts drop it, or document a cutover window.
  4. Contract tests with a fake client capability blob for: extension-only client, experimental-only client, neither (sync path). No live browser required.
  5. Update docs/skills.md / docs/architecture.md: which host protocol revision was verified; do not invent host flags.

Acceptance criteria

  • Client without any tasks capability: behaviour matches today's sync path (existing MCP tests pass).
  • Client advertising only io.modelcontextprotocol/tasks: run_agent returns a task handle; tasks/get reaches a terminal status with the same summary shape as the sync tool result; tasks/cancel frees the run slot.
  • Experimental 2025-11-25 path either still works or is explicitly removed with a CHANGELOG note and a migration sentence in the docs.
  • Docs name the SDK / FastMCP versions that were tested; no unverified host CLI flags.

References

Activity

  1. Birfy commented on Nov 16, 2026

    @Birfy
    CollaboratorAuthor

    Spike for step 1 (checked 2026-11-16 against PyPI and the openjiuwen pin jj-0.1.0 in this repo's lock):

    • Python support for io.modelcontextprotocol/tasks exists only on the 2.x / 4.x line. fastmcp-tasks 4.2.0 describes itself as "Background task execution for FastMCP servers via the io.modelcontextprotocol/tasks extension (SEP-2663)". It requires fastmcp-slim[server]==4.2.0 (so mcp>=2), plus pydocket>=0.26.1 and redis. mcp 2.3.0 ships a generic mcp/server/extension.py (extension request methods such as tasks/get) but no built-in tasks store. modelcontextprotocol/ext-tasks publishes only a TypeScript package.
    • Nothing on our current line speaks it. We run mcp 1.30.0 (mcp>=1.26,<2 in pyproject.toml). The 1.x SDK only has the deprecated 2025-11-25 experimental tasks that [Feat] Let run_agent run as an MCP task (2025-11-25 experimental tasks on the 1.x SDK) #106 uses.
    • So the [Deps] Bound mcp below 2 and record what blocks the move to the 2026-07-28 SDK #74 move is a hard prerequisite, and openjiuwen still blocks it. openjiuwen jj-0.1.0 declares fastmcp<4.0,>=2.14.2, and fastmcp 3.x requires mcp<2. The extension cannot be installed next to the openjiuwen pin until the fork relaxes that bound.

    That leaves two paths. (a) Wait for an openjiuwen pin that allows fastmcp 4 / mcp 2, then adopt fastmcp-tasks; its docket/redis backend would also need an in-memory or local option for s1a-mcp. (b) Hand-roll the extension's wire methods on the 1.x low-level server next to #106's in-memory store. (b) can be done without a dependency move, but it re-implements a spec that the SDK line already covers, and we would have to drop it after the move. I'd hold this issue until #106 lands and the openjiuwen bound moves, rather than open a PR on (b).

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

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