mcp-graphql-forge

mcp-graphql-forge

Configuration-driven MCP server exposing modular GraphQL queries as tools.

3
Stars
2
Forks
3
Watchers
0
Issues
mcp-graphql-forge provides a lightweight, easily configurable Model Context Protocol (MCP) server that transforms any GraphQL endpoint into a set of modular API tools. Tools, defined in YAML, specify GraphQL queries and parameters to enable curated interactions via a standardized protocol. Written in Go, it emphasizes modularity, security, and extensibility without requiring code changes, and offers ready-to-run binaries for all major platforms.

Key Features

Transforms any GraphQL endpoint into an MCP-compatible server
Modular tool definitions using YAML files
Configuration via command line, environment variables, and YAML
Supports secure Bearer token authentication via external command
Easy extensibility without modifying codebase
Pre-compiled binaries for macOS, Linux, and Windows
Debug logging and detailed tracing support
Structured tool descriptions (name, description, query) via YAML
Minimal and lightweight Go implementation
Separation of server and tool configurations

Use Cases

Turning private or public GraphQL APIs into controlled, modular agent endpoints
Exposing specific GraphQL queries securely to AI agents or automation tools
Easily reconfiguring available API functions without redeploying code
Enabling agent-based tasks that require secure token-based access to GraphQL data
Standardizing API surface areas for AI model integrations
Restricting and curating API operations to a safe and intentional subset
Rapid prototyping of new API workflows for agent use
Providing a unified layer for multiple GraphQL services managed via YAML
Centralizing authentication and configuration logic for GraphQL access
Enriching agent ecosystems with modular, composable API actions

README

GitHub release License Active Go Report Card Trust Score

mcp-graphql-forge

A lightweight, configuration-driven MCP server that exposes curated GraphQL queries as modular tools, enabling intentional API interactions from your agents.

Purpose

mcp-graphql-forge lets you turn any GraphQL endpoint into an MCP server whose tools are defined in YAML files that specify the GraphQL queries and their parameters. This allows you to create a modular, secure, and minimal server that can be easily extended without modifying the application code.

Releases

All official versions of mcp-graphql-forge are published on GitHub Releases. Since this MCP server is written in Go, each release provides pre-compiled executables for macOS, Linux, and Windows—ready to download and run.

Alternatively, if you have Go installed, you can install mcp-graphql-forge directly from source using the following command:

bash
go install github.com/UnitVectorY-Labs/mcp-graphql-forge@latest

Configuration

The server is configured using command line parameters, environment variables, and YAML files.

Command Line Parameters

  • --forgeConfig: Specifies the path to the folder containing the YAML configuration files (forge.yaml and tool definitions). If set, this takes precedence over the FORGE_CONFIG environment variable. If neither is set, the application will return an error and exit.
  • --forgeDebug: If provided, enables detailed debug logging to stderr, including the obtained token and the full HTTP request/response for GraphQL calls. If set, this takes precedence over the FORGE_DEBUG environment variable.

Environment Variables

  • FORGE_CONFIG: Specifies the path to the folder containing the YAML configuration files (forge.yaml and tool definitions). Used if --forgeConfig is not set.
  • FORGE_DEBUG: If set to true (case-insensitive), enables detailed debug logging to stderr, including the obtained token and the full HTTP request/response for GraphQL calls. Used if --forgeDebug is not set.

forge.yaml

The configuration folder uses a special configuration file forge.yaml that specifies the common configuration attributes.

The following attributes can be specified in the file:

  • name: The name of the MCP server
  • url: The URL of the GraphQL endpoint
  • token_command: The command to use to request the Bearer token for the Authorization header (optional)
  • env: A map of environment variables to pass to the token command (optional)
  • env_passthrough: If set to true, passes all environment variables used when invoking mcp-graphql-forge to the token command; if used in conjunction with env, the variables from env will take precedence (optional, defaults to false)

An example configuration would look like:

yaml
name: "ExampleServer"
url: "https://api.github.com/graphql"
token_command: "gh auth token"

Tool Configuration

All other YAML files located in the folder are treated as configuration files. Each YAML file defines a tool for the MCP server.

The following attributes can be specified in the file:

  • name: The name of the MCP tool
  • description: The description of the MCP tool
  • query: The GraphQL query to execute
  • inputs: The list of inputs defined by the MCP tool and passed into the GraphQL query as variables
    • name: The name of the input
    • type: The parameter type; can be 'string' or 'number'
    • description: The description of the parameter for the MCP tool to use
    • required: Boolean value specifying if the attribute is required
  • annotations: MCP annotations that provide hints about the tool's behavior (optional)
    • title: A human-readable title for the tool, useful for UI display (optional)
    • readOnlyHint: If true, indicates the tool does not modify its environment (optional, default: false)
    • destructiveHint: If true, the tool may perform destructive updates (only meaningful when readOnlyHint is false) (optional, default: true)
    • idempotentHint: If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when readOnlyHint is false) (optional, default: false)
    • openWorldHint: If true, the tool may interact with an "open world" of external entities (optional, default: true)

An example configuration would look like:

yaml
name: "getUser"
description: "Fetch basic information about a user by `login`, including their name, URL, and location."
query: |
  query ($login: String!) {
    user(login: $login) {
      id
      name
      url
      location
    }
  }
inputs:
  - name: "login"
    type: "string"
    description: "The user `login` that uniquely identifies their account."
    required: true
annotations:
  title: "Get User Information"
  readOnlyHint: true
  destructiveHint: false
  idempotentHint: true
  openWorldHint: true

Run in Streamable HTTP Mode

By default the server runs in stdio mode, but if you want to run in streamable HTTP mode, you can specify the --http command line flag with the server address and port (ex: --http 8080). This will run the server with the following endpoint that your MCP client can connect to:

http://localhost:8080/mcp

bash
./mcp-graphql-forge --http 8080

If you do not specify token_command in the configuration, the "Authorization" header, if passed to the MCP server, will be passed through from the incoming MCP request to the backend GraphQL endpoint.

Limitations

  • Each instance of mcp-graphql-forge can only be used with a single GraphQL server at a single URL.
  • The GraphQL queries are all exposed as Tools and not as Resources, even if they are not mutations.

Star History

Star History Chart

Repository Owner

UnitVectorY-Labs
UnitVectorY-Labs

Organization

Repository Details

Language Go
Default Branch main
Size 129 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Go
100%

Tags

Topics

graphql mcp-server

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • mcp-cli

    mcp-cli

    A command-line inspector and client for the Model Context Protocol

    mcp-cli is a command-line interface tool designed to interact with Model Context Protocol (MCP) servers. It allows users to run and connect to MCP servers from various sources, inspect available tools, resources, and prompts, and execute commands non-interactively or interactively. The tool supports OAuth for various server types, making integration and automation seamless for developers working with MCP-compliant servers.

    • 391
    • MCP
    • wong2/mcp-cli
  • FastMCP

    FastMCP

    The fast, Pythonic way to build MCP servers and clients.

    FastMCP is a production-ready framework for building Model Context Protocol (MCP) applications in Python. It streamlines the creation of MCP servers and clients, providing advanced features such as enterprise authentication, composable tools, OpenAPI/FastAPI generation, server proxying, deployment tools, and comprehensive client libraries. Designed for ease of use, it offers both standard protocol support and robust utilities for production deployments.

    • 20,201
    • MCP
    • jlowin/fastmcp
  • mcp-graphql

    mcp-graphql

    Enables LLMs to interact dynamically with GraphQL APIs via Model Context Protocol.

    mcp-graphql provides a Model Context Protocol (MCP) server that allows large language models to discover and interact with GraphQL APIs. The implementation facilitates schema introspection, exposes the GraphQL schema as a resource, and enables secure query and mutation execution based on configuration. It supports configuration through environment variables, automated or manual installation options, and offers flexibility in using local or remote schema files. By default, mutation operations are disabled for security, but can be enabled if required.

    • 319
    • MCP
    • blurrah/mcp-graphql
  • gqai

    gqai

    Expose GraphQL operations as Model Context Protocol (MCP) tools for AI models.

    gqai is a lightweight proxy that converts GraphQL operations into MCP-compatible tools, enabling integration with AI systems such as ChatGPT, Claude, and Cursor. It automatically discovers and exposes GraphQL queries and mutations as callable tools via an MCP server, powered by your existing GraphQL backend. Configuration is managed via standard .graphqlrc.yml and .graphql files, with support for dynamic endpoints and environment variables.

    • 21
    • MCP
    • fotoetienne/gqai
  • GitHub GraphQL MCP Server

    GitHub GraphQL MCP Server

    A Model Context Protocol server for executing arbitrary GraphQL queries on GitHub's API.

    GitHub GraphQL MCP Server is a Model Context Protocol (MCP) server that enables interaction with GitHub's GraphQL API. It allows users to execute any GraphQL queries and mutations against GitHub, supporting variable injection and error handling. The server is designed to integrate with Claude for Desktop, providing tooling for AI environments to access or manipulate GitHub data. Detailed documentation and configuration examples are provided for rapid setup and use.

    • 9
    • MCP
    • QuentinCody/github-graphql-mcp-server
  • Shopify Storefront MCP Server

    Shopify Storefront MCP Server

    Seamless Shopify Storefront API access for AI assistants via Model Context Protocol

    Enables AI assistants to interact with Shopify store data through standardized MCP tools. Offers endpoints for product discovery, inventory management, GraphQL queries, cart operations, and comprehensive customer data manipulation. Designed for easy integration with MCP-compatible AI and automated token handling. Simplifies secure connection to Shopify's Storefront API with minimal configuration.

    • 5
    • MCP
    • QuentinCody/shopify-storefront-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results