Skip to content

Subscribe MCP server logging events in an Agent #793

@daizeyao

Description

@daizeyao

Please read this first

  • Have you read the docs? Agents SDK docs YES
  • Have you searched for related issues? Others may have had similar requests YES

Describe the feature

Description
My MCP tool calls often take a long time (around 2–4 minutes). This is why I raised #772 about wanting configurable timeouts.

What I’d like is to stream real-time logs while the agent is analyzing, so that I can see progress updates instead of waiting silently. For example, in mcpserver I can use sendLoggingMessage to print logs (modelcontextprotocol/typescript-sdk#311).

Currently, my solution is to manually implement a CustomMCPServerSSE class and set up an extra channel during agent.run to receive logs. This works, but it feels hacky.

Question:
Is there a more elegant way to implement interactive log streaming for MCP Tools, so that during an agent run I can receive real-time responses/logs without building a separate custom SSE pipeline?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions