mcp4gql - GraphQL MCP Server

by jorgeraad

3 stars
173 downloads
Not rated
GitHub

About

An MCP server that acts as a bridge, allowing MCP clients to interact with a target GraphQL API.

Details

Author
jorgeraad
GitHub stars
3
Downloads
173
Categories
Developer Tools, Other

- Implements the MCP Server class from @modelcontextprotocol/sdk
- Communicates with clients via standard input/output (stdio transport)
- Uses axios to send requests to the configured GraphQL endpoint
- Exposes introspectGraphQLSchema tool for fetching the API schema
- Exposes executeGraphQLOperation tool for running queries or mutations

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name mcp4gql - GraphQL MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

McpServers

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

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.

- MCP Server:Implements the MCPServerclass from@modelcontextprotocol/sdk.
- Stdio Transport:Communicates with clients via standard input/output.
- GraphQL Client:Usesaxiosto 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, takingquery, optionalvariables, and optionaloperationNameas input.

The server requires the following environment variables:

- GRAPHQL_ENDPOINT: The URL of the target GraphQL API.
- AUTH_TOKEN: A bearer token for an optionalAuthorization: Bearer <token>header for authenticating with the GraphQL API.

To allow clients like Cursor or Claude Desktop to use the tools provided by this server, you need to configure them to run thenpxcommand.
-

Go to Cursor MCP Settings (Cursor > Settings > Cursor Settings > MCP)

Add the following to your Cursor MCP configuration:

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

-

Open Claude Desktop settings (Claude > Settings).

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

Once configured, the MCP client should be able to list and call theintrospectGraphQLSchemaandexecuteGraphQLOperationtools provided by this server when relevant. Remember to set the required environment variables (GRAPHQL_ENDPOINTand optionallyAUTH_TOKEN) in the configuration so the server can connect to your API.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.