Skip to content

Commit 94997f6

Browse files
Merge pull request #355 from apollographql/lb/mcp-load-balancers
Add load balancer configuration details for Apollo MCP
2 parents a3480d2 + 93c2332 commit 94997f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/source/deploy.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ docker run \
5656
```
5757

5858
To learn more, review the [Apollo Runtime container documentation](/graphos/routing/self-hosted/containerization/docker).
59+
60+
### Using a load balancer
61+
62+
Because [MCP is a stateful protocol](https://modelcontextprotocol.io/docs/learn/architecture#lifecycle-management), you need to configure your load balancer to keep each session on the _same server instance_.
63+
64+
When the MCP client initializes a session with Apollo MCP Server, it receives a session identifier unique to that server instance through the `mcp-session-id` header. You must enable session affinity ("sticky sessions") in your load balancer so that all requests that share the same `mcp-session-id` are routed to the same backend instance.
65+
66+
If the load balancer routes subsequent requests to a different instance, Apollo MCP Server rejects the request because it doesn't recognize the session id.
67+
68+
Many load balancers offered by major cloud vendors don't support header-based session affinity. If yours does not, use software such as Nginx, HAProxy, or Envoy/Istio in front of the Apollo MCP Server instances.

0 commit comments

Comments
 (0)