by hannesj
Exposes GraphQL schema information to LLMs through specialized tools, enabling exploration of queries, mutations, subscriptions, types, and searchable patterns.
GraphQL Schema provides a Model Context Protocol (MCP) server that lets large language models interact with any GraphQL schema. By loading a schema file, the server offers a set of tools that list and describe query, mutation, subscription fields, object types, and searchable elements, all in SDL format.
Command‑line
# Default – looks for schema.graphqls in the current directory
npx -y mcp-graphql-schema
# Specify a schema file (relative path)
npx -y mcp-graphql-schema ../schema.shopify.2025-01.graphqls
# Specify a schema file (absolute path)
npx -y mcp-graphql-schema /absolute/path/to/schema.graphqls
Claude Desktop – add the server to claude_desktop_config.json
:
{
"mcpServers": {
"GraphQL Schema": {
"command": "npx",
"args": ["-y", "mcp-graphql-schema", "/ABSOLUTE/PATH/TO/schema.graphqls"]
}
}
}
Claude Code CLI – register the server:
claude mcp add graphql-schema npx -y mcp-graphql-schema /path/to/schema.graphqls
After registration, ask the LLM questions about the schema using the provided tools.
list-query-fields
, list-mutation-fields
, list-subscription-fields
to enumerate root operations.get-query-field
, get-mutation-field
, get-subscription-field
to retrieve SDL definitions.list-types
and get-type
for full type inspection, excluding internal GraphQL types.get-type-fields
for a simplified field list with types and arguments.search-schema
supports case‑insensitive regex pattern matching across types and fields.npx
.Q: Do I need to install anything globally?
A: No. The server runs via npx
, which downloads the package on demand.
Q: Can I run multiple schemas simultaneously? A: Yes. Register separate MCP servers with different names and schema paths.
Q: How are internal GraphQL types filtered?
A: Types prefixed with __
are omitted from listings to keep output clean.
Q: Is there a way to change the default schema file name?
A: Provide the path to any .graphqls
file as a command‑line argument.
Q: What environments are supported? A: Any platform with Node.js and npm (Windows, macOS, Linux).
A Model Context Protocol (MCP) server that exposes GraphQL schema information to Large Language Models (LLMs) like Claude. This server allows an LLM to explore and understand GraphQL schemas through a set of specialized tools.
Run the MCP server with a specific schema file:
# Use the default schema.graphqls in current directory
npx -y mcp-graphql-schema
# Use a specific schema file (relative path)
npx -y mcp-graphql-schema ../schema.shopify.2025-01.graphqls
# Use a specific schema file (absolute path)
npx -y mcp-graphql-schema /absolute/path/to/schema.graphqls
# Show help
npx -y mcp-graphql-schema --help
To install GraphQL Schema for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @hannesj/mcp-graphql-schema --client claude
To use this MCP server with Claude Desktop, edit your claude_desktop_config.json
configuration file:
{
"mcpServers": {
"GraphQL Schema": {
"command": "npx",
"args": ["-y", "mcp-graphql-schema", "/ABSOLUTE/PATH/TO/schema.graphqls"]
}
}
}
Location of the configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
$env:AppData\Claude\claude_desktop_config.json
To use this MCP server with Claude Code CLI, follow these steps:
Add the GraphQL Schema MCP server to Claude Code
# Basic syntax
claude mcp add graphql-schema npx -y mcp-graphql-schema
# Example with specific schema
claude mcp add shopify-graphql-schema npx -y mcp-graphql-schema ~/Projects/work/schema.shopify.2025-01.graphqls
Verify the MCP server is registered
# List all configured servers
claude mcp list
# Get details for your GraphQL schema server
claude mcp get graphql-schema
Remove the server if needed
claude mcp remove graphql-schema
Use the tool in Claude Code
Once configured, you can invoke the tool in your Claude Code session by asking questions about the GraphQL schema.
Tips:
-s
or --scope
flag with project
(default) or global
to specify where the configuration is storedThe server provides the following tools for LLMs to interact with GraphQL schemas:
list-query-fields
: Lists all available root-level fields for GraphQL queriesget-query-field
: Gets detailed definition for a specific query field in SDL formatlist-mutation-fields
: Lists all available root-level fields for GraphQL mutationsget-mutation-field
: Gets detailed definition for a specific mutation field in SDL formatlist-subscription-fields
: Lists all available root-level fields for GraphQL subscriptions (if present in schema)get-subscription-field
: Gets detailed definition for a specific subscription field (if present in schema)list-types
: Lists all types defined in the GraphQL schema (excluding internal types)get-type
: Gets detailed definition for a specific GraphQL type in SDL formatget-type-fields
: Gets a simplified list of fields with their types for a specific GraphQL object typesearch-schema
: Searches for types or fields in the schema by name pattern (case-insensitive regex)Example queries to try:
What query fields are available in this GraphQL schema?
Show me the details of the "user" query field.
What mutation operations can I perform in this schema?
List all types defined in this schema.
Show me the definition of the "Product" type.
List all fields of the "Order" type.
Search for types and fields related to "customer".
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "GraphQL Schema": { "command": "npx", "args": [ "-y", "mcp-graphql-schema" ], "env": {} } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.