SEP-2001: Optional High Availability Patterns for Stateful Streaming in MCP Deployments #2001
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstract
This SEP proposes optional high availability (HA) best practices for MCP deployments with stateful streaming sessions (e.g., SSE). While the MCP protocol itself remains unchanged, production deployments often face challenges in maintaining session continuity and resilience when using multiple replicas behind load balancers. This proposal outlines optional patterns, including pub-sub event buses, cluster coordination with P2P forwarding, middleware/SDK abstraction, and session partitioning. These patterns provide guidance for implementers to achieve HA without breaking protocol compatibility or requiring client modifications.
Motivation
Production MCP deployments increasingly target multi-node, horizontally scalable environments. Long-lived streaming sessions (SSE) introduce challenges when routed through stateless HTTP ingress or load balancers:
Community discussions, including GitHub PR #325, have highlighted these issues. Contributors concluded that session stickiness or shared session stores are practical implementation considerations, but not mandated by the protocol. This creates an opportunity for informational guidance on HA patterns that are optional and non-intrusive.
Specification
This SEP does not introduce protocol-level changes. The following optional HA patterns are proposed for implementers:
1. Core HA Patterns
1.1 Event Bus / Pub-Sub
1.2 Cluster Coordination & P2P Forwarding
2. Implementation & Optimization Support
2.1 Middleware / SDK Abstraction
2.2 Session Partitioning / Affinity Hints
3. Illustrative Middleware-Oriented Model (Python, Non-Normative)
Rationale
Backward Compatibility
No protocol changes are introduced. Existing clients and servers remain fully compatible. Adoption of HA patterns is optional and implementation-defined.
Security Implications
No new security surfaces are introduced by this SEP. Implementers should consider standard security practices for distributed coordination, pub-sub, and session forwarding.
Reference Implementation
Additional Optional Sections
Performance Implications
Testing Plan
Alternatives Considered
Open Questions
Acknowledgments
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context