Deploy the MCP Server
You can deploy and operate the MCP server by:
Using the MCP server container or binary, which connects to an existing GraphQL API endpoint
Using the Apollo Runtime container, which includes both an MCP server as well as the Apollo router
Deploy the MCP Server container
Apollo MCP Server is available as a standalone docker container. Container images are downloadable using
the image ghcr.io/apollographql/apollo-mcp-server.
By default, the container expects all schema and operation files to be present in the /data folder within the container
and that clients will use the Streamable HTTP transport on container port 5000.
An example docker run command that runs the MCP Server for the space dev example:
1endpoint: https://thespacedevs-production.up.railway.app/
2operations:
3 source: local
4 paths:
5 - /data/operations/
6schema:
7 source: local
8 path: /data/api.graphqldocker run \
-it --rm \
--name apollo-mcp-server \
-p 5000:5000 \
-v <path to the preceding config>:/config.yaml \
-v $PWD/graphql/TheSpaceDevs:/data \
ghcr.io/apollographql/apollo-mcp-server:latest /config.yamlDeploy the MCP Server using the Apollo Runtime container
The Apollo Runtime container includes all services necessary to serve GraphQL and MCP requests, including the Router and MCP Server. It is the easiest way to operate a GraphQL API with MCP support.
To serve both MCP and GraphQL requests, both port 4000 and 5000 will need to be exposed. An example command which retrieves the schema from Uplink is:
1docker run \
2 -p 4000:4000 \
3 -p 5000:5000 \
4 --env APOLLO_GRAPH_REF="<your-graph-ref>" \
5 --env APOLLO_KEY="<your-graph-api-key>" \
6 --env MCP_ENABLE=1 \
7 --rm \
8 ghcr.io/apollographql/apollo-runtime:latestTo learn more, review the Apollo Runtime container documentation.