Apollo MCP Server is a Model Context Protocol server that exposes GraphQL operations as MCP tools. It provides a standard way for AI models to access and orchestrate your APIs running with Apollo, creating a bridge between your GraphQL services and AI models.
The easiest way to get started with Apollo MCP Server is to follow the installation guide at apollographql.com/docs/apollo-mcp-server/run.
If you have Rust installed, you can build the server from source:
# Clone the repository
git clone https://github.com/apollographql/apollo-mcp-server.git
cd apollo-mcp-server
# Build the server
cargo build
# The binary will be available in the target/debug directory
To use Apollo MCP Server, you need to configure the following essential components:
Create a configuration file (e.g., mcp-config.yaml) with your settings:
server:
port: 8080
host: 127.0.0.1
graph:
endpoint: https://your-graphql-api-endpoint.com/graphql
operations:
- name: getProductDetails
description: "Retrieve details for a specific product by ID"
query: |
query GetProduct($id: ID!) {
product(id: $id) {
id
name
price
description
}
}
Start the MCP server with your configuration file:
apollo-mcp-server --config mcp-config.yaml
Once your server is running, you can connect it to an MCP client like the MCP Inspector:
http://localhost:8080 (or whatever host/port you configured)You can test your GraphQL operations through the MCP protocol:
{
"action": "useTools",
"inputs": [
{
"toolName": "getProductDetails",
"parameters": {
"id": "prod-123"
}
}
]
}
For a complete list of configuration options, refer to the config file reference at apollographql.com/docs/apollo-mcp-server/config-file.
You can expose multiple GraphQL operations as MCP tools:
operations:
- name: getProductDetails
description: "Retrieve details for a specific product by ID"
query: |
query GetProduct($id: ID!) {
product(id: $id) {
id
name
price
}
}
- name: createOrder
description: "Create a new order with specified products"
query: |
mutation CreateOrder($products: [OrderItemInput!]!) {
createOrder(items: $products) {
orderId
total
}
}
For complete documentation and tutorials, visit apollographql.com/docs/apollo-mcp-server/.
To follow a step-by-step quickstart guide, see apollographql.com/docs/apollo-mcp-server/quickstart.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "apollo-mcp-server" '{"command":"npx","args":["-y","apollo-mcp-server"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"apollo-mcp-server": {
"command": "npx",
"args": [
"-y",
"apollo-mcp-server"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"apollo-mcp-server": {
"command": "npx",
"args": [
"-y",
"apollo-mcp-server"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect