2828from mcp .shared ._context_streams import ContextReceiveStream , ContextSendStream , create_context_streams
2929from mcp .shared ._stream_protocols import ReadStream , WriteStream
3030from mcp .shared .message import ServerMessageMetadata , SessionMessage
31- from mcp .shared .version import SUPPORTED_PROTOCOL_VERSIONS , is_version_at_least
31+ from mcp .shared .version import is_version_at_least
3232from mcp .types import (
3333 DEFAULT_NEGOTIATED_VERSION ,
3434 INTERNAL_ERROR ,
@@ -814,11 +814,10 @@ async def _handle_unsupported_request(self, request: Request, send: Send) -> Non
814814 await response (request .scope , request .receive , send )
815815
816816 async def _validate_request_headers (self , request : Request , send : Send ) -> bool :
817- if not await self ._validate_session (request , send ):
818- return False
819- if not await self ._validate_protocol_version (request , send ):
820- return False
821- return True
817+ # Protocol-version validation lives in the manager's era-routing: only
818+ # values in `SUPPORTED_PROTOCOL_VERSIONS` (or no header at all) reach
819+ # this transport, so the legacy version-gate is gone.
820+ return await self ._validate_session (request , send )
822821
823822 async def _validate_session (self , request : Request , send : Send ) -> bool :
824823 """Validate the session ID in the request."""
@@ -849,28 +848,6 @@ async def _validate_session(self, request: Request, send: Send) -> bool:
849848
850849 return True
851850
852- async def _validate_protocol_version (self , request : Request , send : Send ) -> bool :
853- """Validate the protocol version header in the request."""
854- # Get the protocol version from the request headers
855- protocol_version = request .headers .get (MCP_PROTOCOL_VERSION_HEADER )
856-
857- # If no protocol version provided, assume default version
858- if protocol_version is None :
859- protocol_version = DEFAULT_NEGOTIATED_VERSION
860-
861- # Check if the protocol version is supported
862- if protocol_version not in SUPPORTED_PROTOCOL_VERSIONS :
863- supported_versions = ", " .join (SUPPORTED_PROTOCOL_VERSIONS )
864- response = self ._create_error_response (
865- f"Bad Request: Unsupported protocol version: { protocol_version } . "
866- + f"Supported versions: { supported_versions } " ,
867- HTTPStatus .BAD_REQUEST ,
868- )
869- await response (request .scope , request .receive , send )
870- return False
871-
872- return True
873-
874851 async def _replay_events (self , last_event_id : str , request : Request , send : Send ) -> None :
875852 """Replays events that would have been sent after the specified event ID.
876853
@@ -890,7 +867,7 @@ async def _replay_events(self, last_event_id: str, request: Request, send: Send)
890867 if self .mcp_session_id : # pragma: no branch
891868 headers [MCP_SESSION_ID_HEADER ] = self .mcp_session_id
892869
893- # Get protocol version from header (already validated in _validate_protocol_version)
870+ # The manager only routes supported (or absent) header values to this transport
894871 replay_protocol_version = request .headers .get (MCP_PROTOCOL_VERSION_HEADER , DEFAULT_NEGOTIATED_VERSION )
895872
896873 # Create SSE stream for replay
0 commit comments