Mcp4gql MCP Server

This project is a Node.js/TypeScript server that implements the Model Context Protocol (MCP). It acts as a bridge, allowing MCP clients (like Cursor)

Local serverstdioTypeScript

What is the Mcp4gql MCP server?

If you already use Mcp4gql, the mcp4gql mcp server is the piece that lets your assistant work with it directly. This project is a Node.js/TypeScript server that implements the Model Context Protocol (MCP). It acts as a bridge, allowing MCP clients (like Cursor) to interact with a target GraphQL API.

What the server does

  • MCP Server: — Implements the MCP Server class from @modelcontextprotocol/sdk
  • Stdio Transport: — Communicates with clients via standard input/output
  • GraphQL Client: — Uses axios to send requests to the configured GraphQL endpoint
  • Generic GraphQL Tools: — Exposes the following tools to MCP clients:
  • introspectGraphQLSchema: Fetches the target GraphQL API schema using introspection
  • executeGraphQLOperation: Executes arbitrary GraphQL queries or mutations against the target API, taking query, optional variables, and optional operationName as input

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • introspectGraphQLSchema — Fetches the target GraphQL API schema using introspection
  • executeGraphQLOperation — Executes arbitrary GraphQL queries or mutations against the target API, taking query, optional variables, and optional operationName as input
  • GRAPHQL_ENDPOINT — The URL of the target GraphQL API
  • AUTH_TOKEN — A bearer token for an optional Authorization: Bearer header for authenticating with the GraphQL API
  • Cursor — 1. Go to Cursor MCP Settings (Cursor > Settings > Cursor Settings > MCP) 2. Go to + Add new global MCP server 3. Add the following to your Cursor MCP

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Credentials and setup notes

Configuration is passed through the environment: GRAPHQL_ENDPOINT, AUTH_TOKEN, YOUR_GRAPHQL_ENDPOINT_URL, YOUR_OPTIONAL_AUTH_TOKEN. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Where it fits

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Mcp4gql's toolset — introspectGraphQLSchema, executeGraphQLOperation, GRAPHQL_ENDPOINT and 2 more — is a fair guide to whether it matches your workflow. It is maintained by jorgeraad; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
introspectGraphQLSchemaFetches the target GraphQL API schema using introspection.
executeGraphQLOperationExecutes arbitrary GraphQL queries or mutations against the target API, taking query, optional variables, and optional operationName as input.
GRAPHQL_ENDPOINTThe URL of the target GraphQL API.
AUTH_TOKENA bearer token for an optional Authorization: Bearer <token> header for authenticating with the GraphQL API.
Cursor1. Go to Cursor MCP Settings (Cursor > Settings > Cursor Settings > MCP) 2. Go to + Add new global MCP server 3. Add the following to your Cursor MCP configuration:

How to install the Mcp4gql MCP server

{
     "mcpServers": {
       "mcp4gql": {
         "command": "npx",
         "type": "stdio",
         "args": ["-y", "mcp4gql"],
         "env": {
           "GRAPHQL_ENDPOINT": "YOUR_GRAPHQL_ENDPOINT_URL",
           "AUTH_TOKEN": "YOUR_OPTIONAL_AUTH_TOKEN"
         }
       }
     }
   }

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
GRAPHQL_ENDPOINTConfiguration value read at startup.Optional
AUTH_TOKENCredential the server authenticates with.Yes
YOUR_GRAPHQL_ENDPOINT_URLEndpoint or connection string the server talks to.Yes
YOUR_OPTIONAL_AUTH_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • Use Mcp4gql to introspectGraphQLSchema.
  • Use Mcp4gql to executeGraphQLOperation.
  • Use Mcp4gql to GRAPHQL ENDPOINT.

Frequently asked questions

It connects Mcp4gql to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (introspectGraphQLSchema, executeGraphQLOperation, GRAPHQL_ENDPOINT, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mcp4gql directly.