mcp-graphql
Model Context Protocol server for GraphQL
claude mcp add --transport stdio blurrah-mcp-graphql npx -y mcp-graphql \
--env NAME="mcp-graphql" \
--env SCHEMA="" \
--env HEADERS="{}" \
--env ENDPOINT="http://localhost:4000/graphql" \
--env ALLOW_MUTATIONS="false"How to use
mcp-graphql exposes a GraphQL-focused MCP server that lets language models discover and query GraphQL APIs. It supports automatic schema introspection and execution of GraphQL queries against a configured endpoint. Two core tools are available: introspect-schema, which retrieves and exposes the GraphQL schema (whether from a local schema file, a hosted schema, or via introspection), and query-graphql, which runs GraphQL queries against the endpoint. Mutations are disabled by default for safety, and can be enabled by setting ALLOW_MUTATIONS to true. To use the server, point it at your GraphQL endpoint via the ENDPOINT env var, optionally provide headers with HEADERS, and (if you have a local schema) specify SCHEMA. The NAME env var simply identifiers the MCP server in logs and UI.
How to install
Prerequisites:
- Node.js and npm installed on your machine
- npx available (comes with npm)
- Install via Smithery (automatic installation for Claude Desktop):
# Install mcp-graphql client for Claude via Smithery
npx -y @smithery/cli install mcp-graphql --client claude
- Manual installation (no Smithery):
- Ensure Node.js and npm are installed.
- Install and run the MCP server via npx (as shown in the README):
# Basic run using npx
ENDPOINT=http://localhost:4000/graphql npx mcp-graphql
- If you want to configure via a manifest file (recommended for integration):
{
"mcpServers": {
"mcp-graphql": {
"command": "npx",
"args": ["mcp-graphql"],
"env": {
"ENDPOINT": "http://localhost:3000/graphql"
}
}
}
}
Notes:
- The server expects environment-based configuration (ENDPOINT, HEADERS, ALLOW_MUTATIONS, SCHEMA, NAME).
- By default mutations are disabled for safety.
- You can provide a local or remote GraphQL schema via SCHEMA; if omitted, the server will introspect the endpoint.
Additional notes
Tips and considerations:
- Ensure your GraphQL endpoint is reachable from the host running the MCP server.
- If your GraphQL API requires authentication, populate HEADERS with a valid JSON string, e.g. {"Authorization": "Bearer token"}.
- If you need to enable mutations, set ALLOW_MUTATIONS=true, but be aware of potential security implications.
- If you have a static schema file, set SCHEMA to its path or URL for faster startup and consistent introspection results.
- The NAME env var helps identify the MCP server instance in logs and dashboards.
- When using npx, the first run may download the package; subsequent runs will reuse the local cache.
Related MCP Servers
leetcode
An MCP server enabling automated access to LeetCode's problems, solutions, and public data with optional authentication for user-specific features, supporting leetcode.com & leetcode.cn sites.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
hackmd
A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants.
ContextPods
Model Context Protocol management suite/factory. An MCP that can generate and manage other local MCPs in multiple languages. Uses the official SDKs for code gen.
filesystem
A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search/replace and directory tree traversal
google-scholar
An MCP server for Google Scholar written in TypeScript with Streamable HTTP