Skip to content

How does a load balancer work with replicas for stateless #405

@botengyao

Description

@botengyao

Hey,

I am confused now:

From the doc here

  • No session ID headers are sent or expected
  • Any server node can process any request
  • No state is preserved between requests
  • Perfect for RESTful or stateless API scenarios
  • Simplest deployment model with minimal infrastructure requirements
┌─────────────────────────────────────────────┐
│                  Client                     │
└─────────────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────┐
│                Load Balancer                │
└─────────────────────────────────────────────┘
          │                       │
          ▼                       ▼
┌─────────────────┐     ┌─────────────────────┐
│  MCP Server #1  │     │    MCP Server #2    │
│ (Node.js)       │     │  (Node.js)          │
└─────────────────┘     └─────────────────────┘

If there are multiple replicas for MCP Server 1, and the client initializes with the first replica, but its second request is load-balanced to a second replica that hasn’t been initialized yet, the request fails.

Is the initialize phase still needed for stateless? like if a server is ever initialized then it can server any requests? I think we would need more clarification for this use case with a load balancer in front.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions