continent
[GraphQL query: continent → Continent]
Turn a GraphQL schema into MCP tools — one tool per query, generated from the endpoint rather than hand-written.
LABSCO SUMMARY
This is a generic GraphQL-to-MCP bridge: the continent and language tools come from the public countries schema in its quick-start example, not from the product. Point it at your own endpoint and the tool list becomes yours. That design has a real advantage over hand-wrapping an API — the tools cannot drift from the schema, because they are the schema — and a real cost, which is that a large graph produces a large tool list riding along in every turn. Worth checking the query count before attaching it to something substantial.
A generator rather than a fixed integration: it reads a GraphQL endpoint's schema and exposes each query as its own tool, with the return type stated.
A GraphQL endpoint to point it at — the tool surface is derived from whatever schema that endpoint serves.
One command — npx graphql-to-mcp https://countries.trevorblades.com/graphql
USE CASES
Point it at the schema and get one tool per query with its return type, instead of hand-wrapping the endpoints you happen to think of.
New queries appear as new tools because the surface is generated from the schema rather than maintained alongside it.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
continent[GraphQL query: continent → Continent]
continents[GraphQL query: continents → [Continent!]!]
countries[GraphQL query: countries → [Country!]!]
country[GraphQL query: country → Country]
language[GraphQL query: language → Language]
languages[GraphQL query: languages → [Language!]!]
BEFORE YOU INSTALL
6 tools when we connected. Tools are generated from the GraphQL endpoint you connect; the six are the demo endpoint's schema. --include, --exclude and --mutation-safety change the list, and safe removes destructive mutations.
npx on PATH
All 3 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 6 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx graphql-to-mcp https://countries.trevorblades.com/graphql{
"mcpServers": {
"countries": {
"command": "npx",
"args": [
"-y",
"graphql-to-mcp",
"https://countries.trevorblades.com/graphql"
]
}
}
}This points at the public countries demo endpoint. For your own API, the URL is your GraphQL endpoint; if it needs a token, add "--bearer", "<YOUR_TOKEN>" after the URL (or "--api-key", "X-API-Key:<YOUR_KEY>:header"), and "--prefix", "<YOUR_NAME>" to keep tool names apart when you run several APIs.
{
"mcpServers": {
"countries": {
"command": "npx",
"args": [
"-y",
"graphql-to-mcp",
"https://countries.trevorblades.com/graphql"
]
}
}
}