Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bhosmer-ant
Copy link
Contributor

The original definition for the new version header requirement (#548, #658) breaks backward compatibility by requiring servers to reject requests from old clients. Here we add a compatibility condition that lets servers assume protocol version 03-26-2025 if the header is missing and the server has no other information about what protocol version the client is using.

@bhosmer-ant bhosmer-ant merged commit cfdfc11 into main Jun 6, 2025
7 checks passed
@bhosmer-ant bhosmer-ant deleted the basil/version_header_compatibility branch June 6, 2025 22:34
@github-project-automation github-project-automation bot moved this from Consulting to Approved in Standards Track Jun 6, 2025
felixweinberger added a commit to modelcontextprotocol/python-sdk that referenced this pull request Jun 9, 2025
…ader

When the MCP-Protocol-Version header is not present in requests, the server
now assumes protocol version "2025-03-26" instead of returning an error.
This maintains backwards compatibility with older clients that don't send
the version header.

The server still validates and returns 400 Bad Request for invalid or
unsupported protocol versions when the header is explicitly provided.

This change addresses the backwards compatibility requirement from
modelcontextprotocol/modelcontextprotocol#668

- Modified _validate_protocol_version to assume "2025-03-26" when header is missing
- Updated tests to verify backwards compatibility behavior
- Added new test specifically for backwards compatibility scenario
felixweinberger added a commit to modelcontextprotocol/python-sdk that referenced this pull request Jun 9, 2025
…ader

When the MCP-Protocol-Version header is not present in requests, the server
now assumes protocol version "2025-03-26" instead of returning an error.
This maintains backwards compatibility with older clients that don't send
the version header.

The server still validates and returns 400 Bad Request for invalid or
unsupported protocol versions when the header is explicitly provided.

This change addresses the backwards compatibility requirement from
modelcontextprotocol/modelcontextprotocol#668

- Modified _validate_protocol_version to assume "2025-03-26" when header is missing
- Updated tests to verify backwards compatibility behavior
- Added new test specifically for backwards compatibility scenario
@bhosmer-ant bhosmer-ant added this to the DRAFT 2025-06-XX milestone Jun 10, 2025
felixweinberger added a commit to modelcontextprotocol/python-sdk that referenced this pull request Jun 11, 2025
…ader

When the MCP-Protocol-Version header is not present in requests, the server
now assumes protocol version "2025-03-26" instead of returning an error.
This maintains backwards compatibility with older clients that don't send
the version header.

The server still validates and returns 400 Bad Request for invalid or
unsupported protocol versions when the header is explicitly provided.

This change addresses the backwards compatibility requirement from
modelcontextprotocol/modelcontextprotocol#668

- Modified _validate_protocol_version to assume "2025-03-26" when header is missing
- Updated tests to verify backwards compatibility behavior
- Added new test specifically for backwards compatibility scenario
felixweinberger added a commit to modelcontextprotocol/python-sdk that referenced this pull request Jun 12, 2025
…ader

When the MCP-Protocol-Version header is not present in requests, the server
now assumes protocol version "2025-03-26" instead of returning an error.
This maintains backwards compatibility with older clients that don't send
the version header.

The server still validates and returns 400 Bad Request for invalid or
unsupported protocol versions when the header is explicitly provided.

This change addresses the backwards compatibility requirement from
modelcontextprotocol/modelcontextprotocol#668

- Modified _validate_protocol_version to assume "2025-03-26" when header is missing
- Updated tests to verify backwards compatibility behavior
- Added new test specifically for backwards compatibility scenario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Approved

Development

Successfully merging this pull request may close these issues.

3 participants