A lightweight, configuration-driven MCP server that exposes curated GraphQL queries as modular tools, enabling intentional API interactions from your agents. 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 e
Add this skill
npx mdskills install UnitVectorY-Labs/mcp-graphql-forgeConfiguration-driven GraphQL-to-MCP adapter with strong YAML tooling and output optimization
1[](https://github.com/UnitVectorY-Labs/mcp-graphql-forge/releases/latest) [](https://opensource.org/licenses/MIT) [](https://guide.unitvectorylabs.com/bestpractices/status/#active) [](https://goreportcard.com/report/github.com/UnitVectorY-Labs/mcp-graphql-forge) [](https://archestra.ai/mcp-catalog/unitvectory-labs__mcp-graphql-forge)23# mcp-graphql-forge45A lightweight, configuration-driven MCP server that exposes curated GraphQL queries as modular tools, enabling intentional API interactions from your agents.67## Purpose89`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.1011## Releases1213All official versions of **mcp-graphql-forge** are published on [GitHub Releases](https://github.com/UnitVectorY-Labs/mcp-graphql-forge/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.1415Alternatively, if you have Go installed, you can install **mcp-graphql-forge** directly from source using the following command:1617```bash18go install github.com/UnitVectorY-Labs/mcp-graphql-forge@latest19```2021## Configuration2223The server is configured using command line parameters, environment variables, and YAML files.242526### Command Line Parameters2728- `--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.29- `--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.3031### Environment Variables3233- `FORGE_CONFIG`: Specifies the path to the folder containing the YAML configuration files (`forge.yaml` and tool definitions). Used if `--forgeConfig` is not set.34- `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.3536### forge.yaml3738The configuration folder uses a special configuration file `forge.yaml` that specifies the common configuration attributes.3940The following attributes can be specified in the file:4142- `name`: The name of the MCP server43- `url`: The URL of the GraphQL endpoint44- `token_command`: The command to use to request the Bearer token for the `Authorization` header (optional)45- `env`: A map of environment variables to pass to the token command (optional)46- `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`)4748An example configuration would look like:4950```yaml51name: "ExampleServer"52url: "https://api.github.com/graphql"53token_command: "gh auth token"54```5556### Tool Configuration5758All other YAML files located in the folder are treated as configuration files. Each YAML file defines a tool for the MCP server.596061The following attributes can be specified in the file:6263- `name`: The name of the MCP tool64- `description`: The description of the MCP tool65- `query`: The GraphQL query to execute66- `inputs`: The list of inputs defined by the MCP tool and passed into the GraphQL query as variables67 - `name`: The name of the input68 - `type`: The parameter type; can be 'string' or 'number'69 - `description`: The description of the parameter for the MCP tool to use70 - `required`: Boolean value specifying if the attribute is required71- `annotations`: MCP annotations that provide hints about the tool's behavior (optional)72 - `title`: A human-readable title for the tool, useful for UI display (optional)73 - `readOnlyHint`: If true, indicates the tool does not modify its environment (optional, default: false)74 - `destructiveHint`: If true, the tool may perform destructive updates (only meaningful when readOnlyHint is false) (optional, default: true)75 - `idempotentHint`: If true, calling the tool repeatedly with the same arguments has no additional effect (only meaningful when readOnlyHint is false) (optional, default: false)76 - `openWorldHint`: If true, the tool may interact with an "open world" of external entities (optional, default: true)77- `output`: The output format for the GraphQL response (optional, defaults to "raw")78 - `raw`: Passes through the server response as-is (default)79 - `json`: Returns minimized JSON with unnecessary spacing removed80 - `toon`: Converts JSON response to TOON format (Token-Oriented Object Notation) for efficient token usage with LLMs8182An example configuration would look like:8384```yaml85name: "getUser"86description: "Fetch basic information about a user by `login`, including their name, URL, and location."87query: |88 query ($login: String!) {89 user(login: $login) {90 id91 name92 url93 location94 }95 }96inputs:97 - name: "login"98 type: "string"99 description: "The user `login` that uniquely identifies their account."100 required: true101annotations:102 title: "Get User Information"103 readOnlyHint: true104 destructiveHint: false105 idempotentHint: true106 openWorldHint: true107output: "toon" # Optional: "raw" (default), "json", or "toon"108```109110### Output Formats111112The `output` configuration parameter allows you to specify how the GraphQL response should be formatted. This is particularly useful when working with LLMs, as different formats can optimize for token efficiency.113114#### Available Output Formats115116**raw** (default)117118- Passes through the GraphQL server response exactly as received119- No transformation or modification is applied120- Use when you need the original formatting from the server121122**json**123124- Returns minimized JSON with all unnecessary whitespace removed125- Reduces token usage compared to formatted JSON126- Ideal for reducing payload size while maintaining JSON compatibility127- Automatically falls back to raw output if the response is not valid JSON128129**toon**130131- Converts the JSON response to TOON format (Token-Oriented Object Notation)132- Can reduce token usage by 30-60% for uniform, tabular data133- Optimized for LLM consumption with compact, human-readable output134- Uses the [toon-format/toon-go](https://github.com/toon-format/toon-go) library135- Automatically falls back to raw output if the response is not valid JSON or conversion fails136137### Run in Streamable HTTP Mode138139By 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:140141`http://localhost:8080/mcp`142143```bash144./mcp-graphql-forge --http 8080145```146147If 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.148149## Limitations150151- Each instance of `mcp-graphql-forge` can only be used with a single GraphQL server at a single URL.152- The GraphQL queries are all exposed as Tools and not as Resources, even if they are not mutations.153
Full transparency — inspect the skill content before installing.