MCP Connector

Explore GraphQL Schemas for LLMs

MCP server that exposes a GraphQL schema to LLMs, letting them explore query, mutation, and type definitions directly.

Maintainer of this project? Claim this page to edit the listing.


91
Spark score
out of 100
Updated May 2025
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Empower Large Language Models (LLMs) to understand and interact with GraphQL schemas. This asset provides specialized tools for LLMs to query, explore, and retrieve detailed information about schema structure, types, fields, and operations.

Outcomes

What it gets done

01

List all available query and mutation fields.

02

Retrieve detailed SDL descriptions for specific types and fields.

03

Search the schema for types and fields by name pattern.

04

Provide simplified field information including types and arguments.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-graphql-schema | bash

Capabilities

Tools your agent gets

list-query-fields

Displays all available root-level fields for GraphQL queries

get-query-field

Retrieves detailed description for a specific query field in SDL format

list-mutation-fields

Displays all available root-level fields for GraphQL mutations

get-mutation-field

Retrieves detailed description for a specific mutation field in SDL format

list-subscription-fields

Displays all available root-level fields for GraphQL subscriptions if present

get-subscription-field

Retrieves detailed description for a specific subscription field in SDL format

list-types

Displays all types defined in the GraphQL schema excluding introspection types

get-type

Retrieves detailed description for a specific GraphQL type in SDL format

+2 tools

Overview

GraphQL Schema MCP Server

An MCP server that exposes a loaded GraphQL schema file to LLMs like Claude, providing tools to list and inspect query, mutation, and subscription fields, look up type definitions in SDL format, and search the schema by name pattern. Use when an LLM needs to explore or answer questions about a GraphQL schema without it being pasted into context; not needed for schemas small enough to paste directly.

What it does

An MCP server that exposes GraphQL schema information to LLMs like Claude, allowing them to explore and understand GraphQL schemas through a set of specialized tools. It loads any GraphQL schema file specified via a command-line argument, exposes query, mutation, and subscription fields, looks up detailed type definitions, and searches for types and fields using pattern matching, filtering out internal GraphQL types for cleaner results.

When to use - and when NOT to

Use this when an LLM needs to explore or answer questions about a GraphQL schema - what query fields are available, the definition of a specific type, what mutations can be performed - without manually pasting the schema into context.

Not needed for GraphQL APIs you already fully understand, or for schemas small enough that pasting them directly into the conversation is simpler than running a dedicated server.

Capabilities

Ten tools: list-query-fields and get-query-field (list and inspect root query fields in SDL format), list-mutation-fields and get-mutation-field (the same for mutations), list-subscription-fields and get-subscription-field (the same for subscriptions, if present in the schema), list-types (lists all schema types, excluding internal ones), get-type (detailed SDL definition for a specific type), get-type-fields (a simplified field/type list for an object type), and search-schema (case-insensitive regex search for types or fields by name pattern).

How to install

Run via npx with a schema file argument:

npx -y mcp-graphql-schema /absolute/path/to/schema.graphqls

By default it uses schema.graphqls in the current directory if no file is given, or --help shows usage. It can also be installed automatically for Claude Desktop via Smithery (npx -y @smithery/cli install @hannesj/mcp-graphql-schema --client claude), or configured directly in Claude Desktop's claude_desktop_config.json, located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS/Linux or $env:AppData\Claude\claude_desktop_config.json on Windows. For Claude Code CLI, add it with claude mcp add graphql-schema npx -y mcp-graphql-schema, list configured servers with claude mcp list, inspect one with claude mcp get graphql-schema, and remove it with claude mcp remove graphql-schema; the -s/--scope flag (project default or global) controls where the configuration is stored, and multiple servers can be added for different schemas, such as a main API schema and a Shopify schema, under different names.

Who it's for

Developers using Claude Desktop or Claude Code who work against a GraphQL API and want the LLM to answer schema questions - available fields, type definitions, search by name pattern - directly from the schema file instead of a manually pasted copy.

Source README

GraphQL Schema Model Context Protocol Server

smithery badge
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

Installing via Smithery

To install GraphQL Schema for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @hannesj/mcp-graphql-schema --client claude

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".

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.