GraphQL スキーマ モデル コンテキスト プロトコル サーバー
Claudeのような大規模言語モデル(LLM)にGraphQLスキーマ情報を公開するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、LLMは専用のツールセットを通じてGraphQLスキーマを探索・理解することができます。
特徴
コマンドライン引数で指定されたGraphQLスキーマファイルをロードします。
クエリ、ミューテーション、サブスクリプションのフィールドを調べる
詳細な型定義を調べる
パターンマッチングを使用してタイプとフィールドを検索する
型や引数を含む簡略化されたフィールド情報を取得します
よりクリーンな結果を得るために内部 GraphQL タイプを除外する
Related MCP server: mcp-openapi-schema
使用法
コマンドライン
特定のスキーマ ファイルを使用して 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.jsonWindows:
$env:AppData\Claude\claude_desktop_config.json
クロード・コード統合
この MCP サーバーを Claude Code CLI で使用するには、次の手順に従います。
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.graphqlsMCPサーバーが登録されていることを確認する
# List all configured servers claude mcp list # Get details for your GraphQL schema server claude mcp get graphql-schema必要に応じてサーバーを削除する
claude mcp remove graphql-schemaClaude 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".This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.