FG

fotoetienne/gqai

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

23 stars 6 forks 品質 58 トレンド 10MIT

Turn any GraphQL endpoint into a set of MCP tools

概要

is a lightweight proxy that exposes GraphQL operations as Model Context Protocol (MCP) tools for AI like Claude, Cursor, and ChatGPT. Define tools using regular GraphQL queries/mutations against your GraphQL backend, and gqai automatically generates an MCP server for you. 🔌 Powered by your GraphQL backend ⚙️ Driven by .graphqlrc.yml + plain .graphql files - 🧰 Define tools using GraphQL operations - 🗂 Automatically discover operations from .graphqlrc.yml - 🧾 Tool metadata compatible with OpenAI function calling / MCP This file tells gqai where to find your GraphQL schema and operations. Note: The schema parameter tells gqai where to execute the operations. This must be a live server rather than a static schema file That's it! Your AI model can now call the get_all_films tool. The graphql config file is a YAML file that defines the GraphQL endpoint and the operations you want to expose as tools. It should be named .graphqlrc.yml and placed in the root of your project.

README

以下は原文 README の抜粋です。原文を見る。

gqai

graphql → ai

gqai is a lightweight proxy that exposes GraphQL operations as Model Context Protocol (MCP) tools for AI like Claude, Cursor, and ChatGPT.
Define tools using regular GraphQL queries/mutations against your GraphQL backend, and gqai automatically generates an MCP server for you.

🔌 Powered by your GraphQL backend
⚙️ Driven by .graphqlrc.yml + plain .graphql files


✨ Features

  • 🧰 Define tools using GraphQL operations
  • 🗂 Automatically discover operations from .graphqlrc.yml
  • 🧾 Tool metadata compatible with OpenAI function calling / MCP

🛠️ Installation

go install github.com/fotoetienne/gqai@latest

🚀 Quick Start

  1. Create a .graphqlrc.yml:
schema: https://graphql.org/graphql/
documents: .

This file tells gqai where to find your GraphQL schema and operations.

Note: The schema parameter tells gqai where to execute the operations. This must be a live server rather than a static schema file

  1. Add a GraphQL operation

get_all_films.graphql:

# Get all Star Wars films
query get_all_films {
  allFilms {
    films {
      title
      episodeID
    }
  }
}
  1. Add gqai to your mcp.json file:
  "gqai": {
    "command": "gqai",
    "args": [
      "run",
      "--config"
      ".graphqlrc.yml"
    ]
  }

That’s it! Your AI model can now call the get_all_films tool.

Usage

Configuration

GraphQL Config

The graphql config file is a YAML file that defines the GraphQL endpoint and the operations you want to expose as tools. It should be named .graphqlrc.yml and placed in the root of your project.

schema: https://graphql.org/graphql/
documents: operations

The schema field specifies the GraphQL endpoint, and the documents field specifies the directory where your GraphQL operations are located.

In this example, the operations directory contains all the GraphQL operations you want to expose as tools. Operations are defined in .graphql files, and gqai will automatically discover them.

Headers

You can also specify headers to be sent with each request to the GraphQL endpoint. This is useful for authentication or other custom headers.

schema:
  - https://graphql.org/graphql/:
      headers:
        Authorization: Bearer YOUR_TOKEN
        X-Custom-Header: CustomValue
documents: .
Using Environment Variables in Headers

You can reference environment variables in header values using the ${VARNAME} syntax. For example:

schema:
  - https://graphql.org/graphql/:
      headers:
        Authorization: Bearer ${MY_AUTH_TOKEN}
documents: .

You can also provide a default value using the ${VARNAME:-default} syntax:

schema:
  - https://graphql.org/graphql/:
      headers:
        Authorization: Bearer ${MY_AUTH_TOKEN:-default-token}
documents: .
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →