grafbase
The Grafbase GraphQL Federation Gateway
claude mcp add --transport stdio grafbase-grafbase ./grafbase-gateway --config grafbase.toml --schema /path/to/federated-schema.graphql \ --env GRAFBASE_ACCESS_TOKEN="token (for hybrid mode with Grafbase Cloud) or leave unset for fully self-hosted mode"
How to use
Grafbase provides a self-hosted, high-performance GraphQL Federation gateway with built-in MCP server support. It unifies multiple subgraphs, REST/grpc sources, and databases under a single federated schema, and exposes an MCP endpoint to efficiently manage model context for your GraphQL API. Use the grafbase-gateway binary to run the gateway locally or in your infrastructure, configuring it with a federation config file and a federated schema. The MCP capability lets you expose your GraphQL API as an MCP server with minimal setup, enabling clients to discover and interact with the API's Model Context Protocol endpoints as part of the gateway lifecycle. The gateway supports features like JWT authentication, authorization, request lifecycle hooks, and observability, making it suitable for mission-critical environments. To use, place your GraphQL federated schema and a grafbase.toml configuration, then start the gateway with the appropriate flags. The gateway will host your federated graph, apply your extensions, and expose MCP endpoints for consuming clients.
How to install
Prerequisites:
- A machine with Linux/macOS or Windows compatible with Docker or native binaries.
- Network access to pull binaries or run containers.
Installation steps (native binary):
- Download the Grafbase gateway binary (grafbase-gateway) from the official source or use the provided installer script: curl -fsSL https://grafbase.com/downloads/gateway | bash
- Verify the binary is executable: chmod +x grafbase-gateway
- Prepare your configuration files:
- grafbase.toml (gateway configuration)
- federated-schema.graphql (your federated GraphQL schema)
- Run the gateway with your config: ./grafbase-gateway --config grafbase.toml --schema /path/to/federated-schema.graphql
Installation steps (Docker):
- Pull the Grafbase gateway image: docker pull ghcr.io/grafbase/gateway:latest
- Run the container with your config and schema mounted:
docker run -p 4000:4000
-v $(pwd)/grafbase.toml:/etc/grafbase.toml
-v $(pwd)/schema.graphql:/etc/schema.graphql
ghcr.io/grafbase/gateway:latest
--config /etc/grafbase.toml
--schema /etc/schema.graphql
Notes:
- Replace /path/to/federated-schema.graphql and grafbase.toml with your actual file paths.
- If you intend to use hybrid mode with Grafbase Cloud, set GRAFBASE_ACCESS_TOKEN accordingly.
Additional notes
Tips and common issues:
- Ensure your federated schema is valid Apollo Federation v2 compatible for best results.
- If using MCP, define the server name in the mcp_config clearly and keep the port accessible to MCP clients.
- When running in hybrid mode, securely manage the Grafbase access token; rotate tokens as needed.
- Check gateway logs for startup errors related to config parsing or schema compatibility.
- For production, consider deploying behind a reverse proxy and enabling OpenTelemetry-based observability for traces and metrics.
Related MCP Servers
nexus
Govern & Secure your AI
rs-utcp
Official Rust implementation of the UTCP
offeryn
Build tools for LLMs in Rust using Model Context Protocol
mcp-protocol-sdk
[DEPRECATED] Moved to prism-mcp-rs - Enterprise-grade Rust MCP SDK
django-admin
Expose Django admin models to MCP (Model Context Protocol) clients. Add a mixin to your ModelAdmin classes and let AI assistants like Claude perform CRUD operations, execute admin actions, and explore relationships—all respecting Django's permission system.
attio
Model Context Protocol server for Attio CRM - enables Claude Desktop and Cursor to interact with your Attio workspace