feat(mcp): prepare for MCP 2026-07-28 Release Candidate breaking changes
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), allsession.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 instantiationsrc/ogx/providers/inline/responses/builtin/responses/tool_executor.py— session-based tool invocationsrc/ogx/providers/inline/responses/builtin/responses/streaming.py— session lifecycle in streaming pathssrc/ogx/core/connectors/connectors.py— connector discovery viaget_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.SSEenum (lines 76-79), fallback logic (lines 157-162, 309-312)tests/common/mcp.py— entire test server usesSseServerTransport(lines 168-214)- Hardcoded
/sseURLs insrc/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 genericMcpErrorcatch - 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)
- Pin
mcpdependency — prevent accidental breakage on fresh installs - Rewrite
mcp.pytransport layer — stateless model,server/discover, dropClientSession/MCPSessionManager, drop SSE entirely - Update callers — connectors discovery, response handler, tool executor, streaming paths
- Add multi-roundtrip support —
InputRequiredResulthandling,requestState/inputResponsesloop - Fix schema/output fidelity —
structuredContentparsing,tools/listcache metadata - Cleanup — reserved header validation, trace propagation, auth model,
/sseURL removal from tests/config/UI
References
- MCP 2026-07-28 RC blog post
- RC lock date: May 21, 2026
- Final release: July 28, 2026
- 10-week SDK validation window
Source: ogx-ai/ogx