GraphQL 模式模型上下文协议服务器
一个模型上下文协议 (MCP) 服务器,用于将 GraphQL 模式信息暴露给 Claude 等大型语言模型 (LLM)。该服务器允许 LLM 通过一组专用工具探索和理解 GraphQL 模式。
特征
通过命令行参数加载指定的任何 GraphQL 模式文件
探索查询、变异和订阅字段
查找详细的类型定义
使用模式匹配搜索类型和字段
获取简化的字段信息,包括类型和参数
过滤内部 GraphQL 类型以获得更清晰的结果
用法
命令行
使用特定的模式文件运行 MCP 服务器:
Claude 桌面集成
要将此 MCP 服务器与 Claude Desktop 一起使用,请编辑您的claude_desktop_config.json配置文件:
配置文件的位置:
macOS/Linux:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
$env:AppData\Claude\claude_desktop_config.json
克劳德代码集成
要将此 MCP 服务器与 Claude Code CLI 一起使用,请按照以下步骤操作:
将 GraphQL Schema MCP 服务器添加到 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验证 MCP 服务器是否已注册
# List all configured servers claude mcp list # Get details for your GraphQL schema server claude mcp get graphql-schema如果需要,删除服务器
claude mcp remove graphql-schema使用 Claude Code 中的工具
配置完成后,您可以通过询问有关 GraphQL 模式的问题在 Claude Code 会话中调用该工具。
尖端:
使用
-s或--scope标志与project(默认)或global指定配置的存储位置为具有不同名称的不同架构添加多个 MCP 服务器(例如,主 API 架构、Shopify 架构)
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:获取 SDL 格式的特定 GraphQL 类型的详细定义get-type-fields:获取特定 GraphQL 对象类型的字段及其类型的简化列表search-schema:按名称模式(不区分大小写的正则表达式)搜索模式中的类型或字段
示例
尝试的示例查询:
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
一个 MCP 服务器,用于向 Claude 等 LLM 公开 GraphQL 模式信息。该服务器允许 LLM 通过一组专用工具探索和理解大型 GraphQL 模式,而无需将整个模式加载到上下文中。
Related Resources
Related MCP Servers
- Asecurity-licenseAqualityMCP for working with GraphQL servers.Last updated -2502296MIT License
- -security-license-qualityA 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 contextLast updated -2944
- -security-license-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -5021MIT License
- -security-license-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -0