Integrations
Exposes GraphQL operations from any GraphQL backend as MCP tools, allowing AI agents to execute queries and mutations against GraphQL APIs using the operations defined in .graphql files.
Allows ChatGPT to utilize GraphQL operations as tools through OpenAI's function calling capability, enabling interaction with any GraphQL API.
格奇
graphql → ai
gqai是一个轻量级代理,它将 GraphQL 操作公开为 Claude、Cursor 和 ChatGPT 等 AI 的模型上下文协议 (MCP)工具。
使用针对 GraphQL 后端的常规 GraphQL 查询/变异定义工具,gqai 会自动为您生成 MCP 服务器。
🔌 由您的 GraphQL 后端提供支持
⚙️ 由.graphqlrc.yml
+ 普通.graphql
文件驱动
✨ 特点
- 🧰 使用 GraphQL 操作定义工具
- 🗂 自动从
.graphqlrc.yml
中发现操作 - 🧾 与 OpenAI 函数调用 / MCP 兼容的工具元数据
🛠️ 安装
🚀 快速入门
- 创建一个.graphqlrc.yml:
该文件告诉 gqai 在哪里找到您的 GraphQL 模式和操作。
注意: schema
参数指示 GQAI 在哪里执行操作。这必须是实时服务器,而不是静态模式文件。
- 添加 GraphQL 操作
get_all_films.graphql
:
- 将 gqai 添加到您的
mcp.json
文件中:
就这样!你的 AI 模型现在可以调用get_all_films
工具了。
用法
配置
GraphQL 配置
graphql 配置文件是一个 YAML 文件,它定义了 GraphQL 端点以及你想要作为工具公开的操作。它应该被命名为.graphqlrc.yml
并放置在项目的根目录中。
schema
字段指定 GraphQL 端点, documents
字段指定 GraphQL 操作所在的目录。
在此示例中, operations
目录包含您想要作为工具公开的所有 GraphQL 操作。这些操作在.graphql
文件中定义,gqai 会自动发现它们。
标题
您还可以指定每次向 GraphQL 端点发送请求时使用的标头。这对于身份验证或其他自定义标头非常有用。
MCP 配置
克劳德桌面
要将 gqai 与 Claude Desktop 一起使用,您需要将以下配置添加到mcp.json
文件中:
🧪 CLI 测试
通过 CLI 调用工具进行测试:
这将执行get_all_films
工具并打印结果。
调用带参数的工具:
创建一个接受参数的 GraphQL 操作,这些将是工具输入:
get_film_by_id.graphql
:
使用参数调用该工具:
这将使用提供的参数执行get_film_by_id
工具。
发展
先决条件
- Go 1.20+
建造
测试
格式
运行 MCP 服务器
运行 CLI
关于GQAI
🤖 为什么是 gqai?
gqai 可轻松将您的 GraphQL 后端转变为模型就绪的工具层——无需代码,无需额外基础设施。只需定义您的操作,然后让 AI 调用即可。
📜 许可证
MIT — 对其进行分叉,在此基础上进行构建,所有一切。
👋 作者
由 Stephen Spalding && <your-name-here>
用 ❤️ 和 🤖 氛围制作
Related MCP Servers
- -securityAlicense-qualityEnables AI assistants to interact with and manage Google Cloud Platform resources including Compute Engine, Cloud Run, Storage, BigQuery, and other GCP services through a standardized MCP interface.Last updated -1PythonMIT License
- GoMIT License
- PythonMIT License
- Python