Get the FREE Ultimate OpenClaw Setup Guide →

mcp-graphql-tools

GraphQL MCP server for AI assistants

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio saewoohan-mcp-graphql-tools npx -y mcp-graphql-tools --endpoint=https://api.github.com/graphql --headers={"Authorization":"Bearer YOUR_GITHUB_TOKEN"} --timeout=30000 --maxComplexity=100

How to use

This MCP server exposes GraphQL tooling through two main tools: graphql_query and graphql_introspect. graphql_query lets you execute arbitrary GraphQL queries against a specified endpoint, with optional variables, custom headers, a request timeout, and a flag to allow or disallow mutations. graphql_introspect enables you to fetch and explore the GraphQL schema from a given endpoint, with options to provide headers and to include deprecated types and fields in the results. These tools are designed to help AI assistants interact with GraphQL APIs in a structured, automated way by standardizing input parameters and responses.

To use these tools, run the server via NPX as shown in the example configuration. Once running, you can invoke graphql_query by supplying a query string, an optional variables object, a target endpoint, optional headers, and other controls like timeout and allowMutations. For schema exploration, use graphql_introspect with the endpoint and headers to retrieve the schema, then iteratively inspect types, fields, and deprecations to guide subsequent queries.

How to install

Prerequisites:\n- Node.js and npm or npx installed on your system. You may verify with node -v and npm -v.\n\nInstallation steps:\n1) Ensure you have access to the npm registry (or a network path that can reach npm).\n2) You do not need to install a global package for this MCP server; it is intended to be run via NPX as shown in the configuration. If you want to install the underlying tool locally, you can run:\n\n npm install -g mcp-graphql-tools\n\n3) Run the MCP server using the configuration example: use NPX with the provided arguments, for example:\n\n npx -y mcp-graphql-tools --endpoint=https://api.github.com/graphql --headers={"Authorization":"Bearer YOUR_GITHUB_TOKEN"} --timeout=30000 --maxComplexity=100\n\n4) Ensure you replace YOUR_GITHUB_TOKEN with a valid token or adjust headers as needed.\n\nPrerequisites recap: Node.js environment, network access to the GraphQL endpoint, and any required authentication tokens for the target endpoint.

Additional notes

Tips and notes: - The endpoint and headers are configurable per invocation; the defaults shown are examples (GitHub GraphQL API). - Headers must be provided as a JSON string; ensure proper escaping in your shell or JSON configuration. - The maxComplexity option helps prevent expensive queries; tune it based on your API capacity. - If using introspection, you may want to include deprecated types to understand legacy parts of the schema. - When using NPX, you’re running the package without a global install, which is convenient for ephemeral or CI usage. - If you encounter network or authentication errors, verify token validity, endpoint accessibility, and firewall rules.

Related MCP Servers

Sponsor this space

Reach thousands of developers