MCP ExplorerExplorer

Gql Gen Mcp

@wimspaargarenon a year ago
1 MIT
FreeCommunity
AI Systems
gql-gen-mcp generates Model Context Protocol (MCP) servers from GraphQL schemas.

Overview

What is Gql Gen Mcp

gql-gen-mcp is a tool that generates Model Context Protocol (MCP) servers based on GraphQL schema definitions, inspired by the gql-gen generator. It utilizes the widely adopted mcp-go server as its foundation.

Use cases

Use cases for gql-gen-mcp include generating MCP servers for applications like e-commerce platforms, content management systems, and any other systems that benefit from a structured data protocol based on GraphQL.

How to use

To use gql-gen-mcp, install it via ‘go install github.com/wimspaargaren/gql-gen-mcp@latest’. Configure it using a YAML file named ‘.gql-gen-mcp.yaml’ and run the tool in the directory containing this file with the command ‘gql-gen-mcp’.

Key features

Key features include the ability to generate MCP servers from GraphQL schemas, configuration via YAML files, and integration with LLM tooling as a stdio server. However, it currently lacks support for introspection, type queries, and federated GraphQL.

Where to use

gql-gen-mcp can be used in applications that require a Model Context Protocol server, particularly in environments where GraphQL is utilized for defining data schemas.

Content

Overview

The gql-gen-mcp tool has its name inspired by the awesome github.com/99designs/gqlgen generator. Instead of generating a GraphQL server, it generates Model Context Protocol (MCP) (stdio) servers based on your GraphQL schema definitions. It’s currently based on mark3labs/mcp-go as it’s the most widely adopted MCP Go server (April 2025). Gotools just started an implementation see mcp go thread, so perhaps we eventually switch over or make it configurable which server to use as output.

Usage

Install gql-gen-mcp

go install github.com/wimspaargaren/gql-gen-mcp@latest

Configuration

You can configure gql gen mcp using a yaml file called .gql-gen-mcp.yaml.
Example:

schemas:
  - name: bookstore
    dir: ./bookstore/graphql/definitions
    output: ./mcp/bookstore

Run

Run the gql-gen-mcp tool in the directory where you’ve defined your .gql-gen-mcp.yaml file. Note that the main.go of your server is only generated once, such that you can configure the server to your needs.

gql-gen-mcp

Use with your favourite LLM tooling

The generated MCP server is a stdio server. Install it on your system with go install ..

MCP server definition:

"bookstore-api": {
      "command": "bookstore",
      "args": []
  },

Example

Check out the example directory for a full example with a dummy bookstore GraphQL API.

Missing features

  • Configuration via flags
  • No support for introspection or type query
  • No support for federated GraphQL
  • Generate MCP tools based on introspection query

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers