Get the FREE Ultimate OpenClaw Setup Guide →

hasura

Documentation and community resources for Hasura MCP Server - Model Context Protocol integration for Hasura GraphQL Engine

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sanjay3290-hasura-mcp-server docker run -i --rm --network host sanjay3290/hasura-mcp:latest --endpoint http://localhost:8080 --admin-secret your-secret

How to use

This MCP server exposes Hasura GraphQL Engine capabilities to AI assistants by wrapping common Hasura operations into MCP tools. You can export and manage metadata, run SQL queries, introspect the schema, and check for inconsistencies, all through natural language prompts. The tools include export_metadata, apply_metadata, reload_metadata, clear_metadata (read-only in production modes), run_sql, get_version, get_schema, and debugging or setup prompts for migrations, permissions, and metadata analysis. To use it, run the MCP server with your Hasura endpoint and admin secret, then issue prompts like: “Export the current metadata and show me the JSON,” or “Run a query to count new users in the last 7 days.” The server translates these prompts into Hasura operations, returning structured results that you can feed into further conversational flows.

How to install

Prerequisites:

  • Docker installed on your machine
  • Access to a Hasura GraphQL Engine endpoint and admin secret

Step-by-step:

  1. Pull the MCP server image (example uses Hasura MCP):

    docker pull sanjay3290/hasura-mcp:latest

  2. Run the MCP server connected to your Hasura instance:

    docker run -i --rm
    --network host
    sanjay3290/hasura-mcp:latest
    --endpoint http://localhost:8080
    --admin-secret your-secret

    If you are connecting to a remote Hasura instance, omit --network host and replace the endpoint:

    docker run -i --rm
    sanjay3290/hasura-mcp:latest
    --endpoint https://your-hasura.com
    --admin-secret your-secret

  3. Verify startup by checking logs or attempting a quick tool call like getting the Hasura version.

  4. Optional: configure environment variables or flags as needed for read-only mode or specific endpoints.

Additional notes

Tips and caveats:

  • Read-only mode blocks certain destructive operations (apply_metadata, clear_metadata, drop_inconsistent_metadata). Use --read-only when running in production.
  • Environment variables like HASURA_GRAPHQL_ENDPOINT and HASURA_GRAPHQL_ADMIN_SECRET can be used instead of flags, but command-line flags take precedence.
  • When using remote Hasura instances, prefer not to use --network host due to security and portability considerations.
  • The Docker image is based on Alpine and is non-root by default; ensure your environment allows non-root container execution.
  • For troubleshooting, consult the Documentation links in the repository (Quick Start, Claude Desktop, Examples, Troubleshooting).

Related MCP Servers

Sponsor this space

Reach thousands of developers