# What structural signals indicate an MCP capability negotiation is silently degrading to a lower protocol version mid-session **Date of Record:** 2026 November 26 **Scope:** Applies to MCP client↔server sessions where the client advertises a `protocolVersion` in `initialize` and the server may answer with a *different* version (the spec permits the server to respond with a version it supports, and the client must then either accept or disconnect). Does not apply to single-version pinned deployments where negotiation cannot diverge, nor to transport-level TLS/HTTP downgrade (a separate concern). ## Core Distinction The dangerous boundary is not "client and server speak different versions." That is a *loud* failure — you get a disconnect or an explicit error. The dangerous boundary is **asymmetric downgrade**: the server answers `initialize` with a lower `protocolVersion` than the client requested, the client accepts it (because the spec says to accept a version the client also supports), and then the session proceeds with **the client still holding capability assumptions from its native version**. The handshake "succeeds," `initialized` is sent, tools are listed, and everything looks healthy — but the client is now issuing requests shaped by a feature set the negotiated version does not guarantee. The invariant that breaks: *the negotiated version must be the single source of truth for every capability gate in the session.* In practice the negotiated version is read once at handshake, stored, and then the rest of the client codebase gates on a *module-level constant* (the client's own version) rather than the per-session negotiated value. The downgrade is real; the gating is stale. ## What Was Observed A client built against protocol revision `2025-06-18` connects to a server pinned at `2024-11-05`. Trace: 1. Client sends `initialize` with `protocolVersion: "2025-06-18"`, `capabilities: { sampling: {}, roots: { listChanged: true } }`. 2. Server does not support `2025-06-18`. Per spec it replies with `protocolVersion: "2024-11-05"` and its own `capabilities` — which omit `sampling` entirely (that revision's server-side surface differs) and advertise only `tools` and `resources`. 3. Client validates: "is `2024-11-05` in my supported set?" → yes (clients keep a compatibility floor). Handshake accepted. `initialized` notification sent. 4. **The bug:** the client's tool-call path reads `SUPPORTS_STRUCTURED_CONTENT = PROTOCOL_VERSION >= "2025-06-18"` where `PROTOCOL_VERSION` is the *compiled-in client constant*, not the negotiated `session.protocol_version`. So the client emits `tools/call` expecting structured content blocks in the result. 5. Server, speaking `2024-11-05`, returns plain `content: [{type: "text", ...}]`. Client's parser expects `structuredContent` and either drops the payload, raises a `KeyError` deep in a tool adapter, or — worst case — silently treats the empty structured field as "tool returned nothing" and the agent loops. 6. No error surfaces at the protocol layer. `tools/list` succeeded. The failure is a **data-shape mismatch downstream of a successful handshake**, and its symptom (empty tool results, agent retry loops) points nowhere near negotiation. A second, subtler signal: the server's advertised capabilities are a *subset* of what the client's native version assumes. The client never checks `server.capabilities` against the features it will actually use. It checked version membership and stopped. Capability intersection was never computed. ## Condition of Validity The downgrade-acceptance path is *only* safe when all three hold: - The negotiated `protocolVersion` is threaded into every capability gate as a per-session value (no module-level version constants in request-shaping code). - The effective feature set is `client_native ∩ negotiated_version_features ∩ server_advertised_capabilities`, computed once at handshake and stored on the session object. - Any request whose shape depends on a feature *outside* that intersection is rejected client-side with an explicit capability error, not attempted optimistically. If any of these is violated, a server that answers with a lower version converts your client into a client that lies about its own assumptions for the rest of the session. The failure is silent because the spec's "accept a supported version" rule is doing exactly what it was designed to do — the client is the one that failed to propagate the result. ## Decision Boundary The decision at handshake time is binary and must be made explicitly: - **Accept the downgrade** *only if* the client recomputes its effective capability set from `min(client_native, negotiated) ∩ server_advertised` and every downstream code path reads from that set. Accepting a downgrade while keeping native-version gates is strictly worse than refusing it. - **Refuse the downgrade** (disconnect, surface `protocol_version_unsupported`) when the client cannot guarantee re-gating — e.g., third-party tool adapters that hardcode a version. Refusal is honest; silent acceptance with stale gates is not. The boundary is crossed the moment a client accepts a `protocolVersion` it did not request *and* retains any code path gated on its own compiled version. That combination is the failure condition; either half alone is fine. ## Operational Effect Downstream, the effect is **error compounding disguised as tool flakiness.** Because the handshake succeeded and `tools/list` returned a valid schema, the agent's planner treats the tool as available and well-formed. Each call returns a payload the parser mis-shapes. The agent interprets empty/malformed results as "tool had no output," retries with rephrased arguments, and burns token budget on a defect that is 100% deterministic and located in negotiation. Multi-step plans diverge because step *n+1* was conditioned on a step-*n* result that was silently truncated by a version gate. Auditors replaying the session see successful `tools/call` responses and cannot reproduce the failure without knowing the negotiated version — which, if the client logged only its native version, is unrecoverable from logs. The guardrail: log the negotiated `protocolVersion` and the computed capability intersection at handshake, and assert at every request-shaping site that the feature used is in the intersection. Treat a version downgrade as a capability *reduction event* that must invalidate any cached feature flags. ```python class CapabilityDowngradeError(RuntimeError): """Raised when a session's negotiated version/capabilities do not support a feature the caller is about to use.""" pass SUPPORTED_VERSIONS = ["2024-11-05", "2025-03-26", "2025-06-18"] # Features each version guarantees, independent of what the server advertises. VERSION_FEATURES = { "2024-11-05": {"tools", "resources", "prompts"}, "2025-03-26": {"tools", "resources", "prompts", "resources.subscribe"}, "2025-06-18": {"tools", "resources", "prompts", "resources.subscribe", "tools.structured_content", "sampling", "roots"}, } class Session: def __init__(self, client_native_version, requested_caps): self.client_native_version = client_native_version self.requested_caps = set(requested_caps) self.protocol_version = None self.effective_caps = set() def negotiate(self, server_reply): """server_reply: {'protocolVersion': str, 'capabilities': {...}}""" offered = server_reply["protocolVersion"] if offered not in SUPPORTED_VERSIONS: raise CapabilityDowngradeError( f"server offered unsupported version {offered!r}" ) # Accept only if we can re-gate. Compute the intersection NOW. self.protocol_version = offered version_caps = VERSION_FEATURES[offered] server_caps = set(server_reply.get("capabilities", {}).keys()) self.effective_caps = ( self.requested_caps & version_caps & server_caps ) # If we were downgraded, native-only features must be dropped. dropped = self.requested_caps - self.effective_caps if offered != self.client_native_version and dropped: # Record the reduction; do NOT keep native gates alive. self._downgrade_dropped = dropped def require(self, feature): """Every request-shaping site MUST call this before shaping.""" if self.protocol_version is None: raise CapabilityDowngradeError("require() before negotiation") if feature not in self.effective_caps: raise CapabilityDowngradeError( f"feature {feature!r} unavailable: negotiated " f"{self.protocol_version}, effective caps " f"{sorted(self.effective_caps)}" ) # Usage: a tool-call path that would have gated on a module constant. def shape_tool_call(session, name, args): # WRONG in the failing client: gated on client_native_version. # RIGHT: gate on the per-session effective set. if "tools.structured_content" in session.requested_caps: session.require("tools.structured_content") # raises on downgrade return {"name": name, "arguments": args} if __name__ == "__main__": s = Session("2025-06-18", {"tools", "sampling", "tools.structured_content"}) # Server downgrades and omits sampling + structured content. s.negotiate({"protocolVersion": "2024-11-05", "capabilities": {"tools": {}, "resources": {}}}) # This will raise instead of silently emitting a mis-shaped request: shape_tool_call(s, "search", {"q": "x"}) ```