Apollo MCP Server Quickstart

Create and run an MCP server in minutes with Apollo


Apollo MCP Server is a Model Context Protocol server that exposes your GraphQL API operations as MCP tools.

This guide walks you through the process of creating, running and configuring an MCP server with Apollo.

Prerequisites

Step 1: Create an MCP server

Run the interactive initialization command:

Bash
rover init --mcp

The CLI wizard guides you through several prompts.

Select Create MCP tools from a new Apollo GraphOS project and Apollo graph with Connectors (connect to REST services) as your starting point.

You'll also need to select your organization and give your project a name and ID.

The wizard shows all files that will be created, including:

  • MCP server configuration files

  • GraphQL schema and operations

  • Docker setup for (optional) deployment

Type Y to confirm and create your project files.

Step 2: Run your MCP Server

You can start your MCP server locally with rover dev.

  1. Choose the environment-specific command to load environment variables from the provided .env file and start the MCP server.

    terminal
    set -a && source .env && set +a && rover dev --supergraph-config supergraph.yaml --mcp .apollo/mcp.local.yaml
  2. You should see some output indicating that the GraphQL server is running at http://localhost:4000 and the MCP server is running at http://127.0.0.1:8000.

  3. In a new terminal window, run the MCP Inspector to verify the server is running:

    terminal
    npx @modelcontextprotocol/inspector http://127.0.0.1:8000/mcp --transport http
  4. This will automatically open your browser to http://127.0.0.1:6274.

  5. Click Connect, then List Tools to see the available tools.

Step 3: Connect to an MCP client

Apollo MCP Server works with any MCP-compatible client. Choose your favorite client and follow the instructions to connect.

Claude Desktop (recommended)
Open the claude_desktop_config.json file in one of the following paths:
  • Mac OS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
Copy the configuration:
JSON
1{
2  "mcpServers": {
3    "mcp-My API": {
4      "command": "npx",
5      "args": [
6        "mcp-remote",
7        "http://127.0.0.1:8000/mcp"
8      ]
9    }
10  }
11}
Claude Code
Install using the CLI:
Bash
1claude mcp add apollo-mcp npx mcp-remote http://127.0.0.1:8000/mcp
Cursor
Click the button to quick install:Install Apollo MCP Server to CursorOr install manually:
  1. Go to Cursor SettingsMCPAdd new MCP Server
  2. Name: Apollo MCP (choose a title)
  3. Command: npx
  4. Arguments: ["mcp-remote", "http://127.0.0.1:8000/mcp"]
Goose
Add Apollo MCP Server to your Goose configuration. Edit your ~/.config/goose/profiles.yaml:
YAML
1default:
2  provider: openai
3  processor: gpt-4
4  accelerator: gpt-4o-mini
5  moderator: passive
6  toolkits:
7    - name: developer
8    - name: mcp
9      requires:
10        apollo-mcp:
11          command: npx
12          args:
13            - mcp-remote
14            - http://127.0.0.1:8000/mcp
Or use the Goose CLI to add the MCP server:
Bash
1goose mcp add apollo-mcp npx mcp-remote http://127.0.0.1:8000/mcp
Cline (VS Code Extension)
  1. Go to Advanced settingsExtensionsAdd custom extension
  2. Name: Apollo MCP
  3. Type: STDIO
  4. Command: npx mcp-remote http://127.0.0.1:8000/mcp
OpenCode
Edit ~/.config/opencode/opencode.json:
JSON
1{
2  "$schema": "https://opencode.ai/config.json",
3  "mcp": {
4    "apollo-mcp": {
5      "type": "local", 
6      "command": [
7        "npx",
8        "mcp-remote",
9        "http://127.0.0.1:8000/mcp"
10      ],
11      "enabled": true
12    }
13  }
14}
Windsurf
  1. Go to Windsurf Settings → MCP → Add new MCP Server
  2. Name: Apollo MCP
  3. Command: npx
  4. Arguments: ["mcp-remote", "http://127.0.0.1:8000/mcp"]
Alternatively, edit your Windsurf configuration file directly:
JSON
1{
2  "mcpServers": {
3    "apollo-mcp": {
4      "command": "npx",
5      "args": [
6        "mcp-remote",
7        "http://127.0.0.1:8000/mcp"
8      ]
9    }
10  }
11}
  1. Restart your MCP client.

  2. Test the connection by asking: "What MCP tools do you have available?".

  3. Verify GraphQL operations are listed as available tools.

  4. Test a query using one of your configured operations.

Step 4: Define MCP tools

MCP tools are defined as GraphQL operations. The project template currently uses operation collections as the source of its tools.

note
See Define MCP Tools for other ways to define MCP tools.
  1. Navigate to Sandbox at http://localhost:4000.

  2. Click the Bookmark icon to open Operation Collections.

  3. Click Sandbox beside "Showing saved operations for your Sandbox, across all endpoints" and select your graph. This represents the graph name and ID you used when creating your project.

  4. You'll see an operation collection called "Default MCP Tools".

  5. Create a new operation in the middle panel:

    GraphQL
    1# Retrieves product information
    2query GetProducts {
    3  products {
    4    id
    5    name
    6    description
    7  }
    8}
  6. Click the Save button and give it the name GetProducts.

  7. Select the Default MCP Tools collection and click Save.

  8. Restart your MCP client and test the connection by asking: "What MCP tools do you have available?". You should see the GetProducts tool listed. You can also test this with MCP Inspector.

Step 5: Deploy your MCP server

Apollo MCP Server can run in any container environment.

Using the Apollo Runtime Container

Your project includes a pre-configured mcp.Dockerfile for easy deployment. This container includes:

  • Apollo Router for serving your GraphQL API

  • Apollo MCP Server for MCP protocol support

  • All necessary dependencies

  1. Build the container:

    Bash
    1docker build -f mcp.Dockerfile -t my-mcp-server .
  2. Run locally:

    Bash
    1docker run -p 4000:4000 -p 8000:8000 \
    2  -e APOLLO_KEY=$APOLLO_KEY \
    3  -e APOLLO_GRAPH_REF=$APOLLO_GRAPH_REF \
    4  -e MCP_ENABLE=1 \
    5  my-mcp-server
  3. Deploy to your platform. The container can be deployed to any platform supporting Docker, such as: AWS ECS/Fargate, Google Cloud Run, Azure Container Instances, Kubernetes, Fly.io, Railway, Render.

  4. Ensure these variables are set in your deployment environment:

VariableDescriptionRequired
APOLLO_KEYYour graph's API keyYes
APOLLO_GRAPH_REFYour graph referenceYes
APOLLO_MCP_TRANSPORT__PORTMCP server port (default: 8000)No
APOLLO_ROUTER_PORTRouter port (default: 4000)No

For more deployment options, see the Deploy the MCP Server page.

Update client configuration

After deploying, update your MCP client configuration to use the deployed URL:

JSON
1{
2  "mcpServers": {
3    "my-api": {
4      "command": "npx",
5      "args": [
6        "mcp-remote",
7        "https://your-deployed-server.com/mcp"
8      ]
9    }
10  }
11}

Troubleshooting

Client doesn't see tools:

  • Ensure you restarted your MCP client after configuration

  • Verify the Apollo MCP Server is running (rover dev command)

  • Check port numbers match between server and client config

Connection refused errors:

  • Confirm the server is running on the correct port

  • Verify firewall settings allow connections to localhost:8000

  • For remote connections, ensure the host is set to 0.0.0.0 in your config

Authentication issues:

  • Verify environment variables are properly set

  • Check that your GraphQL endpoint accepts the provided headers

  • When using rover dev you can test your GraphQL endpoint using Sandbox at http://localhost:4000

Additional resources

Getting help

If you're still having issues:

Feedback

Edit on GitHub

Ask Community