run_graphql_queryLABSCO SUMMARY
Discovery tools first, because a model that guesses at a GraphQL schema wastes the call.
Half the tool set exists so the model can find out what is queryable before it writes a query — tables, columns, root fields, type definitions, and a five-row preview of real data. Mutations are deliberately a separate tool from queries, and the query tool rejects strings starting with mutation. Worth being deliberate about the admin secret: with it supplied, any mutation your Hasura permissions allow is available to the agent.
What it is
An MCP server for a Hasura GraphQL endpoint. It publishes the full introspected schema as a resource, and wraps discovery, reads, writes and aggregation as distinct tools so an agent can learn the API before calling it.
What you get
- The complete GraphQL schema is exposed as a readable resource at hasura:/schema, as JSON
- list_tables discovers available data sources, organised by schema with descriptions; describe_table returns one table's columns with their GraphQL types
- list_root_fields shows the top-level query, mutation and subscription entry points, optionally filtered by type; describe_graphql_type explains a specific object, input, scalar, enum, interface or union
- preview_table_data pulls a small sample — five rows by default — selecting the scalar and enum fields automatically
- aggregate_data runs count, sum, avg, min or max on a table, with an optional Hasura where filter
- run_graphql_query executes a read-only query; run_graphql_mutation is a separate tool for inserts, updates and deletes
- health_check confirms the endpoint answers a basic query, and can check a specific health URL if you have one
Requirements
Node.js v18 or higher and a reachable Hasura GraphQL endpoint. Build from a checkout with pnpm install and pnpm run build, then run node dist/index.js <HASURA_GRAPHQL_ENDPOINT> [ADMIN_SECRET] — the endpoint and optional admin secret are positional arguments, not environment variables. Without a secret it runs under Hasura's default role permissions.
Setup effort
Build from source
USE CASES
Getting oriented in an API you did not build
List the tables, describe the ones that matter, and read the root fields before writing anything.
Seeing what the data actually looks like
A small sample of real rows beats reading a schema and guessing.
Answering a counting question
Count, sum, average, min and max with a Hasura where filter, without hand-writing the aggregate query.
Running a query the tool set does not cover
A read-only GraphQL escape hatch, with mutations kept behind a separate tool.
Working out whether it is the endpoint or the query
A basic reachability check against the configured endpoint.
9 tools
Listed in project docs. Your client may show a different list.
run_graphql_mutationlist_tablesdescribe_tablelist_root_fieldsdescribe_graphql_typepreview_table_dataaggregate_datahealth_checkBEFORE YOU INSTALL
What to know first
Tools you get
9 tools named in the project's documentation.
Requires
Node.js
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/husamabusafa/hasura_mcp
cd hasura_mcp
pnpm install
pnpm run build
node dist/index.js <YOUR_HASURA_GRAPHQL_ENDPOINT> <YOUR_ADMIN_SECRET>MCP Clients
Claude Desktop
{
"mcpServers": {
"hasura-advanced": {
"command": "<YOUR_PATH_TO_NODE>",
"args": [
"<YOUR_PATH_TO_MCP_HASURA_ADVANCED>/dist/index.js",
"<YOUR_HASURA_ENDPOINT_URL>/v1/graphql",
"<YOUR_ADMIN_SECRET>"
]
}
}
}<YOUR_PATH_TO_NODE> is the output of which node, and <YOUR_PATH_TO_MCP_HASURA_ADVANCED> the absolute path of your clone. <YOUR_ADMIN_SECRET> is optional: delete that argument to run under your default role permissions.