Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-graphql-schema

MCP.Pizza Chef: hannesj

The mcp-graphql-schema is an MCP server that exposes GraphQL schema details to large language models like Claude, enabling them to explore queries, mutations, subscriptions, and type definitions. It supports loading any GraphQL schema file, searching types and fields with pattern matching, and filtering internal types for clarity. This server facilitates deep schema understanding and interaction for AI-driven workflows involving GraphQL APIs.

Use This MCP server To

Load and expose GraphQL schema files to LLMs Explore query, mutation, and subscription fields in schemas Look up detailed GraphQL type definitions Search GraphQL types and fields using pattern matching Filter out internal GraphQL types for cleaner schema views Enable LLMs to understand and interact with GraphQL APIs Support AI-driven schema exploration and documentation generation

README

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:

  1. 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
  2. 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
  3. Remove the server if needed

    claude mcp remove graphql-schema
  4. 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 with project (default) or global 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 queries
  • get-query-field: Gets detailed definition for a specific query field in SDL format
  • list-mutation-fields: Lists all available root-level fields for GraphQL mutations
  • get-mutation-field: Gets detailed definition for a specific mutation field in SDL format
  • list-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 format
  • get-type-fields: Gets a simplified list of fields with their types for a specific GraphQL object type
  • search-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".

mcp-graphql-schema FAQ

How do I specify which GraphQL schema file to load?
You can specify the schema file path as a command line argument when starting the server, either relative or absolute.
Can this server handle any GraphQL schema file format?
Yes, it supports standard GraphQL schema files (.graphqls) for loading and exploration.
How does the server help with internal GraphQL types?
It can filter out internal GraphQL types to provide cleaner and more relevant schema information to the model.
What kind of schema details can the LLM explore through this server?
The LLM can explore queries, mutations, subscriptions, detailed type definitions, and simplified field information including types and arguments.
Is this server compatible with multiple LLM providers?
Yes, it is designed to work with various LLMs such as Claude, OpenAI GPT, and Gemini by exposing schema context in a standardized way.
How do I run the server with a default schema?
Run `npx -y mcp-graphql-schema` in the directory containing the default schema.graphqls file.
Can I search for specific types or fields in the schema?
Yes, the server supports pattern matching searches for types and fields to quickly find relevant schema parts.
Does this server support real-time schema updates?
The current version loads schema at startup; real-time updates would require restarting the server with the new schema file.