Grafbase is a self-hosted, Rust-powered GraphQL Federation Gateway designed for high-performance, mission-critical applications. It helps unify microservices, legacy systems, and third-party APIs with superior speed and built-in Model Context Protocol (MCP) server support to turn your GraphQL API into a full-fledged MCP server.
To install the Grafbase Gateway, run the following command:
curl -fsSL https://grafbase.com/downloads/gateway | bash
You can also deploy Grafbase using Docker:
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
Grafbase Gateway can be deployed in two primary modes:
Connect to Grafbase Cloud with a graph reference and organization access token:
GRAFBASE_ACCESS_TOKEN=token ./grafbase-gateway \
--config grafbase.toml \
--graph-ref graph@branch
Run completely self-contained with a local schema file:
./grafbase-gateway \
--config /path/to/grafbase.toml \
--schema /path/to/federated-schema.graphql \
--listen-address 127.0.0.1:4000
Grafbase provides native support for Apollo Federation v2 specification with 40% faster performance thanks to its Rust-powered engine.
Connect to various data sources through GraphQL Federation:
Customize functionality with WebAssembly extensions:
# Create a custom authentication extension
grafbase extension init --type authentication auth-guard
cd auth-guard
# Build and install
grafbase extension build
grafbase extension install
Extension use cases include:
For a complete introduction to Grafbase and GraphQL Federation, refer to the getting started guide at grafbase.com/guides/introduction-to-graphql-federation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "grafbase" '{"command":"npx","args":["-y","grafbase"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"grafbase": {
"command": "npx",
"args": [
"-y",
"grafbase"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"grafbase": {
"command": "npx",
"args": [
"-y",
"grafbase"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect