Repository navigation
[2.0] fix(mcp): reject unsupported protocol versions - #38584
Conversation
* fix(mcp): reject unsupported protocol versions * bump ingestion protocol (cherry picked from commit 566d51c)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🔴 High riskRejecting unsupported MCP protocol versions changes the public transport contract; clients relying on permissive handling could receive 400 instead of responses. Adds protocol version validation to the MCP transport so unsupported VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Cherry-pick of #37849 to
2.0with-x.One conflict, in
HttpServletStatelessServerTransport: main hasisJsonContentTypefrom another PR next to the new method. Kept only this PR's change; the net diff matches #37849. SDK 1.1.5 on 2.0 hasHttpHeaders.PROTOCOL_VERSIONand the same defaultprotocolVersions()(2025-03-26, 2025-06-18, 2025-11-25) as 2.1.0 on main.Not built or tested locally on 2.0; relying on CI.
Summary by Gitar
MCP-Protocol-Versionon POSTs to/mcp, exemptinginitializeMCP_PROTOCOL_VERSIONto2025-11-25inclient.py, with a matching unit test assertioninitialize2026-11-14-mcp-refuses-unsupported-protocol-versions.mdexplaining the 400 decisionThis will update automatically on new commits.