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. Run mcp-graphql with the correct endpoint, it will automatically try to introspect your queries. - graphql-schema: The server exposes the GraphQL schema as a resource that c
Add this skill
npx mdskills install blurrah/mcp-graphqlWell-documented GraphQL MCP server with clear setup, security defaults, and flexible configuration options.
1# mcp-graphql23[](https://smithery.ai/server/mcp-graphql)45A 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.67<a href="https://glama.ai/mcp/servers/4zwa4l8utf"><img width="380" height="200" src="https://glama.ai/mcp/servers/4zwa4l8utf/badge" alt="mcp-graphql MCP server" /></a>89## Usage1011Run `mcp-graphql` with the correct endpoint, it will automatically try to introspect your queries.1213### Environment Variables (Breaking change in 1.0.0)1415> **Note:** As of version 1.0.0, command line arguments have been replaced with environment variables.1617| Environment Variable | Description | Default |18|----------|-------------|---------|19| `ENDPOINT` | GraphQL endpoint URL | `http://localhost:4000/graphql` |20| `HEADERS` | JSON string containing headers for requests | `{}` |21| `ALLOW_MUTATIONS` | Enable mutation operations (disabled by default) | `false` |22| `NAME` | Name of the MCP server | `mcp-graphql` |23| `SCHEMA` | Path to a local GraphQL schema file or URL (optional) | - |2425### Examples2627```bash28# Basic usage with a local GraphQL server29ENDPOINT=http://localhost:3000/graphql npx mcp-graphql3031# Using with custom headers32ENDPOINT=https://api.example.com/graphql HEADERS='{"Authorization":"Bearer token123"}' npx mcp-graphql3334# Enable mutation operations35ENDPOINT=http://localhost:3000/graphql ALLOW_MUTATIONS=true npx mcp-graphql3637# Using a local schema file instead of introspection38ENDPOINT=http://localhost:3000/graphql SCHEMA=./schema.graphql npx mcp-graphql3940# Using a schema file hosted at a URL41ENDPOINT=http://localhost:3000/graphql SCHEMA=https://example.com/schema.graphql npx mcp-graphql42```4344## Resources4546- **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.4748## Available Tools4950The server provides two main tools:51521. **introspect-schema**: This tool retrieves the GraphQL schema. Use this first if you don't have access to the schema as a resource.53This uses either the local schema file, a schema file hosted at a URL, or an introspection query.54552. **query-graphql**: Execute GraphQL queries against the endpoint. By default, mutations are disabled unless `ALLOW_MUTATIONS` is set to `true`.5657## Installation5859### Installing via Smithery6061To install GraphQL MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-graphql):6263```bash64npx -y @smithery/cli install mcp-graphql --client claude65```6667### Installing Manually6869It can be manually installed to Claude:70```json71{72 "mcpServers": {73 "mcp-graphql": {74 "command": "npx",75 "args": ["mcp-graphql"],76 "env": {77 "ENDPOINT": "http://localhost:3000/graphql"78 }79 }80 }81}82```8384## Security Considerations8586Mutations 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.8788## Customize for your own server8990This 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.91
Full transparency — inspect the skill content before installing.