# Nhost

> Nhost is an open-source MCP server for databases. Expose an Nhost GraphQL backend to AI assistants with per-user permissions intact. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted, API
- **Website:** https://docs.nhost.io/products/ai/mcp
- **Repository:** https://github.com/nhost/nhost/tree/HEAD/services/mcp
- **MCP Registry name:** io.github.nhost/mcp
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-14

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
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
```

### Claude Desktop (claude_desktop_config.json)

```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>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```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>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```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>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```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>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```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>"
      }
    }
  }
}
```

## Tools

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

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/nhost
