GraphQL MCP Server
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 testLicense
MIT
Maintenance
Latest Blog Posts
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