mcp-graphql-schema
GraphQL-Schemamodell-Kontextprotokollserver
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 --helpInstallation über Smithery
So installieren Sie GraphQL Schema für Claude Desktop automatisch über Smithery :
npx -y @smithery/cli install @hannesj/mcp-graphql-schema --client claudeClaude 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.jsonWindows:
$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:
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Ü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-schemaEntfernen Sie den Server bei Bedarf
claude mcp remove graphql-schemaVerwenden 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
-soder--scopemitproject(Standard) oderglobalum anzugeben, wo die Konfiguration gespeichert wirdFü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 aufget-query-field: Ruft eine detaillierte Definition für ein bestimmtes Abfragefeld im SDL-Format ablist-mutation-fields: Listet alle verfügbaren Root-Level-Felder für GraphQL-Mutationen aufget-mutation-field: Ruft eine detaillierte Definition für ein bestimmtes Mutationsfeld im SDL-Format ablist-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 abget-type-fields: Ruft eine vereinfachte Liste von Feldern mit ihren Typen für einen bestimmten GraphQL-Objekttyp absearch-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".This server cannot be deployed
Maintenance
Related MCP Connectors
The Grafbase MCP server sits in front of a GraphQL API and exposes an MCP protocol-compliant interface that allows AI agents and LLMs to explore and query GraphQL APIs using natural language. It provides tools to search schemas, introspect types and fields, and execute GraphQL queries while minimizing context bloat by returning only relevant schema subsets, with built-in support for authentication, authorization, and configurable access control.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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 context142 npm49MIT
- AlicenseAqualityDmaintenanceGraphQL 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.213 npm3MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides tools for exploring large OpenAPI schemas without loading entire schemas into LLM context. Perfect for discovering and analyzing endpoints, data models, and API structure efficiently.914MIT
- AlicenseAqualityAmaintenanceA 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.230 npm1MIT