mcp4gql - GraphQL MCP Server
@jorgeraad
About mcp4gql - GraphQL MCP Server
MCP server for interacting with a GraphQL server
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp4gql": {
"command": "npx",
"type": "stdio",
"args": [
"-y",
"mcp4gql"
],
"env": {
"GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL",
"AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN"
}
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is mcp4gql?
mcp4gql is a Node.js/TypeScript server that implements the Model Context Protocol (MCP), acting as a bridge for MCP clients like Cursor to interact with a target GraphQL API. It is intended for developers who want to query and introspect GraphQL APIs through MCP-compatible tools.
How to use mcp4gql?
Configure the environment variables GRAPHQL_ENDPOINT (the target GraphQL API URL) and optionally AUTH_TOKEN (a bearer token). Then configure an MCP client such as Cursor or Claude Desktop to run the server via npx, passing those environment variables. The server communicates over stdio and exposes the tools introspectGraphQLSchema and executeGraphQLOperation to the client.
Key features of mcp4gql
- Implements the MCP Server class from
@modelcontextprotocol/sdk - Communicates with clients via standard input/output (stdio transport)
- Uses
axiosto send requests to the configured GraphQL endpoint - Exposes
introspectGraphQLSchematool for fetching the API schema - Exposes
executeGraphQLOperationtool for running queries or mutations
Use cases of mcp4gql
- Exploring a GraphQL API’s schema from within an MCP-enabled editor
- Running ad-hoc GraphQL queries or mutations without leaving the development environment
- Automating GraphQL operations through MCP workflows in Cursor or Claude Desktop
FAQ from mcp4gql
What tools does mcp4gql expose to MCP clients?
It exposes introspectGraphQLSchema to fetch the target API’s schema via introspection, and executeGraphQLOperation to execute arbitrary GraphQL queries or mutations with optional variables and operation name.
How do I configure mcp4gql for Cursor?
In Cursor MCP Settings, add a new global MCP server with the command npx -y mcp4gql and the required environment variables GRAPHQL_ENDPOINT and optional AUTH_TOKEN.
How do I configure mcp4gql for Claude Desktop?
In Claude Desktop settings, open Developer > Edit Config and add an entry under mcpServers using npx with -y mcp4gql as arguments and the same environment variables.
What dependencies does mcp4gql require?
It is a Node.js/TypeScript project that depends on @modelcontextprotocol/sdk, axios, and the standard Node.js runtime. It is run via npx, so Node.js must be installed.
How does authentication work with the target GraphQL API?
Authentication is optional. If the AUTH_TOKEN environment variable is set, the server includes an Authorization: Bearer <token> header in all GraphQL requests.
Frequently asked questions
What tools does mcp4gql expose to MCP clients?
It exposes `introspectGraphQLSchema` to fetch the target API’s schema via introspection, and `executeGraphQLOperation` to execute arbitrary GraphQL queries or mutations with optional variables and operation name.
How do I configure mcp4gql for Cursor?
In Cursor MCP Settings, add a new global MCP server with the command `npx -y mcp4gql` and the required environment variables `GRAPHQL_ENDPOINT` and optional `AUTH_TOKEN`.
How do I configure mcp4gql for Claude Desktop?
In Claude Desktop settings, open Developer > Edit Config and add an entry under `mcpServers` using `npx` with `-y mcp4gql` as arguments and the same environment variables.
What dependencies does mcp4gql require?
It is a Node.js/TypeScript project that depends on `@modelcontextprotocol/sdk`, `axios`, and the standard Node.js runtime. It is run via `npx`, so Node.js must be installed.
How does authentication work with the target GraphQL API?
Authentication is optional. If the `AUTH_TOKEN` environment variable is set, the server includes an `Authorization: Bearer <token>` header in all GraphQL requests.
Basic information
More Other MCP servers
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,

EverArt
modelcontextprotocolModel Context Protocol Servers
Nginx UI
0xJackyYet another WebUI for Nginx
FastMCP v2 🚀
jlowin🚀 The fast, Pythonic way to build MCP servers and clients.
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
Comments