3. The Apollo Runtime Container
3m

Overview

We've got most of our setup in place, but we're missing a crucial piece: the Apollo Runtime Container, which provides us both a instance, and the MCP server which connects our AI assistants with backend features.

In this lesson, we will:

  • Run the Apollo Runtime Container using Docker

The Apollo Runtime Container

The Apollo Runtime Container is your one-stop-shop for the and the Apollo MCP server. It's a great way to get up and running quickly, and see these two powerful components in action together. All we need to do is connect our graph and add a few to get it going!

Running the container

We'll use Docker to run the container. With Docker, we can run multiple lightweight processes that orchestrate different parts of our application, all in a single container. In our case, the Apollo Runtime Container includes both the , which will connect to our graph in Studio, and the MCP server, which will communicate with our graph and expose a port that assistants can connect to.

To bring this process to life, we need to provide our credentials, and some additional configuration flags which will give us some more insight into what's happening under the hood.

docker run

Open up a new terminal window, and let's start building our docker run command. We'll need to provide a number of environment variables, which we'll indicate by passing a --env flag.

Here's what our command will contain:

  • Our credentials: APOLLO_GRAPH_REF and APOLLO_KEY
  • An environment variable called MCP_ENABLE, which we use to turn on the MCP server in the container by passing a value of 1.
  • An environment variable called MCP_UPLINK, which enables the MCP server to communicate directly with our . (Enabled with a value of 1.)
  • We'll also specify the ports that we want the internal processes to map to on our local machine. We'll use 4000:4000 for the , and 5000:5000 for the MCP server. This will map the ports each process uses inside the container to the same port on our local machine.
  • Finally, we'll specify the particular image we want to use, which Docker can find at ghcr.io/apollographql/apollo-runtime:latest.

Running docker run

Let's build out this command! Here's what it looks like. Be sure to substitute in your own unique <APOLLO_KEY> and <APOLLO_GRAPH_REF> values.

Run the container
docker run \
--env APOLLO_GRAPH_REF=<APOLLO_GRAPH_REF> \
--env APOLLO_KEY=<APOLLO_KEY> \
--env MCP_ENABLE=1 \
--env MCP_UPLINK=1 \
--rm -p 4000:4000 -p 5000:5000 \
ghcr.io/apollographql/apollo-runtime:latest

Be sure that you paste only the values for your APOLLO_GRAPH_REF and APOLLO_KEY, without brackets.

And we should see some happy output!

Success output
INFO Starting MCP server in Streamable HTTP mode port=5000 address=0.0.0.0
INFO GraphQL endpoint exposed at http://0.0.0.0:4000 /

Note: The MCP Server included in this container is currently experimental.

Connecting our graph

Back in Studio, let's provide this address where our is running (http://localhost:4000) as our 's endpoint. This will allow us to use the Explorer directly in Studio to send queries to our local .

You can find a link to Connection Settings on the 's homepage. (If the modal from the previous lesson is still open, you can click See schema changes, then navigate to the Overview page to see the homepage.)

studio.apollographql.com

A screenshot of the Connection Settings link highlighted on the graph's homepage

Clicking this opens up a modal where we can set our endpoint (http://localhost:4000) and click Save.

studio.apollographql.com

A screenshot of the Connection Settings modal, highlighting the value we've set

Now we can jump to Explorer, which is accessible from the left-hand menu, to our directly!

Practice

What components are included in the Apollo Runtime Container?

Key takeaways

  • The Apollo Runtime Container provides us both a instance and the Apollo MCP server, which connects our AI assistants with backend features.
  • The docker run command orchestrates the processes in the Apollo Runtime Container. We used a number of environment variables to connect to our in Studio (APOLLO_GRAPH_REF and APOLLO_KEY), as well as to enable MCP to talk to our (MCP_ENABLE and MCP_UPLINK).

Up next

With our in place, we can get started! In the next lesson, we'll learn how to level up and secure the we provide to our MCP server using .


Share your questions and comments about this lesson

This course is currently in

beta
. Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.