feat(core): Support stable MCP SDK v2 - #22883
Open
sergical wants to merge 5 commits into
Open
Conversation
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
sergical
marked this pull request as ready for review
July 30, 2026 17:23
Contributor
size-limit report 📦
|
JPeer264
self-requested a review
July 30, 2026 21:44
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support and end-to-end coverage for the stable split MCP SDK v2 packages. MCP server spans now read protocol and client identity from the 2026-07-28 per-request envelope and server identity from result metadata, while preserving the existing initialize-based extraction for legacy protocol sessions.
The Cloudflare MCP fixture now follows the Agents 0.20.1 stateless factory API and verifies both a modern 2026-07-28 tool call and a claimless legacy-compatible tool call. The Node fixture moves from the v2 alpha to exact stable packages and continues exercising the legacy initialize/session protocol; the separate McpAgent fixture remains unchanged for sessionful v1 coverage.
Root cause
MCP 2026-07-28 does not perform the initialize exchange that previously supplied protocol and implementation metadata, so v2 tool spans were created but omitted mcp.protocol.version, mcp.client., and mcp.server. attributes.
Fixes #22878