Model Context Protocol server for Hasura GraphQL Engine - enables natural language interaction with Hasura instances.
Docker Hub: sanjay3290/hasura-mcp Author: Sanjay Ramadugu License: Apache 2.0
An MCP server that enables AI assistants (Claude Desktop, etc.) to interact with Hasura GraphQL Engine for:
- Metadata management (export, apply, reload, clear)
- SQL query execution
- Schema introspection
- Interactive debugging and setup
# Pull the Docker image
docker pull sanjay3290/hasura-mcp:latest
# Run with your Hasura instance
docker run -i --rm \
--network host \
sanjay3290/hasura-mcp:latest \
--endpoint http://localhost:8080 \
--admin-secret your-secretFor remote Hasura instances, omit --network host:
docker run -i --rm \
sanjay3290/hasura-mcp:latest \
--endpoint https://your-hasura.com \
--admin-secret your-secretexport_metadata- Export current Hasura metadataapply_metadata- Apply metadata changesreload_metadata- Reload metadata from databaseclear_metadata- Clear all metadata (read-only mode blocks this)get_inconsistent_metadata- List metadata inconsistenciesdrop_inconsistent_metadata- Drop inconsistent metadata objectsrun_sql- Execute SQL queriesget_version- Get Hasura version informationget_schema- Get database schema information
hasura://metadata- Current metadata as JSONhasura://version- Hasura version detailshasura://schema- Database schema informationhasura://inconsistent-metadata- Current inconsistencies
setup_table- Interactive table setup wizarddebug_metadata- Metadata debugging assistantcreate_migration- Migration creation helpersetup_permissions- Permission configuration guide
The source code is maintained in the Hasura GraphQL Engine fork:
Repository: https://github.com/sanjay3290/graphql-engine
Location: cli/cmd/mcp-server/
This allows building from source while keeping the full Hasura CLI context available.
- Quick Start Guide - Get up and running in 5 minutes
- Claude Desktop Setup - Integrate with Claude Desktop
- Examples - Common usage patterns
- Troubleshooting - Common issues and solutions
- Contributing - How to contribute
- Base: Alpine Linux 3.19
- Size: ~41MB compressed
- User: Non-root (hasura:1000)
- Architecture: linux/amd64
- Tags:
latest,1.0.0
--endpoint, -e Hasura endpoint URL (required)
--admin-secret, -s Hasura admin secret (optional but recommended)
--read-only, -r Enable read-only mode (disables destructive operations)
--name, -n MCP server name (default: "hasura-mcp-server")
--version, -v Print version informationHASURA_GRAPHQL_ENDPOINT # Hasura endpoint URL
HASURA_GRAPHQL_ADMIN_SECRET # Admin secretCommand line flags take precedence over environment variables.
Enable read-only mode for production safety:
docker run -i --rm \
sanjay3290/hasura-mcp:latest \
--endpoint https://prod-hasura.com \
--admin-secret secret \
--read-onlyIn read-only mode, these operations are blocked:
apply_metadataclear_metadatadrop_inconsistent_metadata
"Export the current metadata and show me the tables configuration"
"What tables exist in the database and what are their relationships?"
"Check for any metadata inconsistencies and explain what they mean"
"Run a query to count users created in the last 7 days"
"Help me set up permissions for the users table with select access for user role"
- Issues: Report bugs or request features
- Discussions: Ask questions, share use cases
- Docker Hub: Download and view image details
Licensed under the Apache License 2.0 - see LICENSE file for details.
This MCP server is built using Hasura GraphQL Engine internal libraries:
- Hasura GraphQL Engine: Copyright (c) Hasura Inc. - Apache 2.0
- MCP-Go SDK: Copyright (c) 2024 Anthropic, PBC - MIT
This is a derivative work based on Hasura's open source code. All trademarks and product names are the property of their respective owners.
This is an independent community project, not officially affiliated with or endorsed by Hasura Inc.
See CHANGELOG.md for version history and updates.