Loading...
Loading...
Guide for using Apollo MCP Server to connect AI agents with GraphQL APIs. Use this skill when: (1) setting up or configuring Apollo MCP Server, (2) defining MCP tools from GraphQL operations, (3) using introspection tools (introspect, search, validate, execute), (4) troubleshooting MCP server connectivity or tool execution issues.
npx skill4agent add apollographql/skills apollo-mcp-server# Using npm
npm install -g @apollo/mcp-server
# Or run directly with npx
npx @apollo/mcp-servermcp.yaml# mcp.yaml
endpoint: https://api.example.com/graphql
schema:
type: local
path: ./schema.graphql
operations:
type: local
paths:
- ./operations/**/*.graphql
introspection:
enabled: trueclaude_desktop_config.json{
"mcpServers": {
"graphql-api": {
"command": "npx",
"args": ["@apollo/mcp-server", "--config", "./mcp.yaml"]
}
}
}.mcp.json{
"mcpServers": {
"graphql-api": {
"command": "npx",
"args": ["@apollo/mcp-server", "--config", "./mcp.yaml"]
}
}
}| Tool | Purpose | When to Use |
|---|---|---|
| Explore schema types in detail | Need type definitions, fields, relationships |
| Find types in schema | Looking for specific types or fields |
| Check operation validity | Before executing operations |
| Run ad-hoc GraphQL operations | Testing or one-off queries |
operations:
type: local
paths:
- ./operations/**/*.graphql# operations/users.graphql
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
}
}
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
}
}operations:
type: collection
id: your-collection-idoperations:
type: manifest
path: ./persisted-query-manifest.jsonheadersintrospection.enabled: falseintrospection.mutationMode: prompt# Static header
headers:
Authorization: "Bearer ${APOLLO_API_KEY}"
# Dynamic header passthrough
headers:
X-User-Token:
from: x-forwarded-tokenintrospection:
minify: trueintrospection:
mutationMode: allowed # Execute directly
mutationMode: prompt # Require confirmation (default)
mutationMode: disabled # Block all mutationsschema:
type: uplink
graphos:
key: ${APOLLO_KEY}
graph_ref: my-graph@productionendpoint: http://localhost:4000/graphql
schema:
type: local
path: ./schema.graphql
introspection:
enabled: true
mutationMode: allowedendpoint: https://api.production.com/graphql
schema:
type: uplink
operations:
type: manifest
path: ./persisted-query-manifest.json
introspection:
enabled: falsemutationMode: prompt