Model Context Protocol
MCP is a new protocol, launched in November 2024 by Anthropic, designed to make structured data explorable and actionable via natural language. Grafbase offers MCP support out of the box - removing the need to stand up your own standalone MCP server, configure authentication, or fine-tune access control.
The Grafbase MCP server can be started with the Grafbase CLI by running:
npx grafbase mcp <url>
The MCP server listens to requests at http://127.0.0.1:5000/mcp
by default. To add it to Cursor, create a .cursor/mcp.json
file in your project with the following:
{
"mcpServers": {
"my-graphql-api": {
"url": "http://127.0.0.1:5000/mcp"
}
}
}
The Grafbase Gateway can be configured to expose a MCP endpoint with the following grafbase.toml
configuration:
[mcp]
enabled = true # defaults to false
# Path at which to expose the MCP service
path = "/mcp"
# Whether mutations can be executed
execute_mutations = false