# Dbhawk

> Dbhawk is an open-source MCP server for databases. Governed database access for agents: schemas, queries and text-to-SQL via DBHawk. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/datasparc/dbhawk-mcp-plugin
- **MCP Registry name:** com.datasparc/dbhawk
- **Categories:** [databases](https://ai-powered.com/categories/databases), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-23

## About

This server is a thin bridge to the DBHawk database access platform, so an assistant can work with the datasources a user has been assigned. DBHawk stays in control: each statement is classified and checked against the MCP tier of the user's groups, with access control and column masking applied, and the default tier is read-only.

Tools list datasources, catalogs, schemas, objects and columns, show the caller's permissions, run read-only queries with a row cap, and explain a query plan without executing it. Depending on tier it can also list or kill database sessions and execute data or schema changes through a confirm flow, plus DBHawk AI features such as text-to-SQL, optimize and format.

Sign-in works either through the browser on first use (DBHawk 7.0.1 or later) or with a personal token exchanged for a short-lived JWT. It installs as a Claude Code plugin, a Claude Desktop .mcpb extension, or the npm package @dbhawk/mcp, and needs the base URL of your DBHawk instance.

## Features

- **Schema browsing:** Lists datasources, catalogs, schemas, objects and columns.
- **Governed queries:** Runs queries under the user's tier, access control and masking.
- **Query plans:** Explains a statement without running it.
- **AI SQL helpers:** Offers text-to-SQL, optimization and formatting.
- **Tiered writes:** Writes need a tier that allows them and a confirm step.
- **Browser or token sign-in:** Supports interactive login or a personal token.

## Good for

- Ask an assistant to describe tables in a datasource
- Draft SQL from a plain-language question
- Inspect an execution plan before running a query
- Review active sessions on a database

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add dbhawk --env DBHAWK_BASE_URL='<DBHAWK_BASE_URL>' --env DBHAWK_TOKEN='<DBHAWK_TOKEN>' -- npx -y @dbhawk/mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add dbhawk --env DBHAWK_BASE_URL='<DBHAWK_BASE_URL>' --env DBHAWK_TOKEN='<DBHAWK_TOKEN>' -- npx -y @dbhawk/mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.dbhawk]
command = "npx"
args = ["-y", "@dbhawk/mcp"]
env = { DBHAWK_BASE_URL = "<DBHAWK_BASE_URL>", DBHAWK_TOKEN = "<DBHAWK_TOKEN>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e DBHAWK_BASE_URL='<DBHAWK_BASE_URL>' -e DBHAWK_TOKEN='<DBHAWK_TOKEN>' dbhawk npx -- -y @dbhawk/mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "dbhawk": {
      "command": "npx",
      "args": [
        "-y",
        "@dbhawk/mcp"
      ],
      "env": {
        "DBHAWK_BASE_URL": "<DBHAWK_BASE_URL>",
        "DBHAWK_TOKEN": "<DBHAWK_TOKEN>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 15 tools change data; 4 names don't say. From the server's own tool labels and tool names; not verified by us.

- `list_datasources` (name suggests: reads): List datasources assigned to the user.
- `get_datasource` (name suggests: reads): Get one datasource.
- `list_catalogs` (name suggests: reads): List catalogs for MSSQL or Snowflake.
- `list_schemas` (name suggests: reads): List schemas.
- `list_objects` (name suggests: reads): List objects in a schema.
- `list_columns` (name suggests: reads): List columns of an object.
- `get_permissions` (name suggests: reads): Show the user's MCP tiers and limits.
- `run_query` (name suggests: changes): Run a read-only query with row caps.
- `explain_plan` (name suggests: reads): Show an execution plan without executing.
- `list_sessions` (name suggests: reads): List active database sessions.
- `kill_session`: End one listed session.
- `execute_statement` (name suggests: changes): Run a data or schema change if the tier allows.
- `text_to_sql`: Generate SQL from a question.
- `optimize_sql`: Optimize a SQL statement.
- `format_sql`: Format a SQL statement.

## FAQ

### Is Dbhawk read-only by default?

Yes, the default MCP tier is read-only.

### What do I need to connect?

The DBHawk base URL, plus a token or browser sign-in.

### Which DBHawk version supports browser login?

The README says 7.0.1 with the MCP connector.

### Can Dbhawk change data?

Only when the user's MCP tier allows it, and with confirmation.

### Is Dbhawk free?

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

### How do I add Dbhawk to Claude Code?

Run this command in your terminal: claude mcp add dbhawk --env DBHAWK_BASE_URL='<DBHAWK_BASE_URL>' --env DBHAWK_TOKEN='<DBHAWK_TOKEN>' -- npx -y @dbhawk/mcp

### What are the best alternatives to Dbhawk?

The closest alternatives to Dbhawk are REA, AiSOC, x64dbg-mcp-server, redamon and Treasure Map.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [AiSOC](https://ai-powered.com/mcp/aisoc): AiSOC is an open-source MCP server for ai models and llm tooling.
- [x64dbg-mcp-server](https://ai-powered.com/mcp/x64dbg-mcp-server): x64dbg-mcp-server is an open-source MCP server for ai models and llm tooling.
- [redamon](https://ai-powered.com/mcp/redamon): redamon is an open-source MCP server for ai models and llm tooling.
- [Treasure Map](https://ai-powered.com/mcp/treasure-map): Treasure Map is an open-source MCP server for security.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [NostrPulse](https://ai-powered.com/mcp/nostrpulse): NostrPulse is an open-source MCP server for finance and payments.
- [Runeward](https://ai-powered.com/mcp/runeward): Runeward is an open-source MCP server for developer tools.

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