This advanced Hasura GraphQL MCP server enables AI agents to interact with Hasura GraphQL endpoints through a rich set of tools. It provides capabilities for schema introspection, executing read-only queries and mutations, listing tables and their structures, previewing data samples, performing aggregations, and checking service health. The implementation handles authentication via admin secrets, performs basic security checks on operations, and exposes the complete GraphQL schema as a resource, making it ideal for AI assistants that need to dynamically discover and leverage database structures based on natural language requests.
No reviews yet. Be the first to review!
Sign in to join the conversation
Executes a read-only GraphQL query against the Hasura endpoint. Use this for fetching data when a specific tool isn't available. Ensure the query does not modify data. Example: `query { users { id name } }`. Input: `{ query: string, variables?: object }`.
Executes a GraphQL mutation to insert, update, or delete data. Use with caution, ensure the operation is intended and safe. Example: `mutation { insert_users_one(object: {name: "Test"}) { id } }`. Input: `{ mutation: string, variables?: object }`.
Lists available data tables (or collections) managed by Hasura, organized by schema with descriptions. Input: `{ schemaName?: string }`.
Shows the structure of a specific table including all its columns (fields) with their GraphQL types and descriptions. Input: `{ tableName: string, schemaName?: string }`.
Lists the available top-level query, mutation, or subscription fields from the GraphQL schema. Useful for understanding the primary entry points for operations. Input: `{ fieldType?: 'QUERY' | 'MUTATION' | 'SUBSCRIPTION' }`.
Provides details about a specific GraphQL type (Object, Input, Scalar, Enum, Interface, Union) using schema introspection. Input: `{ typeName: string }`.
Fetches a limited sample of rows (default 5) from a specified table to preview its data structure and content. Input: `{ tableName: string, limit?: number }`.
Performs a simple aggregation (count, sum, avg, min, max) on a specified table, optionally applying a Hasura 'where' filter. Input: `{ tableName: string, aggregateFunction: 'count'|'sum'|'avg'|'min'|'max', field?: string, filter?: object }`.
Checks if the configured Hasura GraphQL endpoint is reachable and responding to a basic GraphQL query (`{ __typename }`). Input: `{ healthEndpointUrl?: string }`.