GraphQL MCP server

Data and AI

Model Context Protocol server for GraphQL.

Your AI app calls the GraphQL MCP server, which does the data and AI work and sends the result back to the chat.

About GraphQL

GraphQL is a community MCP server from blurrah, filed in our directory under data and ai. Model Context Protocol server for GraphQL.

GraphQL runs on your own machine: your AI app starts it with the command npx -y mcp-graphql and talks to it over standard input and output.

At a glance

Publisher
blurrah (community)
Runs
Locally on your machine
Install from
Node.js package on npm: mcp-graphql
Written in
TypeScript
License
MIT
GitHub stars
408

How to set up GraphQL

  1. Install Node.js on the machine that runs your AI app, because GraphQL starts with npx and downloads its package on first run.
  2. Check the GraphQL README for keys or settings; the registry lists none that GraphQL requires.
  3. Add GraphQL to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the GraphQL tools to confirm the connection.
  5. Run one read-only task with GraphQL first, and keep your app asking before each tool call until the results look right.

GraphQL compared with similar servers

  • Nanobanana by zhongweili has fewer GitHub stars than GraphQL (408 against 408); both are community servers, and both run locally.
  • PageIndex by VectifyAI has more GitHub stars than GraphQL (412 against 408); both are community servers, and both run locally.
  • Data Go MCP Servers by Koomook has fewer GitHub stars than GraphQL (402 against 408); both are community servers, and both run locally.

Before you connect GraphQL

  • Give GraphQL its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each GraphQL tool call until you trust what it does with them.
  • Treat text that GraphQL fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for GraphQL on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for GraphQL

How marketing and sales teams put GraphQL to work, by company size. Pick the size closest to yours and start GraphQL on one use case.

Small business

  • A small team can use GraphQL to clean and enrich a lead list or a spreadsheet in one pass, instead of hours of copy and paste.
  • Owners can ask GraphQL to sort feedback, reviews or survey answers into themes and see what customers mention most.
  • GraphQL runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing ops can connect GraphQL to enrich and score inbound leads, so sales sees fit and intent before the first call.
  • Content and research teams can use GraphQL to analyze transcripts and surveys at scale and pull the quotes worth using.
  • Start GraphQL on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can run GraphQL inside their own cloud and data boundary, so models and data stay where governance requires.
  • Large teams can use GraphQL in batch pipelines with evaluation and logging, so AI output is measured before it reaches customers.
  • GraphQL is a community server, so have security review the code and pin a version before GraphQL touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

GraphQL README

From blurrah/mcp-graphql on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

mcp-graphql

A Model Context Protocol server that enables LLMs to interact with GraphQL APIs. This implementation provides schema introspection and query execution capabilities, allowing models to discover and use GraphQL APIs dynamically.

Usage

Run mcp-graphql with the correct endpoint, it will automatically try to introspect your queries.

Environment Variables (Breaking change in 1.0.0)

Note: As of version 1.0.0, command line arguments have been replaced with environment variables.

Environment Variable Description Default
ENDPOINT GraphQL endpoint URL http://localhost:4000/graphql
HEADERS JSON string containing headers for requests {}
ALLOW_MUTATIONS Enable mutation operations (disabled by default) false
NAME Name of the MCP server mcp-graphql
SCHEMA Path to a local GraphQL schema file or URL (optional) -
Examples
# Basic usage with a local GraphQL server
ENDPOINT=http://localhost:3000/graphql npx mcp-graphql

# Using with custom headers
ENDPOINT=https://api.example.com/graphql HEADERS='{"Authorization":"Bearer token123"}' npx mcp-graphql

# Enable mutation operations
ENDPOINT=http://localhost:3000/graphql ALLOW_MUTATIONS=true npx mcp-graphql

# Using a local schema file instead of introspection
ENDPOINT=http://localhost:3000/graphql SCHEMA=./schema.graphql npx mcp-graphql

# Using a schema file hosted at a URL
ENDPOINT=http://localhost:3000/graphql SCHEMA=https://example.com/schema.graphql npx mcp-graphql

Resources

  • graphql-schema: The server exposes the GraphQL schema as a resource that clients can access. This is either the local schema file, a schema file hosted at a URL, or based on an introspection query.

Available Tools

The server provides two main tools:

  1. introspect-schema: This tool retrieves the GraphQL schema. Use this first if you don't have access to the schema as a resource. This uses either the local schema file, a schema file hosted at a URL, or an introspection query.

  2. query-graphql: Execute GraphQL queries against the endpoint. By default, mutations are disabled unless ALLOW_MUTATIONS is set to true.

Installation

Installing via Smithery

To install GraphQL MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install mcp-graphql --client claude
Installing Manually

It can be manually installed to Claude:

{
    "mcpServers": {
        "mcp-graphql": {
            "command": "npx",
            "args": ["mcp-graphql"],
            "env": {
                "ENDPOINT": "http://localhost:3000/graphql"
            }
        }
    }
}

Security Considerations

Mutations are disabled by default as a security measure to prevent an LLM from modifying your database or service data. Consider carefully before enabling mutations in production environments.

Customize for your own server

This is a very generic implementation where it allows for complete introspection and for your users to do whatever (including mutations). If you need a more specific implementation I'd suggest to just create your own MCP and lock down tool calling for clients to only input specific query fields and/or variables. You can use this as a reference.

Questions about GraphQL

What is the GraphQL MCP server?

Model Context Protocol server for GraphQL. GraphQL is maintained by blurrah on GitHub at blurrah/mcp-graphql, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the GraphQL MCP server?

Add GraphQL to your AI app's MCP config with the command npx -y mcp-graphql. In Claude Code, run claude mcp add --transport stdio graphql -- npx -y mcp-graphql. To run GraphQL this way you need Node.js installed.

Does GraphQL need an API key?

The registry lists no required keys for GraphQL. Check the GraphQL README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is GraphQL an official MCP server?

No. GraphQL is a community server maintained by blurrah. Community servers can be excellent; read the code and the open issues before you give GraphQL access to company data.

What license is GraphQL under?

GraphQL is released under the MIT license, according to its GitHub repository. The license covers the code of GraphQL; the service it connects to has its own terms.