mcp-graphql-schema
by hannesj
GraphQL Schema Model Context Protocol Server
What is mcp-graphql-schema
GraphQL Schema Model Context Protocol Server
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.
Features
- Load any GraphQL schema file specified via command line argument
- Explore query, mutation, and subscription fields
- Look up detailed type definitions
- Search for types and fields using pattern matching
- Get simplified field information including types and arguments
- Filter out internal GraphQL types for cleaner results
Usage
Command Line
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
Claude Desktop Integration
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:
- macOS/Linux:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
$env:AppData\Claude\claude_desktop_config.json
Claude Code Integration
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:
- Use the
-s
or--scope
flag withproject
(default) orglobal
to specify where the configuration is stored - Add multiple MCP servers for different schemas with different names (e.g., main API schema, Shopify schema)
MCP Tools
The 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)
Examples
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".
Leave a Comment
Comments section will be available soon. Stay tuned!
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Ableton Live MCP Server
MCP Server implementation for Ableton Live OSC control
Airbnb MCP Server
AI Agent Marketplace Index Search MCP Server
MCP Server for AI Agent Marketplace Index from DeepNLP
Algorand MCP Implementation
Algorand Model Context Protocol (Server & Client)
mcp-server-apache-airflow
pypi.org/project/mcp-server-apache-airflow/
airtable-mcp-server
๐๏ธ๐ค Airtable Model Context Protocol Server, for allowing AI systems to interact with your Airtable bases
Airtable MCP Server
Search, create and update Airtable bases, tables, fields, and records using Claude Desktop and MCP (Model Context Protocol) clients
Alphavantage MCP Server
A MCP server for the stock market data API, Alphavantage API.
Amadeus MCP Server
Amadeus MCP(Model Context Protocol) Server
Anki MCP Server
An MCP server for Anki
Submit Your MCP Server
Share your MCP server with the community
Submit Now