# DBA Brain

> DBA Brain is an open-source MCP server for databases. Database health checks, verified backups and safe SQL for AI agents on SQL Server. It can run locally on your machine or as a hosted remote server.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, Windows, macOS, Self-hosted, Web
- **Website:** https://dbabrain.dev/en/mcp/
- **Repository:** https://github.com/tanthanhkaka01/dba-brain
- **MCP Registry name:** dev.dbabrain/dbabrain
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-27

## About

DBA Brain gives Claude and other MCP clients a set of database operations that run on your own machine against your own instances. An agent asks for a check and gets back a graded verdict, then pulls evidence only for the items that came back as warnings or critical.

Credentials stay on the machine: a request names a server, and the login is filled from an encrypted local store, so the agent never sees a password. Ad-hoc queries run inside a transaction that is always rolled back, and changes are kept only when explicitly committed. Tools that alter state are marked destructive and require their own confirmation.

The same commands a DBA runs by hand are exposed to the agent, and each call is recorded with the tool, the server and the caller. It suits DBAs and DevOps teams who want an assistant to help with routine monitoring and restores without handing it a shell.

## Features

- **Graded health verdicts:** Checks return OK, WARNING or CRITICAL so the agent reads a summary before any raw evidence.
- **Credentials kept local:** Logins are read from an encrypted store on the machine, so requests never carry passwords or keys.
- **Rolled-back ad-hoc SQL:** Single SELECT queries always roll back, and write statements persist only when committed.
- **Backup and restore tools:** Covers backup, restore, log and differential handling, and restore verification.
- **Audit record of calls:** Every tool call is logged with the server and the requester in the local runtime store.
- **Two connection modes:** Works through claude.ai via an outbound link or locally over stdio with Claude Desktop or Claude Code.

## Good for

- Asking an assistant whether database instances are healthy before a release
- Verifying that last night's backups completed and can be restored
- Reviewing failed SQL Server Agent jobs and recent backup history
- Running read-only diagnostic queries without exposing credentials to the model
- Restoring a database to a test target as part of a recovery drill

## Install

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

```sh
claude mcp add --transport http dbabrain https://mcp.dbabrain.dev/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": {
    "dbabrain": {
      "type": "http",
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
https://mcp.dbabrain.dev/mcp
```

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "type": "http",
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
https://mcp.dbabrain.dev/mcp
```

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

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

```sh
codex mcp add dbabrain --url https://mcp.dbabrain.dev/mcp
```

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

```toml
[mcp_servers.dbabrain]
url = "https://mcp.dbabrain.dev/mcp"
```

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "httpUrl": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

Or run: gemini mcp add -s user --transport http dbabrain https://mcp.dbabrain.dev/mcp

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "serverUrl": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp",
      "transport": "http"
    }
  }
}
```

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": {
    "dbabrain": {
      "type": "streamableHttp",
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

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

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
https://mcp.dbabrain.dev/mcp
```

Enter a Name (for example "DBA Brain"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin.

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

```json
{
  "mcpServers": {
    "dbabrain": {
      "type": "http",
      "url": "https://mcp.dbabrain.dev/mcp"
    }
  }
}
```

## Tools

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

- `list-targets` (name suggests: reads): Lists registered database targets.
- `db-status` (name suggests: reads): Returns graded health status for an instance.
- `list-databases` (name suggests: reads): Lists databases on an instance.
- `describe-object` (name suggests: reads): Describes a database object.
- `list-jobs` (name suggests: reads): Lists scheduled jobs.
- `trace-session`: Inspects a trace session.
- `host-facts`: Returns facts about the host.
- `sqlserver-precheck`: Runs a SQL Server precheck.
- `run-sql` (name suggests: changes): Runs one SELECT, rolled back.
- `run-sql-write` (name suggests: changes): Runs a write kept only with commit.
- `kill-spid`: Terminates a session.
- `backup-database`: Backs up a database.
- `list-backup-files` (name suggests: reads): Lists backup files.
- `restore-full`: Restores a full backup.
- `restore-diff`: Restores a differential backup.
- `restore-log`: Restores a log backup.
- `verify-restore`: Verifies a restore.
- `store_schema`: Read-only view of the store schema.
- `store_query` (name suggests: reads): Read-only query of the dbabrain store.

## FAQ

### Do I need a dbabrain key to use DBA Brain?

The machine needs a free dbabrain key to link with the hosted connector. Without a linked machine, an account gets a read-only lab demo.

### Are passwords sent to the AI model?

No. A request names a server_id and the machine fills the login from its encrypted store. Requests carrying a password, key or token are refused.

### Which database engines are supported?

SQL Server, PostgreSQL, Oracle and MySQL, though the project notes MySQL has less production history so far.

### How are write operations handled?

run-sql-write keeps a change only when commit is given. Tools that change something are marked destructive and ask for their own confirmation.

### Is DBA Brain free?

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

### How do I add DBA Brain to Claude Code?

Run this command in your terminal: claude mcp add --transport http dbabrain https://mcp.dbabrain.dev/mcp

### What are the best alternatives to DBA Brain?

The closest alternatives to DBA Brain are SQL Server DBA (read-only), codeDB Lens, DBGorilla, Dbridge MCP and Db Access MCP.

## Where this comes from

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

## Alternatives

- [SQL Server DBA (read-only)](https://ai-powered.com/mcp/sql-server-dba-read-only): SQL Server DBA (read-only) is an open-source MCP server for databases.
- [codeDB Lens](https://ai-powered.com/mcp/codedb-lens): codeDB Lens is a free MCP server for databases.
- [DBGorilla](https://ai-powered.com/mcp/dbgorilla): DBGorilla is a freemium MCP server for databases.
- [Dbridge MCP](https://ai-powered.com/mcp/dbridge-mcp): Dbridge MCP is an open-source MCP server for databases.
- [Db Access MCP](https://ai-powered.com/mcp/db-access-mcp): Db Access MCP is an open-source MCP server for databases.
- [Dbboard](https://ai-powered.com/mcp/dbboard): Dbboard is an open-source MCP server for databases.
- [Custom MCP Database](https://ai-powered.com/mcp/custom-mcp-database): Custom MCP Database is an open-source MCP server for databases.
- [SQL Server](https://ai-powered.com/mcp/sql-server): SQL Server is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/dba-brain
