GraphQL MCP Server
Automatically introspects any GraphQL API schema and exposes all queries and mutations as MCP tools, enabling interaction with any GraphQL endpoint.
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 Servershow me all available queries from the schema"
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
A dynamic Model Context Protocol (MCP) server that automatically discovers and generates tools from any GraphQL API schema. Point it at any GraphQL endpoint and it instantly exposes every query and mutation as an MCP tool — zero manual configuration.
Documentation
For full documentation, guides, and examples, visit:
https://nife.io/mcp_opensource
Installation
pip install graphql-mcp-serverConfiguration
There are four ways to configure the server. They are applied in priority order — higher entries win:
Priority | Method | Best for |
1 | CLI arguments | One-off runs, testing |
2 | Environment variables | Docker, CI/CD, shell scripts |
3 |
| Local development |
4 | Defaults | Nothing required by default |
Method 1 — CLI Arguments
graphql-mcp-server --endpoint https://api.example.com/graphql --token mytokenAll available flags:
--endpoint URL GraphQL API endpoint (required if not set via env)
--token TOKEN API access token for authentication
--mode stdio|http Server mode (default: stdio)
--port PORT HTTP port, only used in http mode (default: 8080)
--host HOST HTTP host, only used in http mode (default: 0.0.0.0)
--log-level LEVEL Logging level: DEBUG, INFO, WARNING, ERROR (default: INFO)
--env-file PATH Path to a custom .env file
--version Show version and exitMethod 2 — Environment Variables
export GRAPHQL_ENDPOINT=https://api.example.com/graphql
export API_ACCESS_TOKEN=your_token_here
export MCP_MODE=stdio
graphql-mcp-serverMethod 3 — .env File
Create a .env file in your working directory:
GRAPHQL_ENDPOINT=https://api.example.com/graphql
API_ACCESS_TOKEN=your_token_here
MCP_MODE=stdio
LOG_LEVEL=INFOThen just run:
graphql-mcp-serverMethod 4 — Claude Desktop Config (most common for MCP use)
No .env file needed. Pass everything via the env block in claude_desktop_config.json:
{
"mcpServers": {
"graphql": {
"command": "graphql-mcp-server",
"env": {
"GRAPHQL_ENDPOINT": "https://api.example.com/graphql",
"API_ACCESS_TOKEN": "your_token_here",
"MCP_MODE": "stdio",
"ENABLE_HTTP_ENDPOINT": "false"
}
}
}
}Claude Desktop injects the env block values directly into the process — this is the standard MCP pattern.
Environment Variable Reference
Variable | Required | Default | Description |
| Yes | — | GraphQL API URL |
| No | — | Bearer token for auth |
| No |
|
|
| No |
| Enable HTTP health/metrics endpoints |
| No |
| HTTP server port |
| No |
| HTTP server host |
| No |
| Logging verbosity |
| No |
| Request timeout in seconds |
| No |
| Schema cache TTL in seconds |
Operating Modes
MCP Mode (stdio) — for Claude Desktop, Cursor, MCP clients
graphql-mcp-server --endpoint https://api.example.com/graphql --mode stdioCommunicates via stdin/stdout. No HTTP server is started. This is the default.
HTTP Mode — for Docker, Kubernetes, server deployments
graphql-mcp-server --endpoint https://api.example.com/graphql --mode http --port 8080Starts an HTTP server with health and metrics endpoints:
GET /health— health checkGET /metrics— server metricsGET /schema— schema summaryGET /tools— all generated tools
Docker
docker build -t graphql-mcp-server .
docker run -p 8080:8080 \
-e GRAPHQL_ENDPOINT=https://api.example.com/graphql \
-e API_ACCESS_TOKEN=your_token \
-e MCP_MODE=http \
graphql-mcp-serverOr with Docker Compose:
cp .env.example .env # fill in your values
docker-compose upKey Features
Zero config queries — auto-introspects any GraphQL schema and generates MCP tools
Dual mode — stdio for MCP clients, HTTP for server deployments
Flexible config — CLI args, env vars, .env file, or Claude Desktop env block
Production ready — Docker, Kubernetes, AWS ECS, Google Cloud Run compatible
Self-documenting —
list_available_queries,get_schema_info,get_query_signaturetools built inDocumentation — https://nife.io/mcp_opensource
Troubleshooting
[ERROR] GraphQL endpoint not configured
Set GRAPHQL_ENDPOINT via any method above. The most common fix:
graphql-mcp-server --endpoint https://your-api.com/graphqlPort already in use
Change the port:
graphql-mcp-server --mode http --port 9090Docker container exits immediately
Make sure you're using HTTP mode:
docker run -e MCP_MODE=http -e GRAPHQL_ENDPOINT=... graphql-mcp-serverResources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/nifetency/nife-mcp-graphql'
If you have feedback or need assistance with the MCP directory API, please join our Discord server