Skip to content

SEP-2679: Task streaming partial results#2679

Open
morozow wants to merge 5 commits into
modelcontextprotocol:mainfrom
stdiobus:sep/task-streaming-partial-results-notifications
Open

SEP-2679: Task streaming partial results#2679
morozow wants to merge 5 commits into
modelcontextprotocol:mainfrom
stdiobus:sep/task-streaming-partial-results-notifications

Conversation

@morozow
Copy link
Copy Markdown

@morozow morozow commented May 4, 2026

SEP-2679 for Task Streaming — Partial Results for Long-Running Operations.

This SEP extends the Tasks primitive (SEP-1686) with a new notifications/tasks/partial JSON-RPC notification type that enables task receivers to push incremental content chunks to requestors while a task is in progress. The proposal addresses the streaming gap identified as future work in SEP-1686, enabling real-time delivery of LLM-generated text, progressive analysis results, and other incremental outputs through the existing task lifecycle.

Motivation and Context

SEP-1686 introduced Tasks as a "call-now, fetch-later" mechanism but provides no standard way to deliver incremental content during execution. This creates concrete problems across MCP deployments:

  • Agent-to-agent latency: Multi-hop architectures (A → B → C → LLM) compound 10–30s delays at each layer with no intermediate feedback, preventing early cancellation or redirection
  • Degraded UX: IDE integrations and desktop applications show a spinner instead of streaming text when operations route through Tasks, discouraging Task adoption for LLM-backed tools
  • Polling overhead: tasks/get polling adds average 2.5s tail latency per task and generates N requests per task for hosted servers handling thousands of concurrent clients
  • Developer friction: Tool developers are forced to choose between long-running lifecycle management (Tasks) and streaming output (real-time UX) — this SEP eliminates that false choice

The proposal builds directly on the "Intermediate Results" and "Push Notifications" items explicitly identified as future work in SEP-1686.

How Has This Been Tested?

A working reference implementation is provided in a fork of the TypeScript SDK:

The prototype includes:

  • TaskPartialNotificationParamsSchema and TaskPartialNotificationSchema Zod schemas with full type conformance
  • Server API: sendTaskPartial() with Zod validation and createPartialEmitter() with auto-incrementing seq on ExperimentalMcpServerTasks
  • Client API: subscribeTaskPartials() with seq-based ordering, duplicate detection, and gap warning on ExperimentalClientTasks
  • Capability negotiation: presence-based tasks.streaming.partial on both ServerCapabilities and ClientCapabilities
  • End-to-end examples (server simulating LLM token generation + client consuming streaming partials)

Test results (zero regressions against existing tests):

  • packages/core: 22 files, 587 tests ✓
  • packages/server: 7 files, 83 tests ✓
  • packages/client: 11 files, 378 tests ✓
  • test/integration: 17 files, 433 tests ✓
  • Property-based tests via fast-check (100 iterations per property) ✓
  • Typecheck clean across all packages ✓

The prototype demonstrates that the design integrates cleanly with the existing Tasks infrastructure without requiring transport-level changes.

Breaking Changes

None. This SEP introduces only additive changes:

  • A new notification type (notifications/tasks/partial)
  • A new capability field (tasks.streaming.partial)
  • A new tool execution hint (execution.streamPartial)

Old clients ignore unknown notifications per JSON-RPC 2.0. Old servers simply don't send partials. The canonical result is always available via tasks/result regardless of streaming support.

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

SEP structure follows the SEP format guidelines: Preamble, Abstract, Motivation (5 deployment categories), Specification (notification format, capability negotiation, tool-level declaration, lifecycle interaction, transport considerations), Rationale (alternative designs considered), Backward Compatibility, Reference Implementation, Security Implications (6 areas), and Open Questions.

Seeking sponsor from Core Maintainers. The proposal aligns with the direction outlined in SEP-1686 and addresses a gap that affects agent-to-agent communication, IDE integrations, and hosted MCP deployments.

AI Disclosure: This SEP was developed with AI assistance (Claude via Kiro IDE). AI was used for SDK codebase analysis, requirements validation, reference implementation, and document consistency checking. All protocol design decisions, behavioral semantics, and the SEP narrative were authored and reviewed by the human author.

morozow added 3 commits May 4, 2026 18:40
- Add new SEP document defining task streaming extension for long-running operations
- Extend Tasks primitive (SEP-1686) with backward-compatible partial result mechanism
- Introduce `notifications/tasks/partial` notification type for incremental content delivery
- Enable real-time streaming of LLM-generated text and progressive analysis results
- Include detailed specification, behavioral requirements, and implementation guidance
- Address streaming gaps in agent-to-agent communication, IDE UX, and polling overhead
- Provide consistent developer experience across synchronous and task-augmented execution models
- Mark SEP as officially assigned and ready for review
- Update PR reference from "Pending" to linked PR modelcontextprotocol#2679
- Rename SEP file from 0000-task-streaming-partial-results.md to 2679-task-streaming-partial-results.md
- Add new SEP-2679 document for task streaming with partial results
- Update docs.json to include SEP-2679 in Draft section
- Update SEP index to reference new task streaming specification
- Enables incremental content delivery for long-running MCP operations
@morozow morozow requested review from a team as code owners May 4, 2026 17:03
morozow added 2 commits May 4, 2026 19:06
- Improves readability and follows markdown best practices for list separation
- Add blank line before bullet list in End-to-End Example section for improved markdown formatting
- Remove email address from author field, keeping only name and GitHub link
- Normalize table column widths in mdx file for consistency
- Simplify author attribution format across both documentation files
- Improve readability by removing unnecessary email formatting
@morozow morozow changed the title docs(sep): add SEP for task streaming partial results docs(sep): add SEP-2679 for task streaming partial results May 4, 2026
@localden localden changed the title docs(sep): add SEP-2679 for task streaming partial results SEP-2679: Task streaming partial results May 6, 2026
@localden localden added proposal SEP proposal without a sponsor. SEP labels May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal SEP proposal without a sponsor. SEP

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants