fotoetienne

gqai

Community fotoetienne
Updated

Turn any GraphQL endpoint into a set of MCP tools

gqai

graphql β†’ ai

gqai is a lightweight proxy that exposes GraphQL operations as Model Context Protocol (MCP) tools for AI models like ChatGPT. It lets you define tools using regular GraphQL queries/mutations and run them locally or expose them over HTTP.

πŸ”Œ Powered by your GraphQL backend βš™οΈ Driven by .graphqlrc.yml + plain .graphql files 🧠 Model-ready inputs/outputsπŸ“ Built in Go

✨ Features

  • 🧰 Run GraphQL operations as tools via CLI
  • 🌐 Serve tools via HTTP for AI agents
  • πŸ—‚ 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: "operations"

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

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

  1. Write a GraphQL operation (operations/getAllFilms.graphql):
query getAllFilms {
  allFilms {
    films {
      title
      episodeID
    }
  }
}
  1. Run it via CLI:
gqai run getAllFilms

🌐 HTTP Server

Run a local server that exposes your tools via HTTP:

gqai serve

Call the tools via HTTP POST requests:

curl -X POST http://localhost:8080/tools/call  -d '{"toolName": "getAllFilms"}'

πŸ“¦ Tool Metadata

Auto-generated tool specs for each operation, so you can plug into any LLM that supports tool use.

πŸ€– Why gqai?

gqai makes it easy to turn your GraphQL backend into a model-ready tool layer β€” no wrappers, no extra infra. Just define your operations and let AI call them.

πŸ§ͺ Roadmap

  • CLI tool runner

  • HTTP server mode (gqai serve)

  • Tool metadata generation

  • JSON Schema validation

  • Plug-and-play with OpenAI, Fireworks, etc.

πŸ“œ License

MIT β€” fork it, build on it, model all the things.

πŸ‘‹ Author

Made with ❀️ and πŸ€–vibes by Stephen Spalding

MCP Server Β· Populars

MCP Server Β· New