Resolve protocol version per request and expose it as ctx.protocol_version (#2886)

This commit is contained in:
Max 2026-06-17 08:46:42 +01:00 • committed by GitHub
commit 734746a3d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,6 +35,9 @@ class ServerMessageMetadata:
# transports, None for stdio). Typed as Any because the server layer is
# transport-agnostic.
request_context: Any = None
# Per-message protocol version observed by the transport (e.g. the
# validated MCP-Protocol-Version header).
protocol_version: str | None = None
# Callback to close SSE stream for the current request without terminating
close_sse_stream: CloseSSEStreamCallback | None = None
# Callback to close the standalone GET SSE stream (for unsolicited notifications)