GraphQL MCP
A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
What is GraphQL MCP?
GraphQL MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that enables llms to interact with graphql apis by providing schema introspection and query execution capabilities.
A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
This server falls under the APIs category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol server that enables LLMs to interac
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-graphqlConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use GraphQL MCP
mcp-graphql is a lightweight MCP server that exposes two tools — schema introspection and query execution — allowing LLMs like Claude to explore and query any GraphQL API without custom integration code. It connects to any GraphQL endpoint via the ENDPOINT environment variable, supports custom HTTP headers for authentication, can load schemas from local files or remote URLs, and optionally enables mutations when ALLOW_MUTATIONS is set. Developers use it to let Claude browse an API's type system and run queries against live or staging GraphQL backends, making API exploration and data retrieval conversational.
Prerequisites
- Node.js 18+ installed
- A running GraphQL API endpoint (local or remote)
- Claude Desktop, Claude Code, or another MCP-compatible client
- An authentication token or headers if your GraphQL endpoint requires auth
Install via Smithery (easiest)
The quickest way to install and configure mcp-graphql for Claude is via the Smithery CLI, which handles the claude_desktop_config.json update automatically.
npx -y @smithery/cli install mcp-graphql --client claudeOr configure manually in claude_desktop_config.json
Add the mcp-graphql server to your Claude Desktop config, setting the ENDPOINT environment variable to your GraphQL API URL. The server runs directly via npx with no install step.
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": ["mcp-graphql"],
"env": {
"ENDPOINT": "http://localhost:4000/graphql"
}
}
}
}Add authentication headers if needed
Pass a JSON string of HTTP headers in the HEADERS environment variable. This supports Bearer tokens, API keys, or any custom header your GraphQL endpoint requires.
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": ["mcp-graphql"],
"env": {
"ENDPOINT": "https://api.example.com/graphql",
"HEADERS": "{\"Authorization\": \"Bearer your-token-here\"}"
}
}
}
}Enable mutations if needed
By default, mcp-graphql blocks mutation execution for safety. Set ALLOW_MUTATIONS=true in the env block to permit write operations through Claude.
"env": {
"ENDPOINT": "http://localhost:4000/graphql",
"ALLOW_MUTATIONS": "true"
}Restart Claude Desktop and verify
Restart Claude Desktop to load the new server. Ask Claude to introspect the schema — it should describe your API's types, queries, and mutations using the introspect-schema tool.
GraphQL MCP Examples
Client configuration
Complete Claude Desktop configuration for a GraphQL API with Bearer token authentication. Mutations are disabled by default.
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": ["mcp-graphql"],
"env": {
"ENDPOINT": "https://api.example.com/graphql",
"HEADERS": "{\"Authorization\": \"Bearer your-token-here\"}",
"ALLOW_MUTATIONS": "false"
}
}
}
}Prompts to try
These prompts show how to explore and query a GraphQL API through Claude using the introspect-schema and query-graphql tools.
- "Introspect the GraphQL schema and describe all available queries and their arguments"
- "Query the API for the first 10 users with their names and email addresses"
- "What types does this GraphQL API expose? Show me the fields on the Product type"
- "Run a query to find all orders with status PENDING and return the order ID and total amount"
- "Show me the mutations available in this schema and explain what each one does"
- "Query for a user with ID 42 and return all their associated posts"Troubleshooting GraphQL MCP
introspect-schema fails with 'introspection disabled'
Some production GraphQL APIs disable introspection for security. Use the SCHEMA environment variable to point at a local schema file or a schema URL that is introspection-enabled: set SCHEMA=/path/to/schema.graphql or SCHEMA=https://example.com/schema.graphql.
Queries fail with 401 Unauthorized
Ensure the HEADERS environment variable is valid JSON with the correct auth header. Test the endpoint directly with curl to confirm your token works: `curl -H 'Authorization: Bearer your-token' -X POST -d '{"query":"{__typename}"}' https://api.example.com/graphql`.
Mutations are blocked even with ALLOW_MUTATIONS set
Confirm ALLOW_MUTATIONS is set to the string 'true' (not a boolean). Environment variables in MCP config are always strings. Restart Claude Desktop after changing the configuration.
Frequently Asked Questions about GraphQL MCP
What is GraphQL MCP?
GraphQL MCP is a Model Context Protocol (MCP) server that model context protocol server that enables llms to interact with graphql apis by providing schema introspection and query execution capabilities. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install GraphQL MCP?
Follow the installation instructions on the GraphQL MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with GraphQL MCP?
GraphQL MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is GraphQL MCP free to use?
Yes, GraphQL MCP is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
GraphQL MCP Alternatives — Similar APIs Servers
Looking for alternatives to GraphQL MCP? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
★ 43.4k🦍 The API and AI Gateway
API Mega List
★ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHub—period. 💪
Fetch
★ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
★ 2.1kSelf-Hosted API Management for Builders
Korean Law
★ 1.8k국가법령정보MCP v4.0 | 법제처 41개 API → 17개 MCP 도구. 법령·판례·조례 검색 + LLM 환각 방지 인용검증 + 조문 영향 그래프(impact_map) + 시점 비교 자동 diff(time_travel) + 시민 5단계 실행 가이드(action_plan) | 41 Korean legal APIs → 17 MCP tools
RuleGo
★ 1.5k⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up GraphQL MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use GraphQL MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.