mcp-graphql
模型上下文协议 (MLM) 服务器,使 LLM 能够与 GraphQL API 交互。此实现提供了架构自检和查询执行功能,允许模型动态发现和使用 GraphQL API。
用法
使用正确的端点运行mcp-graphql
,它将自动尝试检查您的查询。
命令行参数
争论 | 描述 | 默认 |
---|---|---|
--endpoint | GraphQL 端点 URL | http://localhost:4000/graphql |
--headers | 包含请求标头的 JSON 字符串 | {} |
--enable-mutations | 启用变异操作(默认禁用) | false |
--name | MCP 服务器的名称 | mcp-graphql |
--schema | 本地 GraphQL 模式文件的路径(可选) | - |
示例
可用工具
该服务器提供两个主要工具:
- introspect-schema :此工具用于检索 GraphQL 架构。如果您无法将架构作为资源访问,请首先使用此工具。它使用本地架构文件或自省查询。
- query-graphql :针对端点执行 GraphQL 查询。默认情况下,除非指定
--enable-mutations
否则变更功能处于禁用状态。
资源
- graphql-schema :服务器将 GraphQL 架构公开为客户端可以访问的资源。这可以是本地架构文件,也可以是基于自省查询的。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 GraphQL MCP Toolkit:
手动安装
可以手动安装到 Claude 中:
安全注意事项
出于安全考虑,更改功能默认处于禁用状态,以防止 LLM 修改您的数据库或服务数据。在生产环境中启用更改之前,请仔细考虑。
为您自己的服务器进行定制
这是一个非常通用的实现,它允许完全自省,并允许用户执行任何操作(包括修改)。如果您需要更具体的实现,我建议您创建自己的 MCP 并锁定调用工具,以便客户端仅输入特定的查询字段和/或变量。您可以将其用作参考。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
模型上下文协议服务器通过提供模式自省和查询执行功能,使 LLM 能够与 GraphQL API 交互。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.Last updated -1077PythonMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated -340TypeScriptMIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.Last updated -340MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -7331MIT License