Description
I’m working on a project experimenting with long-running tools and realtime updates in OpenAI agents and MCP.
While MCP supports notifications (for events like progress updates or changes to available tools/resources) and pagination (for fetching complete results in batches), these are not designed for streamed tool outputs — where a tool emits chunks incrementally while running.
What’s missing is a mechanism to surface these incremental outputs in real time, both to the agent for reasoning and to user interfaces for live display.
In my experimental extension (streamable-mcp-client), I’ve been working around this by emitting server notifications during tool execution. This allows updates to be:
- surfaced immediately as ResponseTextDeltaEvent so UIs (CLI, web) can show realtime progress
- appended to RunResultStreaming.new_items for potential agent awareness (in theory)
- stepped forward manually via Runner.continue_run to allow agent event handling
However, these streamed updates do not become part of agent reasoning or tool evaluation in openai-agents today.
The agent only “sees” a completed tool result at the end of the call.
Even if streamed as notifications/messages, incremental results are not surfaced into the agent’s context.
⸻
Why this matters
Many tools naturally produce progressive results:
- AI Agents (chaining of streaming agent responses as tools)
- Recursive planning and tool execution
- Large queries returning partial rows
- Multi-step pipelines
- User-interactive or streaming input/output
These use cases require not just pagination, but true streaming semantics where incremental chunks are emitted and can be ingested before the tool call completes.
⸻
Proposal
It would be ideal for MCP and its SDKs (such as openai-agents) to support this pattern natively:
- Allow tool implementations to yield streamed results incrementally (not just return final output)
- Define protocol messages for streamed tool result chunks (beyond notifications and pagination)
- Ensure agent frameworks can ingest streamed tool chunks as they arrive and optionally surface them into LLM context at agent reasoning steps
This would unlock realtime, incremental processing patterns and much more powerful recursive/planning use cases for agents.
⸻
Project / demo (experimental approach)