-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Proposal: Define streamed tool result semantics in MCP
I’m working on a project experimenting with long-running tools and realtime updates in AI agent frameworks using MCP.
While MCP currently supports notifications (for progress updates or resource changes) and pagination (for batched result fetching), these mechanisms are not suited for tools that emit result data incrementally as they run.
What’s missing is a native protocol mechanism to surface these incremental tool outputs in real time — both:
- to user interfaces (for live display), and
- to agents (for use in ongoing reasoning and decision making before the tool call completes).
Why this matters
Many important tool use cases involve progressive results that should be available during execution:
- AI agents acting as tools (streamed sub-agent responses)
- Recursive planning and mid-execution decisions
- Large result sets (e.g. databases, logs, datasets) returning partial rows
- User-interactive tools or streaming input/output
- Long-running pipelines or background tasks
These scenarios need true streaming semantics, where partial results are emitted as chunks and can be consumed by the agent and/or UI while the tool is still active.
Today, MCP has no defined mechanism for this — notifications and pagination alone are not sufficient.
Proposed addition to MCP
It would be ideal for MCP to define streamed result semantics as a first-class pattern in the protocol:
- Allow tool implementations to yield result chunks incrementally while running (not only final results)
- Define protocol-level messages specifically for streamed tool result chunks (distinct from notifications and pagination)
- Ensure that agent frameworks consuming MCP can ingest these streamed result chunks as they arrive and optionally surface them into LLM context at reasoning steps
This would unlock important real-time and incremental execution patterns for agents, enabling much more advanced and dynamic tool integrations.
Demonstration project (proof of gap)
An experimental project demonstrates the current protocol gap and explores an interim solution using notifications + SDK extension:
https://github.com/josephbharrison/streamable-mcp-client
While this prototype streams chunks via notifications and forcibly advances agent reasoning, it does not solve the problem fully, as streamed chunks are not surfaced into agent context without protocol-level support.
This reinforces that first-class streamed tool result support should be defined at the protocol level for proper integration and reasoning.