gqai
格奇
graphql → ai
gqai是一个轻量级代理,它将 GraphQL 操作公开为 Claude、Cursor 和 ChatGPT 等 AI 的模型上下文协议 (MCP)工具。
使用针对 GraphQL 后端的常规 GraphQL 查询/变异定义工具,gqai 会自动为您生成 MCP 服务器。
🔌 由您的 GraphQL 后端提供支持
⚙️ 由.graphqlrc.yml + 普通.graphql文件驱动
✨ 特点
🧰 使用 GraphQL 操作定义工具
🗂 自动从
.graphqlrc.yml中发现操作🧾 与 OpenAI 函数调用 / MCP 兼容的工具元数据
Related MCP server: mcp-graphql-forge
🛠️ 安装
go install github.com/fotoetienne/gqai@latest🚀 快速入门
创建一个.graphqlrc.yml:
schema: https://graphql.org/graphql/
documents: .该文件告诉 gqai 在哪里找到您的 GraphQL 模式和操作。
注意: schema参数指示 GQAI 在哪里执行操作。这必须是实时服务器,而不是静态模式文件。
添加 GraphQL 操作
get_all_films.graphql :
# Get all Star Wars films
query get_all_films {
allFilms {
films {
title
episodeID
}
}
}将 gqai 添加到您的
mcp.json文件中:
"gqai": {
"command": "gqai",
"args": [
"run",
"--config"
".graphqlrc.yml"
]
}就这样!你的 AI 模型现在可以调用get_all_films工具了。
用法
配置
GraphQL 配置
graphql 配置文件是一个 YAML 文件,它定义了 GraphQL 端点以及你想要作为工具公开的操作。它应该被命名为.graphqlrc.yml并放置在项目的根目录中。
schema: https://graphql.org/graphql/
documents: operationsschema字段指定 GraphQL 端点, documents字段指定 GraphQL 操作所在的目录。
在此示例中, operations目录包含您想要作为工具公开的所有 GraphQL 操作。这些操作在.graphql文件中定义,gqai 会自动发现它们。
标题
您还可以指定每次向 GraphQL 端点发送请求时使用的标头。这对于身份验证或其他自定义标头非常有用。
schema:
- https://graphql.org/graphql/:
headers:
Authorization: Bearer YOUR_TOKEN
X-Custom-Header: CustomValue
documents: .MCP 配置
克劳德桌面
要将 gqai 与 Claude Desktop 一起使用,您需要将以下配置添加到mcp.json文件中:
{
"gqai": {
"command": "gqai",
"args": [
"run",
"--config",
".graphqlrc.yml"
]
}
}🧪 CLI 测试
通过 CLI 调用工具进行测试:
gqai tools/call get_all_films这将执行get_all_films工具并打印结果。
{
"data": {
"allFilms": {
"films": [
{
"id": 4,
"title": "A New Hope"
},
{
"id": 5,
"title": "The Empire Strikes Back"
},
{
"id": 6,
"title": "Return of the Jedi"
},
...
]
}
}
}调用带参数的工具:
创建一个接受参数的 GraphQL 操作,这些将是工具输入:
get_film_by_id.graphql :
query get_film_by_id($id: ID!) {
film(filmID: $id) {
episodeID
title
director
releaseDate
}
}使用参数调用该工具:
gqai tools/call get_film_by_id '{"id": "1"}'这将使用提供的参数执行get_film_by_id工具。
{
"data": {
"film": {
"episodeID": 1,
"title": "A New Hope",
"director": "George Lucas",
"releaseDate": "1977-05-25"
}
}
}发展
先决条件
Go 1.20+
建造
go build -o gqai main.go测试
go test ./...格式
go fmt ./...运行 MCP 服务器
./gqai run --config .graphqlrc.yml运行 CLI
./gqai tools/call get_all_films关于GQAI
🤖 为什么是 gqai?
gqai 可轻松将您的 GraphQL 后端转变为模型就绪的工具层——无需代码,无需额外基础设施。只需定义您的操作,然后让 AI 调用即可。
📜 许可证
MIT — 对其进行分叉,在此基础上进行构建,所有一切。
👋 作者
由 Stephen Spalding && <your-name-here>用 ❤️ 和 🤖 氛围制作
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
- typeshipOAuthdev.typeship
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Monday.com MCP — wraps the Monday.com GraphQL API (BYO API key)
Product Hunt MCP — wraps the Product Hunt GraphQL API v2 (api.producthunt.com)
Linear MCP — wraps the Linear GraphQL API (OAuth)
Related MCP Servers
- MIT
- AlicenseNot gradedqualityDmaintenanceMCP that can proxy any GraphQL API and expose graphql operations as mcp tools.618Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAutomatically generates MCP tools from any GraphQL API by introspecting its schema, supporting queries, mutations, and authentication.5GPL 3.0
- AlicenseNot gradedqualityDmaintenanceAutomatically discovers and exposes any GraphQL API as MCP tools with zero configuration.MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fotoetienne/gqai'
If you have feedback or need assistance with the MCP directory API, please join our Discord server