GraphQL MCP Server
The GraphQL MCP Server enables AI agents to connect to any GraphQL endpoint, introspect its schema, and execute queries and mutations. Key capabilities include:
Connection & Configuration
Connect to any GraphQL endpoint, with configurable request timeouts
Authenticate via Bearer tokens, HTTP Basic auth (username/password), or custom HTTP headers (add, remove, or replace)
Check connection status — including endpoint config, masked secrets, auth state, and schema cache — with an optional live ping to verify reachability
Schema Introspection & Exploration
Fetch and cache the full GraphQL schema via introspection
List all types with filtering by kind (OBJECT, SCALAR, ENUM, etc.) or name substring
Describe any type in detail — fields, arguments, return types, interfaces, enum values, and input fields
List root query, mutation, and subscription fields (subscriptions are informational only; not executable over HTTP)
Describe individual fields including arguments, deprecation info, and return types
Search the entire schema for types, fields, input fields, and enum values by substring
Query & Mutation Execution
Execute raw GraphQL query or mutation strings with optional variables and operation names
Execute queries or mutations by field name only — the server automatically constructs the GraphQL string and selection set
Cache Management
Retrieve the cached schema as JSON for bulk inspection
Clear the schema cache for a specific endpoint or all endpoints
Force a fresh schema reload when the remote schema may have changed
Reliability
Automatic retries with backoff for transient errors
Output sanitization to prevent prompt injection
Connects to any GraphQL endpoint, providing tools to introspect schemas, execute queries and mutations, search types and fields, and manage connections with authentication and caching.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GraphQL MCP Serverintrospect the schema at https://api.example.com/graphql"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GraphQL MCP Server
MCP server for GraphQL — schema introspection, auto-generated tools, query/mutation execution for Claude, Cursor, and AI agents.
What It Does
Connects to any GraphQL endpoint and gives AI agents the ability to:
Introspect schemas — discover all types, queries, mutations, and subscriptions
Execute queries and mutations — raw GraphQL strings or typed field-based calls
Search and explore — find types, fields, and arguments across the schema
Manage connections — switch endpoints, configure auth, cache schemas
Related MCP server: Advanced Hasura GraphQL MCP Server
Quick Start
npx @supernova123/graphql-mcp-serverSet your endpoint via environment variable:
GRAPHQL_ENDPOINT=https://your-api.com/graphql npx @supernova123/graphql-mcp-serverOr configure at runtime with the connect_endpoint tool.
Tools (20)
Connection & Configuration
Tool | Description |
| Set or change the active GraphQL endpoint |
| Configure Bearer token authentication |
| Configure HTTP Basic authentication |
| Replace custom HTTP headers |
| Add/update a single header |
| Remove a header |
| Show endpoint config, auth state, and schema cache |
Schema Introspection
Tool | Description |
| Fetch the full schema via introspection |
| List all types (filter by kind or name) |
| Get full details of a single type |
| List all root query fields |
| List all root mutation fields |
| List all root subscription fields |
| Get full details of a field |
| Search types and fields by substring |
Execution
Tool | Description |
| Send a raw GraphQL query |
| Send a raw GraphQL mutation |
| Execute a query by field name (auto-constructed) |
| Execute a mutation by field name (auto-constructed) |
Cache Management
Tool | Description |
| Return the cached introspection result |
| Clear schema cache |
| Force a fresh introspection |
Environment Variables
Variable | Description | Default |
| GraphQL endpoint URL | (none — must configure at runtime) |
| Bearer token for Authorization header | (none) |
| Basic auth username | (none) |
| Basic auth password | (none) |
| Request timeout in milliseconds | 30000 |
| Custom headers (e.g. | (none) |
Configuration (Claude Desktop)
{
"mcpServers": {
"graphql": {
"command": "npx",
"args": ["-y", "@supernova123/graphql-mcp-server"],
"env": {
"GRAPHQL_ENDPOINT": "https://your-api.com/graphql",
"GRAPHQL_AUTH_TOKEN": "***"
}
}
}
}Features
No external GraphQL library — minimal dependency surface, works at the HTTP layer
Schema caching — introspect once, reuse across tool calls
Retry with backoff — transient errors (5xx, 429, timeouts) are retried automatically
Output sanitization — ANSI stripping and length capping prevent prompt injection
Type-safe — TypeScript with Zod validation on all tool inputs
Auth flexibility — Bearer tokens, Basic auth, or arbitrary HTTP headers
Development
npm install
npm run build
npm testBlog Posts
Real data from building and running this server:
What 6,000 npm Downloads Taught Me — distribution and growth data
The MCP Server Naming Playbook — how naming affects discoverability
License
MIT
Maintenance
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/friendlygeorge/graphql-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server