mcp-graphql-schema

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Integrations

  • Exposes GraphQL schema information to explore query, mutation, and subscription fields, look up type definitions, search for types and fields, and get simplified field information.

  • Supports loading Shopify GraphQL schemas, allowing exploration of Shopify's API structure through the MCP server.

GraphQL スキーマ モデル コンテキスト プロトコル サーバー

Claudeのような大規模言語モデル(LLM)にGraphQLスキーマ情報を公開するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、LLMは専用のツールセットを通じてGraphQLスキーマを探索・理解することができます。

特徴

  • コマンドライン引数で指定されたGraphQLスキーマファイルをロードします。
  • クエリ、ミューテーション、サブスクリプションのフィールドを調べる
  • 詳細な型定義を調べる
  • パターンマッチングを使用してタイプとフィールドを検索する
  • 型や引数を含む簡略化されたフィールド情報を取得します
  • よりクリーンな結果を得るために内部 GraphQL タイプを除外する

使用法

コマンドライン

特定のスキーマ ファイルを使用して MCP サーバーを実行します。

# 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

クロードデスクトップ統合

この MCP サーバーを Claude Desktop で使用するには、 claude_desktop_config.json構成ファイルを編集します。

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

設定ファイルの場所:

  • macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: $env:AppData\Claude\claude_desktop_config.json

クロード・コード統合

この MCP サーバーを Claude Code CLI で使用するには、次の手順に従います。

  1. Claude CodeにGraphQLスキーマMCPサーバーを追加する
    # 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. MCPサーバーが登録されていることを確認する
    # List all configured servers claude mcp list # Get details for your GraphQL schema server claude mcp get graphql-schema
  3. 必要に応じてサーバーを削除する
    claude mcp remove graphql-schema
  4. Claude Codeのツールを使用する設定が完了すると、GraphQL スキーマに関する質問をすることで、Claude Code セッションでツールを呼び出すことができます。

ヒント:

  • -sまたは--scopeフラグをproject (デフォルト)またはglobalとともに使用して、構成が保存される場所を指定します。
  • 異なる名前の異なるスキーマ(例:メイン API スキーマ、Shopify スキーマ)に複数の MCP サーバーを追加します。

MCPツール

サーバーは、LLM が GraphQL スキーマと対話するための次のツールを提供します。

  • list-query-fields : GraphQLクエリで利用可能なすべてのルートレベルフィールドを一覧表示します
  • get-query-field : 特定のクエリフィールドの詳細な定義をSDL形式で取得します。
  • list-mutation-fields : GraphQL ミューテーションで利用可能なすべてのルートレベルフィールドを一覧表示します
  • get-mutation-field : 特定のミューテーションフィールドの詳細な定義をSDL形式で取得します。
  • list-subscription-fields : GraphQL サブスクリプションで利用可能なすべてのルートレベルフィールドを一覧表示します (スキーマに存在する場合)
  • get-subscription-field : 特定のサブスクリプション フィールドの詳細な定義を取得します (スキーマに存在する場合)
  • list-types : GraphQLスキーマで定義されているすべての型を一覧表示します(内部型を除く)
  • get-type : 特定の GraphQL タイプの詳細な定義を SDL 形式で取得します。
  • get-type-fields : 特定のGraphQLオブジェクトタイプのフィールドとその型の簡略化されたリストを取得します。
  • search-schema : スキーマ内の型またはフィールドを名前パターンで検索します(大文字と小文字を区別しない正規表現)

試してみるクエリの例:

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".
-
security - not tested
F
license - not found
-
quality - not tested

ClaudeのようなLLMにGraphQLスキーマ情報を提供するMCPサーバー。このサーバーにより、LLMはコンテキストにスキーマ全体をロードすることなく、専用のツールセットを通じて大規模なGraphQLスキーマを探索・理解することができます。

  1. Features
    1. Usage
      1. Command Line
      2. Claude Desktop Integration
      3. Claude Code Integration
    2. MCP Tools
      1. Examples
        ID: 544atbdic7