Skip to content

MCP went stateless: Is your AWS MCP server deployment well-architected?

Summary

On 2026-07-28, the Model Context Protocol shipped its largest revision since launch, making the protocol core stateless. The initialize handshake and the Mcp-Session-Id header are gone; every request now self-describes (protocol version, client context) and any server instance can answer it. The AWS Architecture Blog reads the MCP 2026-07-28 spec against the AWS Well-Architected Agentic AI Lens, pillar by pillar, and argues that the new protocol natively achieves what the old session-based protocol could only reach through compensating AWS infrastructure — sticky routing on Application Load Balancers, session stores in DynamoDB/ElastiCache, and body-parsing gateways. The recommendation: migrate, delete the session infrastructure that existed only to preserve protocol sessions, and (only after old-client traffic reaches zero) retire the backward-compatible legacy lane. The post targets teams managing the full deployment stack themselves; teams behind Amazon Bedrock AgentCore Gateway get protocol management and backward compatibility handled for them.

Key takeaways

  1. Stateless describes the protocol, not your application. Stateful use cases still work: when a server needs continuity, a tool returns an identifier for stored state, the model carries that key on later calls, and the state lives in your datastore. The analogy is a coat check — the old protocol was a valet who remembered your face (forcing you back to the same valet); now you hold a numbered ticket any attendant can honor. Advantage: the identifier sits in the model's context (reasoned about, threaded across tools) rather than hidden in a header (Source: this article).

  2. The before/after deployment table is the actionable core. Each row is a piece of AWS infrastructure the old protocol required that the stateless core makes unnecessary:

  3. ALB stickiness → plain round-robin (delete the stickiness config).
  4. Session state in DynamoDB / ElastiCache → no session store; server-minted identifiers passed as tool arguments.
  5. Gateway parses request bodies to route by method → route/throttle on the Mcp-Method and Mcp-Name headers.
  6. AWS Lambda workarounds for the stateful handshake → Lambda is a natural fit (request in, response out).
  7. Refetch tool lists per session → cache with ttlMs and cacheScope.
  8. Bolt-on tracing / proprietary protocol logging → W3C Trace Context in _meta; stderr or OpenTelemetry for logging (protocol logging deprecated).
  9. Stream resumption (Last-Event-ID) → make tools idempotent; clients re-issue broken calls.

  10. server/discover replaces the handshake for capability negotiation. A client that wants to know what a server supports before calling it gets supported protocol versions, capabilities, and identity in a single response. Servers must implement it; calling it is optional for the client.

  11. Multi Round-Trip Requests (MRTR) replace server-initiated push. Servers can no longer push a request to a client mid-call (how confirmations, sampling, and root queries used to work over a held-open stream). Instead a server returns an input_required result carrying an inputRequests map and an opaque requestState token; the client fulfills the requests and re-sends the original call with inputResponses and the echoed requestState. Any instance can resume because requestState carries all needed context — no shared session store, no held-open connection. This is what makes rich interaction work on AWS Lambda (multi-round-trip-request).

  12. Well-Architected, pillar by pillar (the spec converges on the Lens):

  13. Operational excellence — W3C Trace Context in _meta (traceparent/tracestate/baggage) traces end-to-end through any OpenTelemetry backend incl. CloudWatch; Mcp-Method/Mcp-Name headers and a required resultType field (complete/input_required) give gateways per-operation signals without body parsing; protocol logging deprecated in favor of stderr/OTel.
  14. Security — clients must validate the iss param (RFC 9207) and declare application_type at registration (Dynamic Client Registration itself is now deprecated in favor of Client ID Metadata Documents); MRTR bounds when a server can prompt a human; because state identifiers are model-visible, servers must enforce ownership on every call and treat requestState as untrusted input, protecting integrity with HMAC or AEAD; tool I/O schemas validated against JSON Schema 2020-12.
  15. Reliability — stateless transport makes instance loss a non-event; requestState continuation tokens resume interrupted multi-step interactions; stream resumability was removed so tools must be idempotent on client re-issue; standardized error-code ranges (-32000..-32019 implementation-defined, -32020..-32099 reserved) give canonical retry/backoff/circuit-break signals.
  16. Performance efficiency — protocol-declared caching (ttlMs + cacheScope, now required on list/resource-read results); deterministic tool-list ordering enables LLM prompt-cache hits; header-based routing avoids body parsing.
  17. Cost optimization — delete session infrastructure that exists only to preserve sessions. A two-node ElastiCache cache.t4g.micro session store is ~$23/month (AWS Pricing Calculator, July 2026); the larger saving is eliminating an entire class of infra + its operational burden, and sticky routing's uneven load distribution. Serverless (Lambda) moves from workaround to first-class pattern.
  18. Sustainability — no pinned-session capacity means no instance must stay warm to hold a session; right-size against real traffic, not theoretical peak.

  19. Backward-compat lane has a clock. The 2026-07-28 spec keeps a backward-compatible lane for pre-2026-07-28 (2025-11-25) clients. Keep ALB stickiness and the DynamoDB/ElastiCache session store until old-client traffic reaches zero. Instrument the gateway to log protocol version per request, set a sunset date, communicate it to client teams, and only then decommission — the dual-route drain-then-remove shape.

  20. Deprecations have a 12-month floor. Roots, Sampling, Logging, and the HTTP+SSE transport are deprecated with a twelve-month minimum before removal (earliest July 2027). ping, logging/setLevel, and notifications/roots/list_changed were removed outright; log level moved into per-request _meta. Migration paths: directories via tool params/resource URIs (not Roots), direct LLM-provider APIs (not Sampling), stderr/OTel (not Logging), Streamable HTTP (not HTTP+SSE). This is the feature-lifecycle policy in action.

  21. New operational surfaces to watch. subscriptions/listen consolidates change notifications into a single opt-in POST-response stream (check idle timeouts across LB/proxy/compute). MCP Apps puts server-supplied HTML inside the host (iframe sandboxing + auditable JSON-RPC + pre-declared UI templates — treat template review as mandatory, decide which servers may ship UI). cacheScope: "public" is a multi-tenant disclosure risk — default to "private", widen only for responses identical across callers.

  22. Guardrails against future breaks. Three mechanisms shipped with the stateless core: the feature-lifecycle policy (Active/Deprecated/Removed, ≥12mo floor), an extensions framework (opt-in capabilities prove themselves outside the core — where Tasks landed after redesign), and a conformance suite every Standards-Track proposal must satisfy before reaching Final (the same suite the official SDKs validate against).

Operational numbers

  • MCP stateless revision published 2026-07-28; blog post 2026-09-01.
  • Deprecated features: ≥12-month floor before removal; earliest removal July 2027; DCR removal targeted after summer 2027.
  • Standardized error codes: -32000..-32019 implementation-defined; -32020..-32099 reserved for MCP.
  • Example session-store cost: two-node ElastiCache cache.t4g.micro ≈ $23/month (AWS Pricing Calculator, July 2026) — cited as the small part of the saving.
  • Resource-not-found error code migration: -32002 → -32602.

Systems / concepts / patterns extracted

Caveats

  • This is an architecture/guidance post, not a production retrospective: the only hard number is an illustrative ElastiCache price; no throughput, latency, or fleet-size figures from a real migration.
  • Guidance applies to session infrastructure built to compensate for the old protocol. Managed hosts that offer session features by design for specific use cases are explicitly out of scope.
  • The core claims (statelessness, MRTR, deprecation windows, headers, caching fields) mirror Cloudflare's 2026-08-06 write-up of the same spec revision — see sources/2026-08-06-cloudflare-the-next-generation-of-mcp. The AWS post adds the Well-Architected framing, the AWS-service deployment table, cost/sustain­ ability angles, and server/discover, resultType, and standardized error-code detail.

Source

Last updated · 766 distilled / 2,225 read