Acknowledge notification POSTs with 202 on the 2026-07-28 HTTP entry (#3326)

This commit is contained in:
Max 2026-08-17 21:15:35 +01:00 • committed by GitHub
commit b2025ab815
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,6 +43,7 @@ from mcp.shared.inbound import (
find_duplicated_routing_header,
find_invalid_x_mcp_header,
mcp_param_headers,
unsupported_protocol_version_rejection,
validate_mcp_param_headers,
x_mcp_header_map,
)
@ -225,6 +226,22 @@ def test_version_rung_data_reflects_supplied_supported_list() -> None:
assert rejection.data == {"supported": list(custom), "requested": LATEST_MODERN_VERSION}
def test_unsupported_protocol_version_rejection_is_the_version_rung_standalone() -> None:
"""SDK-defined: the standalone helper (used by the HTTP notification arm) yields `None` for a
served version and otherwise the very rejection the request ladder's version rung produces."""
assert unsupported_protocol_version_rejection(LATEST_MODERN_VERSION) is None
assert unsupported_protocol_version_rejection("2099-01-01") == classify_inbound_request(
envelope(version="2099-01-01")
)
assert unsupported_protocol_version_rejection(LATEST_MODERN_VERSION, (LATEST_HANDSHAKE_VERSION,)) == (
InboundLadderRejection(
code=UNSUPPORTED_PROTOCOL_VERSION,
message="Unsupported protocol version",
data={"supported": [LATEST_HANDSHAKE_VERSION], "requested": LATEST_MODERN_VERSION},
)
)
# --- rung 3: header ↔ envelope agreement ---------------------------------------