# DBTrail MCP server

> Lets an AI client query MySQL row history, forensic change attribution, and undo SQL through read-only tools.

- Repository: https://github.com/dbtrail/bintrail
- Page: https://hostedmcp.org/servers/dbtrail/bintrail
- Official: yes
- Transport: remote
- Stars: 71
- License: Apache-2.0
- Latest version: 0.1.0

## Install

### Claude Code

```sh
claude mcp add --transport http bintrail https://api.dbtrail.com/mcp
```

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

```json
{
  "mcpServers": {
    "bintrail": {
      "url": "https://api.dbtrail.com/mcp"
    }
  }
}
```

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

```json
{
  "servers": {
    "bintrail": {
      "type": "http",
      "url": "https://api.dbtrail.com/mcp"
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"bintrail","type":"http","url":"https://api.dbtrail.com/mcp"}'
```

### Codex

```sh
codex mcp add bintrail --url https://api.dbtrail.com/mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.bintrail]
url = "https://api.dbtrail.com/mcp"
```

### Gemini CLI

```sh
gemini mcp add -s user --transport http bintrail https://api.dbtrail.com/mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "bintrail": {
      "url": "https://api.dbtrail.com/mcp",
      "type": "http"
    }
  }
}
```

## FAQ

### What can I ask an AI client to do with DBTrail?

You can ask in plain words what changed in your MySQL data, how a row looked at a past time, or for SQL that reverts an unwanted change. Its tools only read and never run SQL on your MySQL.

### Does DBTrail install anything on my MySQL server?

No. DBTrail reads the binlog over the replication protocol like a replica, so no plugin, agent, or triggers are needed.

### Can DBTrail undo a wrong change?

Yes. It keeps before and after images of every change and writes the SQL that undoes the changes you select. You review the generated SQL and run it yourself.

### What binlog settings does DBTrail require?

It needs a ROW-format binlog with full row images and a primary key on every InnoDB table. The connect form checks these settings and shows the fix.

### How up to date is the analytical copy?

The copy lags your MySQL by seconds in fresh mode and by minutes otherwise. Queries that must see a just-made write should stay on your MySQL.
