# What structural signals indicate MCP mutual-TLS attestation has silently degraded to server-name-only trust **Date of Record:** 2026 November 28 **Scope:** Applies to HTTP-native MCP transports (Streamable HTTP, SSE-over-HTTP) where the client agent attests server identity via mTLS and pins a server certificate or SPKI. Does not apply to stdio transports or to deployments where the MCP server is co-located in the same trust boundary as the client. ## Core Distinction There are two structurally different things an agent can mean when it says "I verified the MCP server." The first is *channel authentication*: the TLS handshake completed, the peer presented a certificate chaining to a trusted CA, and the hostname in the URL matched a SAN. The second is *instance attestation*: the specific process answering `tools/list` is the specific instance the orchestrator intended to talk to, running the specific code and holding the specific credentials bound to that identity. These diverge precisely when the certificate is valid but the *binding between certificate and MCP endpoint identity* is not. The non-obvious failure is this: mTLS can complete perfectly, all chain validation can pass, and the agent can still be talking to a different MCP server than the one it thinks it pinned—because the certificate proves control of a *hostname*, not control of an *MCP server instance*. When a load balancer, sidecar, or service mesh terminates TLS and re-originates plaintext or a different cert to the backend, the client's mTLS attestation is structurally downgraded to "I trust whatever the mesh routes me to." The handshake is green. The attestation is gone. Nothing in the transport layer reports the difference. ## What Was Observed A client agent pinned the SPKI hash of an MCP server's leaf certificate at registration time, stored it in its tool registry, and re-verified it on every session establishment. Sessions behaved normally for weeks. Then a rolling deploy replaced the backend MCP server pods behind an L7 ingress that performed TLS termination. The ingress certificate had the same SAN and chained to the same CA, so chain validation and hostname matching both passed. The SPKI pin, however, *also* passed—because the pin had been captured against the ingress's leaf, not the server's, and the ingress leaf was unchanged across the deploy. The observable symptom was not a TLS error. It was a slow drift in tool behavior: `tools/list` returned a schema with one tool (`write_file`) whose `inputSchema` had a subtly different `required` set than the pinned snapshot, and `resources/list` returned a resource URI namespace that didn't match the tenant the agent was scoped to. The agent had no mechanism to notice, because its attestation check only asked "is the peer's SPKI what I recorded?"—and the peer was the ingress, which it had always been. The actual MCP server behind the ingress had been swapped, and the ingress was faithfully proxying to a *different tenant's* backend due to a routing-header collision on a header the client never set. The structural signal that mattered was not cryptographic. It was the mismatch between two independently-derived identities: the SPKI the client pinned, and the server-instance identity asserted inside the MCP protocol layer (the `serverInfo.name`/`version` in the initialize response, plus any attestation token the server emits). When those two are derived from the same endpoint, they move together. When TLS is terminated upstream, they decouple silently—and the decoupling is the only signal that attestation has degraded. ## Condition of Validity The SPKI-pin-as-attestation invariant holds only under the condition that the pinned certificate is presented by the *same process* that answers MCP methods. Formally: let `C` be the certificate the client validates, and let `S` be the MCP server instance that responds to `initialize`. Attestation is valid iff `C` is bound to `S` by a mechanism the client can verify end-to-end. mTLS alone gives you `C` bound to a *network peer*. It gives you `C` bound to `S` only if there is no TLS-terminating intermediary, or if the intermediary forwards a verifiable binding (e.g., the backend's own cert in a forwarded-client-cert header signed by the mesh, or an attestation token whose signing key is bound to `S` and whose issuer the client trusts). The invariant also requires that the pinned identity be *stable across the server's lifecycle in a way the client can detect*. A pin against an ingress leaf is stable across backend deploys—which is exactly the problem: stability of the wrong identity masks rotation of the right one. A valid pin must rotate when the attested instance rotates, or the client cannot distinguish "same instance, still healthy" from "different instance, silently substituted." ## Decision Boundary The boundary is whether the client can answer, at session establishment, the question: *did the entity that terminated my TLS also produce the MCP initialize response I am about to trust?* If the answer is derivable from the handshake and the initialize payload together, attestation is intact. If the answer requires out-of-band knowledge (mesh configuration, ingress routing tables), attestation has degraded to server-name-only trust and the client should treat the session as unauthenticated for the purposes of tool authorization. Concretely, the client should refuse to treat a session as attested unless at least one of the following holds: (a) the TLS peer's SPKI equals the SPKI the server reports in a signed attestation bound to the initialize response; (b) the server presents a certificate whose SPKI the client pinned *and* the client has verified there is no terminating intermediary via a direct connection or a mesh-verified forwarded-cert header; or (c) the deployment is known to have no intermediary. Absent all three, the correct action is to downgrade the session to "channel-authenticated, instance-unattested" and gate any tool with side effects (writes, credentialed calls, cross-tenant reads) behind an explicit re-attestation step. ## Operational Effect The practical consequence is that mTLS in HTTP-native MCP is a *channel* control, not an *instance* control, and treating it as the latter produces a class of silent cross-tenant and cross-instance confusions that no transport-level alarm will catch. Agents that pin SPKI against an ingress leaf and call it attestation will, on the first backend substitution, continue to operate against a server they never authorized while every cryptographic check reports success. The guardrail is to make instance identity a first-class, separately-verified artifact—signed by the server instance, bound to the initialize response, and checked against the pin—so that the moment TLS termination decouples the certificate from the server, the client notices the decoupling rather than the certificate. ```python import hashlib import hmac class AttestationDowngradeError(RuntimeError): """Raised when mTLS completed but the attested instance cannot be bound to the TLS peer.""" pass def verify_mcp_session( tls_peer_spki: bytes, pinned_spki: bytes, initialize_response: dict, attestation_token: bytes | None, attestation_issuer_key: bytes | None, ) -> str: """ Returns 'attested' only if the TLS peer is bound to the MCP server instance that produced initialize_response. Returns 'channel-only' if mTLS passed but the instance binding cannot be verified. Raises on hard failures. """ if not hmac.compare_digest(tls_peer_spki, pinned_spki): raise AttestationDowngradeError( f"TLS peer SPKI {tls_peer_spki.hex()[:16]}... does not match pinned " f"{pinned_spki.hex()[:16]}..." ) # The pin matched. That proves the channel. It does NOT prove the instance. server_info = initialize_response.get("serverInfo", {}) instance_id = server_info.get("name"), server_info.get("version") if not all(instance_id): # No instance identity asserted at all: pure channel trust. return "channel-only" if attestation_token is None or attestation_issuer_key is None: # Server asserted an identity but supplied no binding to it. # We cannot distinguish "same instance" from "ingress proxying elsewhere". return "channel-only" expected = hmac.new( attestation_issuer_key, f"{server_info['name']}:{server_info['version']}".encode(), hashlib.sha256, ).digest() if not hmac.compare_digest(attestation_token, expected): raise AttestationDowngradeError( "Attestation token does not bind the initialize response to the " "attested instance; possible TLS-terminating intermediary substitution." ) return "attested" def authorize_tool_call(session_state: str, tool_name: str, side_effecting: bool) -> None: if side_effecting and session_state != "attested": raise AttestationDowngradeError( f"Refusing side-effecting tool '{tool_name}' on session state " f"'{session_state}': mTLS channel trust is not instance attestation." ) ```