Skip to content
MCP server

Nhost

Expose an Nhost GraphQL backend to AI assistants with per-user permissions intact

Install
Pricing
Open source
Platforms
self-hosted, API
Runs
Remotely
Version
0.4.0-beta2
Listing updated
3 days ago

About Nhost

Nhost is an open-source MCP server for databases. It runs as a hosted remote server, so there is nothing to install locally.

This is Nhost's backend MCP service, aimed at developers who want their own app's users to talk to their data through Claude or Cursor. It wraps the project's GraphQL API, so there are no per-operation tools to write. Users sign in through Nhost Auth acting as an OAuth2 server, receive a JWT, and every GraphQL call carries it so the engine applies that user's row-level and column-level permissions.

Three tools do the work: get-schema introspects the model, graphql-query runs read-only queries and graphql-mutation creates, updates or deletes. The server puts a schema summary in its instructions at startup, and operators can add application guidance through MCP_INSTRUCTIONS or override tool descriptions. An --enforce-role flag accepts only tokens with a given default role, such as a read-only user_mcp role. The README notes that CIMD must be enabled in Nhost Auth.

It is a small open-source Go service, run alongside your project (typically via Nhost Run) or as the nhost/mcp container image with MCP_GRAPHQL_ENDPOINT and MCP_AUTH_URL set. A separate CLI MCP exists for managing Nhost projects.

Install

Run in a terminal

claude mcp add mcp --env MCP_GRAPHQL_ENDPOINT='<MCP_GRAPHQL_ENDPOINT>' --env MCP_AUTH_URL='<MCP_AUTH_URL>' -- docker run -i --rm -e MCP_GRAPHQL_ENDPOINT -e MCP_AUTH_URL docker.io/nhost/mcp:0.4.0-beta2

Add to claude_desktop_config.json

{
  "mcpServers": {
    "mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GRAPHQL_ENDPOINT",
        "-e",
        "MCP_AUTH_URL",
        "docker.io/nhost/mcp:0.4.0-beta2"
      ],
      "env": {
        "MCP_GRAPHQL_ENDPOINT": "<MCP_GRAPHQL_ENDPOINT>",
        "MCP_AUTH_URL": "<MCP_AUTH_URL>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GRAPHQL_ENDPOINT",
        "-e",
        "MCP_AUTH_URL",
        "docker.io/nhost/mcp:0.4.0-beta2"
      ],
      "env": {
        "MCP_GRAPHQL_ENDPOINT": "<MCP_GRAPHQL_ENDPOINT>",
        "MCP_AUTH_URL": "<MCP_AUTH_URL>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GRAPHQL_ENDPOINT",
        "-e",
        "MCP_AUTH_URL",
        "docker.io/nhost/mcp:0.4.0-beta2"
      ],
      "env": {
        "MCP_GRAPHQL_ENDPOINT": "<MCP_GRAPHQL_ENDPOINT>",
        "MCP_AUTH_URL": "<MCP_AUTH_URL>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GRAPHQL_ENDPOINT",
        "-e",
        "MCP_AUTH_URL",
        "docker.io/nhost/mcp:0.4.0-beta2"
      ],
      "env": {
        "MCP_GRAPHQL_ENDPOINT": "<MCP_GRAPHQL_ENDPOINT>",
        "MCP_AUTH_URL": "<MCP_AUTH_URL>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_GRAPHQL_ENDPOINT",
        "-e",
        "MCP_AUTH_URL",
        "docker.io/nhost/mcp:0.4.0-beta2"
      ],
      "env": {
        "MCP_GRAPHQL_ENDPOINT": "<MCP_GRAPHQL_ENDPOINT>",
        "MCP_AUTH_URL": "<MCP_AUTH_URL>"
      }
    }
  }
}

Configuration

  • MCP_GRAPHQL_ENDPOINTGraphQL endpoint of the Nhost project the server exposes, e.g. http://hasura-service:8080/v1/graphqlRequired
  • MCP_AUTH_URLNhost Auth URL used as the OAuth2 authorization server, e.g. https://SUBDOMAIN.auth.REGION.nhost.run/v1Required

Tools this server provides (3)

Taken from the project documentation; the running server may differ.

get-schema
Introspects the GraphQL schema
graphql-query
Executes read-only GraphQL queries
graphql-mutation
Executes GraphQL mutations to create, update or delete data

What it does

GraphQL as tools
Query and mutate your GraphQL API without writing tools.
Per-user auth
OAuth2 via Nhost Auth with PKCE and a JWT.
Existing permissions
Row and column permissions apply to each request.
Role enforcement
--enforce-role limits tokens to a dedicated role.
Custom instructions
MCP_INSTRUCTIONS guides how assistants use the app.
Self-hostable
Small Go service, also shipped as a container image.

Good for

  • Let app users ask about their own orders in Claude
  • Give an assistant read-only access via a dedicated role
  • Let users cancel an order by chat where mutations are allowed
  • Expose a GraphQL backend to Cursor without custom tools

Pricing

Open source

Open-source Go service

Prices change. Check docs.nhost.io before you buy.

Nhost FAQ

What tools does it expose?

get-schema, graphql-query and graphql-mutation.

How is access limited?

Every request runs as the signed-in user, so existing permissions apply.

Can I make it read-only?

Yes, with --enforce-role and a role granting only read permissions.

What must be configured?

MCP_GRAPHQL_ENDPOINT and MCP_AUTH_URL, and CIMD enabled in Nhost Auth.

Is Nhost free?

Yes. Nhost is open source, so you can use and self-host it for free.

How do I add Nhost to Claude Code?

Run this command in your terminal: claude mcp add mcp --env MCP_GRAPHQL_ENDPOINT='<MCP_GRAPHQL_ENDPOINT>' --env MCP_AUTH_URL='<MCP_AUTH_URL>' -- docker run -i --rm -e MCP_GRAPHQL_ENDPOINT -e MCP_AUTH_URL docker.io/nhost/mcp:0.4.0-beta2

What are the best alternatives to Nhost?

The closest alternatives to Nhost are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to Nhost

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools