Skip to content

McpAgent's internal transport lacks SEP-1699 priming events and retry field #1723

@mattzcarey

Description

@mattzcarey

Context

Found by the MCP server conformance suite added in #1722. The server-sse-polling scenario emits two SHOULD-level warnings against the McpAgent endpoint:

  • Server SHOULD send priming event with id and empty data on POST SSE streams
  • Server SHOULD send retry field to control client reconnection timing

Both are SEP-1699 (SSE resumability/polling) recommendations.

Details

  • McpAgent's internal transport (packages/agents/src/mcp/transport.ts — the WebSocket-bridged StreamableHTTPServerTransport) has no support for priming events or the retry field, for any protocol version. It also lacks closeSSEStream(), so SEP-1699 mid-call stream closure can't be exercised either.
  • By contrast, WorkerTransport (used via createMcpHandler) extends the SDK's web-standard transport and does emit priming events with event IDs for protocol ≥ 2025-11-25 clients when an event store is configured, and supports retryInterval.
  • Note: the conformance harness (0.1.16) probes with protocol version 2025-03-26, and the pinned MCP SDK deliberately suppresses priming events for pre-2025-11-25 clients (they can't parse empty SSE data: frames). So the warning fires for the createMcpHandler variant too, even though it implements the feature — that part looks like a harness inconsistency worth reporting upstream to modelcontextprotocol/conformance.

Acceptance

  • McpAgent POST SSE streams send a priming event (id + empty data) for protocol ≥ 2025-11-25 clients when resumability is available, plus a retry field.
  • Remove server-sse-polling from packages/agents/conformance/baseline-server-mcp-agent.yml (and baseline-server-handler.yml if the upstream harness probe is fixed) — the baseline check will flag the entries as stale once this works.

Possible alternative: migrate McpAgent's streamable-http path onto WorkerTransport instead of patching the legacy transport.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions