A Model Context Protocol (MCP) server that lets LLMs introspect and query any GraphQL endpoint, optionally with mutations.
https://github.com/blurrah/mcp-graphqlStop writing custom GraphQL tooling for every API your LLM needs to query. The mcp-graphql server lets your AI agents automatically discover, understand, and interact with any GraphQL endpoint – without you having to explain the schema or write wrapper functions.
You know the drill. Your AI agent needs to query a GraphQL API, so you either:
Every new API means more boilerplate. Every schema change breaks your carefully crafted prompts.
mcp-graphql flips this around. Point it at any GraphQL endpoint and your LLM gets two powerful capabilities:
The LLM learns your API's schema in real-time and crafts queries that actually match your data structure.
Rapid API Integration: Connect to new GraphQL APIs in seconds, not hours. No schema documentation required.
Schema Evolution Resilience: When your API changes, your AI adapts automatically. No broken tools to fix.
Zero Query Limits: Your LLM can construct any valid query combination, not just the ones you anticipated.
Built-in Security: Mutations are disabled by default, so your AI can't accidentally modify data unless you explicitly allow it.
API Exploration: "What data is available in this GraphQL endpoint?" Your AI introspects the schema and gives you a complete breakdown.
Data Analysis: "Show me all users who signed up last month and their order totals." The AI crafts the necessary nested query with filters.
Cross-API Workflows: Connect multiple GraphQL services in a single conversation. Your AI handles the different schemas seamlessly.
Dynamic Reporting: "Generate a report combining user data from our main API and analytics from our tracking service." No manual query writing needed.
# Basic usage
ENDPOINT=https://api.example.com/graphql npx mcp-graphql
# With authentication
ENDPOINT=https://api.example.com/graphql \
HEADERS='{"Authorization":"Bearer your-token"}' \
npx mcp-graphql
# Enable mutations (use carefully)
ENDPOINT=https://api.example.com/graphql \
ALLOW_MUTATIONS=true \
npx mcp-graphql
Add to your Claude Desktop config:
{
"mcpServers": {
"graphql": {
"command": "npx",
"args": ["mcp-graphql"],
"env": {
"ENDPOINT": "https://your-graphql-api.com/graphql",
"HEADERS": "{\"Authorization\":\"Bearer your-token\"}"
}
}
}
}
The server exposes the GraphQL schema as a resource, so your LLM always has the latest API structure. No version mismatches, no stale documentation.
GraphQL's type system is perfect for AI agents – it's self-documenting and predictable. But the barrier to entry has been the manual work of connecting each API. mcp-graphql removes that friction entirely.
Your AI gets the full power of GraphQL's query language without you having to write a single line of API-specific code. That's the difference between spending days on integration and getting answers in minutes.
Ready to give your AI agents native GraphQL capabilities? The server is MIT licensed and ready to run: npx mcp-graphql