Get Started

Run Apollo MCP Server for the first time


experimental
This feature is experimental. Your questions and feedback are highly valued—don't hesitate to get in touch with your Apollo contact or post in the Apollo Community MCP Server Category.

Let's run Apollo MCP Server for the first time! You will:

  • Understand an MCP Server example

  • Run an MCP Server example

  • Connect an MCP client (Claude Desktop) to the MCP Server

What You'll Build

In this quickstart, you'll create a working AI integration where Claude Desktop can query space-related data through GraphQL. By the end, you'll be able to:

  • Ask Claude natural questions like "Who are the astronauts currently in space?" or "What rocket launches are coming up?"

  • See Claude use MCP tools to fetch real-time data from The Space Devs API

  • Understand how GraphQL operations become AI-accessible tools

Here's what the end result looks like:

You: "Tell me about the astronauts currently in space"
Claude: [Uses GetAstronautsCurrentlyInSpace tool] "There are currently 7 astronauts aboard the International Space Station..."

This example uses a pre-built space API, but the same approach works with any GraphQL API - including your own production services.

odyssey tutorial
If you learn best with videos and exercises, this interactive course teaches you how to set up Apollo MCP Server and create tools from GraphQL operations.

Prerequisites

Step 1: Understand the Example

This guide uses an MCP example from the Apollo MCP Server repo. The example uses APIs from The Space Devs, and it defines a federated graph and the GraphQL operations of the graph to expose as MCP tools.

The example files located in graphql/TheSpaceDevs/ include:

  • A federated graph connecting to The Space Devs API

  • 4 pre-built operations that become your AI tools:

    • ExploreCelestialBodies - Search planets, moons, and stars

    • GetAstronautDetails - Get info about specific astronauts

    • GetAstronautsCurrentlyInSpace - See who's in space right now

    • SearchUpcomingLaunches - Find upcoming rocket launches

Step 2: Run the MCP Server

  1. From the root directory of your local repo, run rover dev to start a local graph with an MCP Server:

    sh
    rover dev --supergraph-config ./graphql/TheSpaceDevs/supergraph.yaml \
    --mcp \
    --mcp-operations ./graphql/TheSpaceDevs/operations/ExploreCelestialBodies.graphql ./graphql/TheSpaceDevs/operations/GetAstronautDetails.graphql ./graphql/TheSpaceDevs/operations/GetAstronautsCurrentlyInSpace.graphql ./graphql/TheSpaceDevs/operations/SearchUpcomingLaunches.graphql

    This command:

    • Starts a local graph using the supergraph configuration

    • Starts an MCP Server with the --mcp flag

    • Exposes the specified operations as MCP tools

  2. Start MCP Inspector to verify the server is running:

    sh
    1npx @modelcontextprotocol/inspector
  3. Open a browser and go to http://127.0.0.1:6274

  4. In Inspector:

    • Select Streamable HTTP as the Transport Type

    • Enter http://127.0.0.1:5000/mcp as the URL

    • Click Connect, then List Tools

    You should see the tools from your server listed.

Step 3: Connect Claude Desktop

We're using Claude as our AI Assistant (acting as our MCP Client).

First, locate your Claude configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

Then add the following configuration

  1. Open Claude's JSON config file and add this configuration:

    JSON
    1{
    2  "mcpServers": {
    3    "thespacedevs": {
    4        "command": "npx",
    5        "args": [
    6            "mcp-remote",
    7            "http://127.0.0.1:5000/mcp"
    8        ]
    9    }
    10  }
    11}
note
You need Node v18 or later installed for mcp-remote to work. If you have an older version of Node, uninstall it and install the latest version from nodejs.org.
  1. Restart Claude.

Step 4: Test Your Setup

Let's verify everything is working:

  1. In Claude Desktop, type: "What MCP tools do you have available?"

    • Claude should list tools like ExploreCelestialBodies, GetAstronautDetails, etc.

  2. Try a real query: "Who are the astronauts currently in space?"

    • Claude should use the GetAstronautsCurrentlyInSpace tool and return current data

  3. If Claude can't see the tools:

    • Ensure you restarted Claude Desktop after editing the config

    • Check that your MCP server is still running

    • Verify the port numbers match between your server and Claude config

Troubleshooting

Common Issues

MCP Server Won't Start

  • Error: "Port 5000 is already in use"

    • Solution: Kill any existing processes using port 5000 or specify a different port with --mcp-sse-port flag using Rover Dev or --sse-port when running the MCP server directly

  • Error: "Failed to load supergraph configuration"

    • Solution: Verify you're running the command from the repo root directory

    • Solution: Check that the path to supergraph.yaml is correct

MCP Inspector Connection Issues

  • Error: "Failed to connect to server"

    • Solution: Ensure the MCP server is running (check terminal output)

    • Solution: Verify you're using the correct URL (http://127.0.0.1:5000/mcp)

    • Solution: Check if your firewall is blocking the connection

Claude Desktop Issues

  • Problem: Claude doesn't recognize the tools

    • Solution: Verify the config file path is correct for your OS

    • Solution: Ensure the JSON is properly formatted (no trailing commas)

    • Solution: Try restarting Claude Desktop completely

  • Problem: "Connection refused" errors

    • Solution: Check if the MCP server is still running

    • Solution: Verify the port numbers match in both the server and Claude config

  • Problem: "MCP thespacedevs: Server disconnected" errors

    • Solution: Uninstall older versions of Node. mcp-remote only works with Node v18 or later.

    • Solution: Restart Claude Desktop

GraphQL Operation Issues

  • Error: "Operation not found"

    • Solution: Verify the operation files exist in the specified path

    • Solution: Check that the operation names match exactly

  • Error: "Schema validation failed"

    • Solution: Ensure your GraphQL operations match the schema

    • Solution: Check for syntax errors in your operation files

Getting Help

If you're still having issues:

  1. Check the Apollo MCP Server GitHub issues

  2. Join the Apollo Community MCP Server Category

  3. Contact your Apollo representative for direct support

Next Steps

See the user guide to learn how to create tools from:

Additional Resources

Check out these blog posts to learn more about Apollo MCP Server:

Advanced Options

Alternative ways to run the MCP Server

Using STDIO Transport

You can run the MCP Server using STDIO transport instead of Streamable HTTP. This is useful for certain environments or when you need more direct control over the server process.
  1. Download the binary of the latest version of Apollo MCP Server
  2. Use MCP Inspector to run the server:
    sh
    1npx @modelcontextprotocol/inspector apollo-mcp-server \
    2--directory <absolute-path-to-MCP-example-dir> \
    3--schema api.graphql \
    4--operations operations \
    5--endpoint https://thespacedevs-production.up.railway.app/
  3. Configure Claude Desktop to use STDIO:
    JSON
    1{
    2  "mcpServers": {
    3    "thespacedevs": {
    4      "command": "<absolute-path-to-MCP-server-binary>",
    5      "args": [
    6        "--directory",
    7        "<absolute-path-to-MCP-example-directory>",
    8        "--schema",
    9        "api.graphql",
    10        "--operations",
    11        "operations",
    12        "--endpoint",
    13        "https://thespacedevs-production.up.railway.app/"
    14      ]
    15    }
    16  }
    17}
Feedback

Edit on GitHub

Ask Community