#5952·ogx

feat(mcp): prepare for MCP 2026-07-28 Release Candidate breaking changes

Author: lesebCreated May 27, 2026Updated Sep 29, 2026
Labelsstale

Summary

The MCP 2026-07-28 Release Candidate introduces the most significant breaking changes since MCP launch. OGX's MCP client implementation (src/ogx/providers/utils/tools/mcp.py, connectors, tool runtime, test infrastructure) needs migration before the RC SDK ships.

What breaks

1. Session model removed (CRITICAL)

The RC removes the initialize/initialized handshake, Mcp-Session-Id headers, and the entire session concept. The protocol is now stateless — client info and capabilities travel in _meta on every request, and server/discover replaces the handshake for capability discovery.

Affected code:

  • src/ogx/providers/utils/tools/mcp.py — MCPSessionManager (lines 81-293), client_wrapper (lines 297-388), all session.initialize() calls (lines 182, 324), get_mcp_server_info() re-initializes (lines 537-538)
  • src/ogx/providers/inline/responses/builtin/responses/openai_responses.py — MCPSessionManager instantiation
  • src/ogx/providers/inline/responses/builtin/responses/tool_executor.py — session-based tool invocation
  • src/ogx/providers/inline/responses/builtin/responses/streaming.py — session lifecycle in streaming paths
  • src/ogx/core/connectors/connectors.py — connector discovery via get_mcp_server_info()

2. SSE transport removed (CRITICAL)

SSE streams are replaced by Multi Round-Trip Requests. The MCPProtol.SSE fallback strategy and the entire test server infrastructure (SseServerTransport) are dead.

Affected code:

  • src/ogx/providers/utils/tools/mcp.py — SSE imports (line 18), MCPProtol.SSE enum (lines 76-79), fallback logic (lines 157-162, 309-312)
  • tests/common/mcp.py — entire test server uses SseServerTransport (lines 168-214)
  • Hardcoded /sse URLs in src/ogx/distributions/ci-tests/, integration tests, UI

3. Multi-roundtrip requests not supported (CRITICAL)

invoke_mcp_tool() assumes one request returns one final result. There is no handling for InputRequiredResult, requestState, or inputResponses. Tools requiring user input mid-execution will silently fail.

Affected code:

  • src/ogx/providers/utils/tools/mcp.py — invoke_mcp_tool() (lines 471-509)
  • src/ogx/providers/inline/responses/builtin/responses/tool_executor.py — _execute_tool()

What needs attention (non-breaking but should fix)

4. New required Mcp-Method / Mcp-Name headers

Streamable HTTP now requires these headers. User-supplied headers could conflict. Need to reserve and reject these in prepare_mcp_headers() and provider-data header validation.

5. Tool schema / structuredContent handling

_parse_mcp_result() ignores structuredContent entirely. MCPListToolsTool drops output_schema. RC servers returning structured-content-only output will be mishandled. Full JSON Schema 2020-12 with oneOf/anyOf/allOf/$ref/$defs now supported.

6. tools/list caching (ttlMs, cacheScope)

list_mcp_tools() ignores cache metadata from RC responses. No freshness enforcement when reusing previous tool listings.

7. W3C Trace Context propagation

No traceparent/tracestate/baggage propagation despite existing OTel spans around MCP calls.

8. Auth hardening

Bearer token passthrough only — no issuer validation (RFC 9207), no application type declaration, no issuer binding. Pass-through model still works but doesn't leverage new security guarantees.

What's safe (no impact)

  • Tasks API redesign — no MCP Tasks usage in the codebase
  • Error code -32002 → -32602 — no explicit error code matching, only generic McpError catch
  • Roots / Sampling / Logging deprecated — none of these MCP features are used
  • Extensions framework — no extensions handling in current code

Immediate action: pin dependency

The repo uses unbounded mcp>=1.23.0 in pyproject.toml (lines 74, 179, 191), src/ogx/providers/registry/tool_runtime.py:93, and src/ogx/providers/registry/responses.py:32. If the RC SDK ships under this range, fresh installs will break. Pin to mcp>=1.23.0,<2.0 (or the appropriate RC version boundary) before the July 28 release.

Migration plan (priority order)

  1. Pin mcp dependency — prevent accidental breakage on fresh installs
  2. Rewrite mcp.py transport layer — stateless model, server/discover, drop ClientSession/MCPSessionManager, drop SSE entirely
  3. Update callers — connectors discovery, response handler, tool executor, streaming paths
  4. Add multi-roundtrip support — InputRequiredResult handling, requestState/inputResponses loop
  5. Fix schema/output fidelity — structuredContent parsing, tools/list cache metadata
  6. Cleanup — reserved header validation, trace propagation, auth model, /sse URL removal from tests/config/UI

References