GraphQL MCP

v1.0.0APIsstable

A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.

aillmmcpmcp-servermodelcontextprotocol
Share:
387
Stars
0
Downloads
0
Weekly
0/5

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

GraphQL API integration
Schema introspection
Query execution via MCP
blurrah

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-graphql

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 claude
2

Or 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"
      }
    }
  }
}
3

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\"}"
      }
    }
  }
}
4

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"
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-graphql": { "command": "npx", "args": ["-y", "mcp-graphql"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides