Bridges any GraphQL API to Claude Code β auto-generates MCP tools via schema introspection.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A generic MCP (Model Context Protocol) server that bridges any GraphQL API to Claude Code. It introspects your GraphQL schema and exposes each query and mutation as an individual tool, letting Claude interact with your API directly.
On startup the server will:
schema-introspection.json file in the working directory (fast, no network call)GRAPHQL_INTROSPECTION_URLquery__<name>) and one per mutation (mutation__<name>)execute_graphql fallback tool and a get_type_details explorer tool| Variable | Required | Description |
|---|---|---|
GRAPHQL_API_URL | No | Endpoint used for queries and mutations. Defaults to a public demo API (countries.trevorblades.com) if unset β replace with your own for real use. |
GRAPHQL_INTROSPECTION_URL | No | Endpoint used for schema introspection. Defaults to GRAPHQL_API_URL if unset. |
GRAPHQL_TOKEN | No | Bearer token for GraphQL authentication (used for query/mutation execution). Omit for public APIs. |
GRAPHQL_INTROSPECTION_TOKEN | No | Bearer token for schema introspection, if it requires different credentials than execution (e.g. a separate schema registry). Defaults to GRAPHQL_TOKEN if unset. |
MCP_AUTH_TOKEN | No | Bearer token required by the hosted /mcp HTTP endpoint when MCP_TRANSPORT=http |
GRAPHQL_MAX_TOOLS | No | Maximum number of query/mutation tools to register. Queries are prioritized over mutations when truncating. Default 128. |
GRAPHQL_INCLUDE_MUTATIONS | No | Set to false to exclude every mutation field entirely, for a read-only deployment. Default true. |
GRAPHQL_MAX_RETRIES | No | Retries (0β5) for 429/502/503/504 responses, honoring Retry-After when present. Default 0 (disabled). |
For schemas with hundreds of fields (GitHub's GraphQL API has 284 root fields β 32 queries, 252
mutations), GRAPHQL_MAX_TOOLS and GRAPHQL_INCLUDE_MUTATIONS are what keep registration bounded
and predictable. If the cap truncates the schema, stderr logs exactly how many queries/mutations
were registered vs. available.
No configuration is required to try the server β with nothing set, it starts
against the public demo API above and logs that it's doing so. See
docs/architecture.md for the full token model and
why the GraphQL endpoint is fixed per deployment rather than a per-request
parameter.
You can set these in a .env file at the project root:
Or pass them directly via the claude mcp add command (see below).
By default the server introspects your schema live on startup β no file needed, and it automatically retries at a shallower query depth if your API rejects the full-depth attempt (some APIs, especially CDN-fronted ones, enforce a query depth limit). Use this step only if your API has introspection disabled entirely in production, or you want faster startup times:
If your API rejects this with a depth/complexity-limit error, shrink the ofType { ... } nesting
(each level resolves one more NonNull/List wrapper β most real-world types need 2-3 levels;
only doubly-wrapped lists like [[Int!]!]! need more).
If installed from npm:
If cloned from source:
Important: Make sure to use
mcp-graphql-bridge/dist/index.js(the compiled output), notmcp-graphql-bridge/index.js. The TypeScript source must be built first withnpm run build, and the entry point is in thedist/folder.
.mcp.json)Note: Use absolute paths. All
--envand--transportflags must come before the server name.
Then in a Claude Code session, run /mcp to see available servers and tools.
Two worked walkthroughs β a small public schema with no configuration needed, then a large, real enterprise-scale schema requiring auth and tool-count limits.
This is the zero-config default β nothing to install or configure beyond the server itself.
Add the server with no environment variables at all:
Restart Claude Code (or run /mcp to confirm graphql-countries is connected). You should see
tools like query__country, query__countries, and query__continents.
Ask Claude:
Using graphql-countries, find the country with code "BR", then list its continent's other countries.
Claude calls query__country({ code: "BR", __fields: "{ name continent { code name } }" }),
then query__continent or query__countries({ __fields: "{ name }" }) filtered by the result.
Try an invalid code to see error passthrough:
Look up the country with code "ZZZ".
Returns the GraphQL API's own error text β the bridge passes it through rather than masking it.
GitHub's GraphQL API has 284 root fields (32 queries, 252 mutations) β far more than the
GRAPHQL_MAX_TOOLS default of 128, and it needs a token for every request, including
introspection (unlike GitHub's REST API, which allows some anonymous reads).
Add the server, scoped to read-only access:
GRAPHQL_INCLUDE_MUTATIONS=false registers all 32 (read-only) queries and zero mutations β
comfortably under the cap, and a meaningfully safer default for an AI agent than exposing all
252 write operations.
Ask Claude:
Using graphql-github, look up the repository facebook/react and tell me its star count.
Claude calls
query__repository({ owner: "facebook", name: "react", __fields: "{ name stargazerCount }" }).
To also reach mutations, drop GRAPHQL_INCLUDE_MUTATIONS=false and raise the cap
(GRAPHQL_MAX_TOOLS=400), understanding that this exposes write access to your GitHub account
scoped to whatever permissions your token has.
| Tool | Description |
|---|---|
query__<name> | One tool per GraphQL query field |
mutation__<name> | One tool per GraphQL mutation field |
execute_graphql | Generic fallback β run any query or mutation (mutations rejected if GRAPHQL_INCLUDE_MUTATIONS=false) |
get_type_details | Explore fields of a specific GraphQL type |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-graphql-bridge)<a href="https://allmcps.com/mcp/mcp-graphql-bridge"><img src="https://allmcps.com/api/badge/mcp-graphql-bridge?style=directory" alt="MCP Graphql Bridge on AllMCPs" /></a>