Skip to content

[2.0] fix(mcp): reject unsupported protocol versions - #38584

Merged
Vishnuujain merged 1 commit into
2.0from
backport/2.0-37849-mcp-protocol-versions
Nov 24, 2026
Merged

Vishnuujain merged 1 commit into
2.0from
backport/2.0-37849-mcp-protocol-versions

Conversation

@Vishnuujain

@Vishnuujain Vishnuujain commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of #37849 to 2.0 with -x.

One conflict, in HttpServletStatelessServerTransport: main has isJsonContentType from 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 has HttpHeaders.PROTOCOL_VERSION and the same default protocolVersions() (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

  • Protocol version validation:
    • Transport returns 400 Invalid Request for unsupported MCP-Protocol-Version on POSTs to /mcp, exempting initialize
  • Client update:
    • Bumped MCP_PROTOCOL_VERSION to 2025-11-25 in client.py, with a matching unit test assertion
  • Tests:
    • Added transport tests for rejected unsupported versions and accepted supported versions or initialize
  • Docs:
    • Added ADR 2026-11-14-mcp-refuses-unsupported-protocol-versions.md explaining the 400 decision

This will update automatically on new commits.

* fix(mcp): reject unsupported protocol versions

* bump ingestion protocol

(cherry picked from commit 566d51c)
@Vishnuujain
Vishnuujain requested a review from a team as a code owner November 24, 2026 10:03
@Vishnuujain
Vishnuujain requested review from mohittilala and removed request for a team November 24, 2026 10:03
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Rejecting 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 MCP-Protocol-Version headers on POSTs to /mcp get a 400 Invalid Request, with initialize exempt. Also bumps MCP_PROTOCOL_VERSION to 2025-11-25 in client.py, adds transport tests, and includes an ADR documenting the decision. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@Vishnuujain
Vishnuujain merged commit dc4e303 into 2.0 Nov 24, 2026
75 of 78 checks passed
@Vishnuujain
Vishnuujain deleted the backport/2.0-37849-mcp-protocol-versions branch November 24, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant