Apollo GraphQL MCP Server
Expose GraphQL operations as MCP tools so AI models can discover, query, and orchestrate APIs that sit behind an Apollo GraphOS or any GraphQL endpoint.
Apollo MCP Server is the official Model Context Protocol implementation from Apollo GraphQL. It bridges AI applications and GraphQL APIs by translating GraphQL operations into MCP tools that AI models can discover and call. Tools can be sourced from persisted queries stored in Apollo GraphOS, local operation files (.graphql), or generated dynamically from schema introspection. The server is written in Rust and is published as both source and pre-built binaries.
Beyond exposing user-defined operations, the server includes optional built-in introspection tools (execute, introspect, search, validate) that let an LLM explore a schema, validate queries, and run ad-hoc operations against the configured GraphQL endpoint. It supports stdio, streamable_http, and sse transports, header forwarding for auth pass-through, hot-reload of the YAML config file, OTLP telemetry, and CORS, making it suitable for both local development and containerized cloud deployment.
The project is maintained by Apollo, MIT licensed, and integrates with the Rover CLI (rover dev --mcp) for a one-command local workflow alongside an Apollo Router supergraph. It is notable as one of the few first-party, vendor-backed ways to plug an existing GraphQL API into Claude Desktop, ChatGPT, or any MCP client without writing per-endpoint glue code.
Tools
| Tool | Description |
|---|---|
execute |
Built-in introspection tool that runs an arbitrary GraphQL query or mutation against the configured endpoint. |
introspect |
Built-in tool that returns full schema information for the connected GraphQL API. |
search |
Built-in tool that searches the schema for matching types, fields, or arguments. |
validate |
Built-in tool that validates a GraphQL operation against the schema before execution. |
User-defined operation tools |
Each GraphQL operation loaded from persisted queries, operation files, or GraphOS Operation Collections is exposed as its own MCP tool, named after the operation. |
Prerequisites
- An existing GraphQL API (or an Apollo GraphOS supergraph)
- Rover CLI v0.37+ authenticated against GraphOS (for the guided flow)
- Node.js v18+ if you plan to bridge to Claude Desktop via
mcp-remote APOLLO_KEYandAPOLLO_GRAPH_REFif loading persisted queries from GraphOS
Install
Pre-built binaries are available from the Apollo docs install page. To build from source:
git clone https://github.com/apollographql/apollo-mcp-server
cd apollo-mcp-server
cargo build --release
Or scaffold a full project with Rover:
rover init --mcp
Run locally
rover dev --supergraph-config supergraph.yaml --mcp .apollo/mcp.local.yaml
The GraphQL endpoint serves on http://localhost:4000 and the MCP endpoint on http://127.0.0.1:8000/mcp.
Claude Desktop config
apollo-mcp-server exposes an HTTP transport, so connect via mcp-remote:
{
"mcpServers": {
"apollo": {
"command": "npx",
"args": [
"mcp-remote",
"http://127.0.0.1:8000/mcp"
]
}
}
}
Example YAML config
endpoint: http://localhost:4000/
transport: streamable_http
introspection:
execute:
enabled: true
introspect:
enabled: true
search:
enabled: true
validate:
enabled: true
graphos:
apollo_key: ${APOLLO_KEY}
apollo_graph_ref: ${APOLLO_GRAPH_REF}
forward_headers:
- authorization
Docker
docker run -p 4000:4000 -p 8000:8000 \
-e APOLLO_KEY=$APOLLO_KEY \
-e APOLLO_GRAPH_REF=$APOLLO_GRAPH_REF \
my-mcp-server
- Let an AI agent call your production GraphQL API through a curated set of persisted queries instead of writing per-endpoint tool code.
- Give Claude or ChatGPT safe, schema-aware exploration of a GraphQL API using the built-in
introspect,search, andvalidatetools before issuing real queries. - Front an Apollo GraphOS supergraph (multiple subgraphs federated together) with a single MCP surface so an agent can orchestrate cross-service workflows in one call.
- Run locally during development via
rover dev --mcpto test how an LLM consumes new GraphQL operations before shipping them. - Deploy as a container behind auth and use
forward_headersto pass through user JWTs, so per-user authorization is enforced by the underlying GraphQL API.
- "List the MCP tools you have, then call
GetProductsand summarize the catalog." - "Use the
searchtool to find any schema fields related to orders, then write andvalidatea query that returns last week's orders." - "Introspect the schema and tell me which mutations are available for updating a user profile."
- "Run the
GetCustomerByIdoperation for customer 42 and theGetRecentInvoicesoperation, then reconcile any mismatched totals." - "Execute a GraphQL query that returns all products under $20 and group the result by category."
- Official, first-party server maintained by Apollo, with active development and docs.
- Works with any GraphQL endpoint, not just Apollo GraphOS, and supports stdio, streamable HTTP, and SSE transports.
- Persisted queries plus header forwarding give a clean security model: AI agents only call pre-approved operations under the user's auth.
- Built-in introspection tools (
execute,introspect,search,validate) let agents explore a schema without custom code.
- Requires a GraphQL API; not useful for REST-only stacks without an Apollo Connectors layer in front.
- Configuration is YAML-driven and assumes some familiarity with Apollo Router, GraphOS, and Rover for the smoothest setup.
- No native stdio binary auto-install via npm or pip; you either build from Rust source or pull a pre-built binary.
- graphql-mcp-server (community, generic GraphQL endpoint to MCP bridge)
- Hasura's MCP integrations for exposing Postgres/GraphQL as agent tools
- Writing a custom MCP server with the official TypeScript or Python SDKs that wraps your GraphQL client directly