Grafbase icon

Grafbase MCP Server

Turn your GraphQL API into an efficient MCP server with schema intelligence in a single command.

OfficialActiveHigh Popularity0.69 stars/dayUpdated 3 wk ago

Grafbase MCP server

This crate contains the implementation of the Model Context Protocol in Grafbase Gateway. You can find details on how to use it in the docs page.

Getting started

The Grafbase MCP server can be started with the Grafbase CLI by running:

npx grafbase mcp <url>

Where <url> is the URL of your GraphQL API.

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"
    }
  }
}

Setting up MCP in the Grafbase Gateway

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

Also see the integration tests.

EUMade in Europe

40+ AI models in one chat, from a German company.

Claude, ChatGPT and Gemini next to EU-hosted open models. Run by a German company; processing terms shown per model.

App herunterladen:

Laden im App StoreJetzt bei Google Play