Subchapter 6.4
references/deploy.mdMarkdown5 KBView on GitHub
# Linux / macOS
curl -sSL https://mcp.apollo.dev/download/nix/latest | sh
# Windows
iwr 'https://mcp.apollo.dev/download/win/latest' | iexcargo install --locked apollo-mcp-server--locked builds with the same dependency versions tested for the release.
Use the Apollo GraphOS Operator (opens in a new tab) to deploy Apollo MCP Server on Kubernetes. The operator manages the Deployment, Service, ConfigMap, and an ephemeral graph API key Secret.
Requirements:
The operator forces transport.stateful_mode: false, so no session-affinity configuration is needed. Its plain Kubernetes Service works without special load balancer setup.
Scale with spec.replicas on the McpServer resource, or attach a Kubernetes HorizontalPodAutoscaler directly to it. The operator exposes a scale subresource, so the McpServer itself can be the autoscaling target.
The all-in-one Apollo Runtime Container includes Apollo Router and Apollo MCP Server in a single image. Both port 4000 (GraphQL) and port 8000 (MCP) are exposed.
docker run \
-p 4000:4000 \
-p 8000:8000 \
--env APOLLO_GRAPH_REF="<your-graph-ref>" \
--env APOLLO_KEY="<your-graph-api-key>" \
--env MCP_ENABLE=1 \
-v /path/to/config:/config/mcp_config.yaml \
--rm \
ghcr.io/apollographql/apollo-runtime:latestThis fetches the schema from GraphOS, starts the router, and enables the MCP endpoint at /mcp. By default it uses GraphOS-managed persisted queries for MCP tools.
Benefits:
Use the standalone container when you already have a GraphQL API running elsewhere.
The container expects schema and operation files in the /data directory and serves Streamable HTTP on port 8000.
# mcp_config.yaml
endpoint: https://your-graphql-api.example.com/
operations:
source: local
paths:
- /data/operations/
schema:
source: local
path: /data/api.graphqldocker run \
-it --rm \
-p 8000:8000 \
-v ./mcp_config.yaml:/config.yaml \
-v ./data:/data \
--pull always \
ghcr.io/apollographql/apollo-mcp-server:latest /config.yamlScale Apollo MCP Server independently of your GraphQL API for fine-tuned resource allocation.
Use rover dev to develop locally with both GraphQL and MCP running together. See the Rover CLI documentation (opens in a new tab).
| Scenario | Recommended option | Why |
|---|---|---|
| Kubernetes with GraphOS-managed graph | Apollo GraphOS Operator | Manages the full resource lifecycle automatically |
| New GraphQL + MCP deployment (non-K8s) | Apollo Runtime Container | Single container, optimized performance |
| GraphOS-managed graph (non-K8s) | Apollo Runtime Container | Automatic schema and persisted query sync |
| Adding MCP to an existing GraphQL API | Standalone container | Connects to your existing endpoint |
| Local development | rover dev | Runs both GraphQL and MCP locally |
Clients that negotiate MCP protocol 2026-07-28 or later are always sessionless and need no session affinity. Older protocol versions are stateful and require sticky sessions.
When an older client initializes a session, it receives a session identifier through the mcp-session-id header. Configure your load balancer to route all requests sharing the same mcp-session-id to the same backend instance.
Load balancers that support header-based session affinity:
Cloud load balancers such as AWS ALB and Google Cloud Load Balancer do not support header-based session affinity.
Disable session state to allow horizontal scaling without session affinity, even for older protocol clients:
transport:
type: streamable_http
stateful_mode: falseIn stateless mode, each request is an independent HTTP POST with no session ID exchange. Unsolicited tool-change notifications are unavailable for older clients in this mode. Clients on 2026-07-28 or later are always sessionless regardless of this setting.
After deploying, configure: