What the dbtrail MCP server does
The dbtrail MCP server gives an MCP client read-only access to DBTrail’s captured MySQL history and analytical copy. DBTrail records row changes from the source database’s binlog, creates Parquet snapshots, and provides access to those records through its web interface and MCP tools.
An AI client can ask questions in plain language about captured data, browse changes, inspect a row or table as it existed at an earlier time, and compare historical states. The same captured stream supports recovery analysis: DBTrail can generate SQL that reverses selected damaged rows, while operators review and execute that SQL themselves.
The analytical copy is separate from the production MySQL server. Queries run with DuckDB against Parquet data, so reporting and investigation do not execute on the MySQL primary. DBTrail also supports exporting a snapshot to Iceberg for engines such as Spark, Trino, or Athena, although that export is separate from the MCP interface.
How it works
DBTrail initially copies the source tables with mydumper. It then connects using the MySQL replication protocol and consumes the binlog, without requiring a database plugin, a host agent, or binlog files stored on disk. Scheduled refreshes fold captured changes into new Parquet snapshots; the schedule can range from every five minutes to once per day.
A generated views.sql exposes source-like table names in DuckDB and applies the current snapshot together with its change files. The MCP interface sits alongside the web application, where users can add database servers, schedule snapshots, and browse captured changes. Every MCP tool is read-only.
Setup and configuration
Install Docker with Compose and DuckDB on the machine used for querying. The supplied installation command downloads and starts the Docker Compose stack, waits for DBTrail to respond, and prints the next steps. Open the local web interface at http://127.0.0.1:8090, create a username and password, then add a source server.
The source must provide a ROW-format binlog with full row images: binlog_format=ROW and binlog_row_image=FULL. bintrail doctor checks these settings and reports the required correction. Amazon RDS and Aurora use parameter groups for these settings.
After installation, connect Claude Desktop or another MCP client through DBTrail’s documented connection flow.
Tools and capabilities
- Ask plain-language questions through an MCP client.
- Browse captured database changes.
- Inspect a row or table at a historical point in time.
- Compare what changed between two points in history.
- Add database servers and schedule snapshots through the DBTrail interface.
- Review recovery SQL for selected damaged rows.
- Use
recover-cascade to reconstruct many child rows removed by cascading deletes.
- Run
bintrail verify to check whether a recovery would reproduce the recorded state.
- Use
bintrail status to identify gaps in captured history.
Limitations and notes
The dbtrail MCP server is not a high-availability mechanism, backup, or replacement for a MySQL application connection. The analytical copy is minutes behind the source according to its refresh schedule, and history begins when DBTrail is installed. Physical backups remain necessary.
Schema changes such as adding, dropping, renaming, or retyping a column, along with table truncation, dropping, or renaming, can pause scheduled updates until DBTrail performs another database read. That read can take a short lock. Without S3, row history is retained for 48 hours by default, while local storage keeps the newest three snapshots per table.
Cascaded deletes are not fully present in the binlog before MySQL 9.6 and on MariaDB. DBTrail can rebuild many of those rows with recover-cascade, but this has boundaries. The optional MySQL-compatible time-travel port is beta and has no TLS; it answers historical-state questions rather than serving general reports. Supported sources include MySQL, Percona Server for MySQL, Amazon RDS for MySQL, Aurora MySQL, and MariaDB. PostgreSQL 14 and later support a one-time copy, with scheduled updates not yet available and history marked beta.