DBCrust CLI

A database CLI for dozens of engines with an agent mode: JSON output, a read-only guard, limits and a broker that hides passwords

  • 92 ★ on the repository
  • Last commit
  • MIT
CLI

Broad access

Why this level

  • Connects to databases by URL and runs arbitrary SQL, and without `--read-only` writes change data
  • Stores saved connections and passwords, supports SSH tunnels and Vault credentials
  • The broker is installed as a system service with superuser rights
All reasons and checks

clement-tourriere/dbcrust

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/dbcrust

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Connects to databases by URL and runs arbitrary SQL, and without `--read-only` writes change data
  • Stores saved connections and passwords, supports SSH tunnels and Vault credentials
  • The broker is installed as a system service with superuser rights

This is third-party code. Review the repository files before installing.

What it does

DBCrust is a psql-style terminal client that gives one shell for PostgreSQL, MySQL, SQLite, ClickHouse, MongoDB, Elasticsearch, Redis, SQL Server, DuckDB and other engines. A connection is a URL, and Parquet, CSV and JSON files are readable with SQL without importing. Two binaries are installed: `dbcrust` and the short `dbc`. For agents there is a one-shot mode. `dbcrust session://prod --read-only --no-input -o json -c "SELECT ..."` prints the result to stdout as a single JSON line, errors go to stderr, and exit codes are stable: 0 success, 1 SQL error, 2 bad usage, 3 connection, 4 query stopped by the `--read-only` guard. `--timeout` and `--max-rows` bound a query. `dbcrust agents` prints the full contract, and a ready snippet for `CLAUDE.md` and `AGENTS.md` is in the docs. When an agent must not hold a password, the connection is enrolled in the credential broker (`dbcrust broker`). The agent gets the passwordless `dbcrust-agent` client, as a CLI or an MCP server, and the broker enforces read-only mode, row and time limits and keeps an audit log. The AI helper in the interactive session is off by default.

Who it is for. Backend developers and analysts who let Claude Code or Codex read production databases, and teams where passwords must stay away from agents.

Good fit when

  • The agent needs the schema in one call: `dbcrust session://prod -c '\ddl'` prints it as compact DDL
  • A Parquet or CSV export sits on disk and you want a slice computed with SQL, no import
  • An agent reads a production database and the password must not reach its context: the broker and `dbcrust-agent` handle that
  • You want one tool for PostgreSQL, ClickHouse and Redis instead of separate clients
  • A Django project is slow and you need to find N+1 queries and missing `select_related` before release

Not a fit when

  • You need a long-running MCP server with ready tools per table: DBCrust is built around CLI calls
  • You need a hard guarantee against writes: `--read-only` is described as a best-effort guard, and a read-only database role is the reliable option
  • You need AWS sources (DynamoDB, CloudWatch, S3) in the stock build: they come in a separate build with the `aws` feature
  • The database is an exotic engine outside the supported URL schemes

Example request

Use DBCrust to show the prod schema and count orders by status, read-only

Limitations

  • `--read-only` is described as a statement guard plus connection settings (`query_only` in SQLite, `default_transaction_read_only` in PostgreSQL). Only a read-only database role gives a hard guarantee.
  • DynamoDB, CloudWatch Logs and S3 need a build with the `aws` feature and Rust 1.94.1 or newer, and DuckDB needs the `duckdb` feature.
  • The AI helper in the session is off. `??` sends the schema and your question to a model provider, and `???` can read a bounded query result.
  • The one-line `curl | sh` install downloads a binary from the project's site.

How to disable. A package installed with uv is removed by `uv tool uninstall dbcrust`, with pipx by `pipx uninstall dbcrust`. The `dbcrust` and `dbc` binaries from the install script are deleted by hand. The broker service is removed with its `dbcrust broker` commands, and the DBCrust snippet is taken out of `CLAUDE.md` or `AGENTS.md`.

FAQ

How do I give Claude Code database access without handing over a password?

Enroll the connection in the broker (`sudo dbcrust broker install-service`, then `dbcrust broker enroll`) and give the agent the `dbcrust-agent` client instead of `dbcrust`. The broker enforces read-only mode, row and time limits and keeps an audit log.

What output format does an agent get?

With `-o json`, stdout carries a single line with `columns` and `rows`. Status messages go to stderr, and errors are printed as JSON.

Can I run SQL over CSV and Parquet?

Yes. `dbc ./data.parquet` or `dbc 'logs/*.csv?header=true'` registers the files as tables through Apache DataFusion, no import needed.

How do I install DBCrust?

Run `uv tool install dbcrust` or `pipx install dbcrust`. A prebuilt binary for macOS and Linux comes from `curl -fsSL https://clement-tourriere.github.io/dbcrust/install.sh | sh`, and Windows has a PowerShell script.

What does exit code 4 mean?

The `--read-only` guard stopped the query because it tried to change data. The other codes are 1 SQL error, 2 bad usage and 3 connection failure.

Discussion

No questions or reviews yet.

CLI tools

A Rust terminal database client with MCP and a JSON CLI: agents read schemas and run queries within profile permissions.

CLIExtended access67Repository stars

One MCP server for SQLite, SQL Server, PostgreSQL and MySQL: read and change data, edit schemas and export to CSV and JSON

MCP serverBroad access391Repository stars
Official

A lightweight database workspace with an MCP server: the agent reads the schema, runs queries and explores data in PostgreSQL, MySQL and more

MCP serverBroad access5.1KRepository stars

A desktop database client with an MCP server: an agent reads the schema, runs queries and triggers workflows over stdio.

MCP serverBroad access118Repository stars

A single binary indexes tables and logs so an agent gets a few matching records back instead of raw history

CLIExtended access882Repository stars
Editors’ pick

A token-lean MCP server for PostgreSQL, MySQL, MariaDB, SQL Server and SQLite with a read-only mode

MCP serverBroad access3.8KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
DBCrust (this card)no92
DBHubnonot required3,839an MCP server for several databases, while DBCrust is a CLI and adds a broker that keeps passwords from the agent
Postgres MCP PronoAPI key3,472a PostgreSQL-only MCP server with index tuning, while DBCrust covers dozens of sources and files

README in short

The README presents DBCrust as a psql-like workbench for many databases and files. It covers install, URLs for every supported source, a section for AI agents with the output contract and the broker, SQL over local files, interactive backslash commands, the AI helper and the Django query analyzer.

README badge

Report a problem