Skip to main content
Glama

GraphQL-Schemamodell-Kontextprotokollserver

Schmiedeabzeichen Ein Model Context Protocol (MCP)-Server, der GraphQL-Schemainformationen für Large Language Models (LLMs) wie Claude bereitstellt. Dieser Server ermöglicht es einem LLM, GraphQL-Schemata mithilfe spezieller Tools zu erkunden und zu verstehen.

Merkmale

  • Laden Sie eine beliebige GraphQL-Schemadatei, die über ein Befehlszeilenargument angegeben wurde

  • Abfrage-, Mutations- und Abonnementfelder erkunden

  • Suchen Sie nach detaillierten Typdefinitionen

  • Suche nach Typen und Feldern mithilfe des Mustervergleichs

  • Erhalten Sie vereinfachte Feldinformationen einschließlich Typen und Argumenten

  • Filtern Sie interne GraphQL-Typen heraus, um sauberere Ergebnisse zu erzielen

Related MCP server: mcp4gql

Verwendung

Befehlszeile

Führen Sie den MCP-Server mit einer bestimmten Schemadatei aus:

# 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

Installation über Smithery

So installieren Sie GraphQL Schema für Claude Desktop automatisch über Smithery :

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

Claude Desktop Integration

Um diesen MCP-Server mit Claude Desktop zu verwenden, bearbeiten Sie Ihre Konfigurationsdatei claude_desktop_config.json :

{
  "mcpServers": {
    "GraphQL Schema": {
      "command": "npx",
      "args": ["-y", "mcp-graphql-schema", "/ABSOLUTE/PATH/TO/schema.graphqls"]
    }
  }
}

Speicherort der Konfigurationsdatei:

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: $env:AppData\Claude\claude_desktop_config.json

Claude Code Integration

Um diesen MCP-Server mit Claude Code CLI zu verwenden, führen Sie die folgenden Schritte aus:

  1. Fügen Sie den GraphQL Schema MCP-Server zu Claude Code hinzu

    # 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. Überprüfen Sie, ob der MCP-Server registriert ist

    # List all configured servers
    claude mcp list
    
    # Get details for your GraphQL schema server
    claude mcp get graphql-schema
  3. Entfernen Sie den Server bei Bedarf

    claude mcp remove graphql-schema
  4. Verwenden Sie das Tool in Claude Code

    Nach der Konfiguration können Sie das Tool in Ihrer Claude Code-Sitzung aufrufen, indem Sie Fragen zum GraphQL-Schema stellen.

Tipps:

  • Verwenden Sie das Flag -s oder --scope mit project (Standard) oder global um anzugeben, wo die Konfiguration gespeichert wird

  • Fügen Sie mehrere MCP-Server für verschiedene Schemata mit unterschiedlichen Namen hinzu (z. B. Haupt-API-Schema, Shopify-Schema).

MCP-Tools

Der Server stellt die folgenden Tools für LLMs zur Interaktion mit GraphQL-Schemas bereit:

  • list-query-fields : Listet alle verfügbaren Felder auf Stammebene für GraphQL-Abfragen auf

  • get-query-field : Ruft eine detaillierte Definition für ein bestimmtes Abfragefeld im SDL-Format ab

  • list-mutation-fields : Listet alle verfügbaren Root-Level-Felder für GraphQL-Mutationen auf

  • get-mutation-field : Ruft eine detaillierte Definition für ein bestimmtes Mutationsfeld im SDL-Format ab

  • list-subscription-fields : Listet alle verfügbaren Felder auf Stammebene für GraphQL-Abonnements auf (sofern im Schema vorhanden)

  • get-subscription-field : Ruft eine detaillierte Definition für ein bestimmtes Abonnementfeld ab (sofern im Schema vorhanden)

  • list-types : Listet alle im GraphQL-Schema definierten Typen auf (ausgenommen interne Typen)

  • get-type : Ruft eine detaillierte Definition für einen bestimmten GraphQL-Typ im SDL-Format ab

  • get-type-fields : Ruft eine vereinfachte Liste von Feldern mit ihren Typen für einen bestimmten GraphQL-Objekttyp ab

  • search-schema : Sucht nach Typen oder Feldern im Schema anhand des Namensmusters (regulärer Ausdruck ohne Berücksichtigung der Groß-/Kleinschreibung).

Beispiele

Beispielabfragen zum Ausprobieren:

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A MCP server that exposes OpenAPI schema information to LLMs like Claude. This server allows an LLM to explore and understand large OpenAPI schemas through a set of specialized tools, without needing to load the whole schema into the context
    142 npm
    49
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    GraphQL MCP Server that acts as a bridge allowing MCP clients (like Cursor or Claude Desktop) to interact with target GraphQL APIs through standard tools for schema introspection and operation execution.
    2
    13 npm
    3
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    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.
    2
    30 npm
    1
    MIT