LazyDB CLI

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

  • 67 ★ on the repository
  • Last commit
  • Apache-2.0
CLI

Extended access

Why this level

  • The agent runs queries against real databases; writes are closed by the `deny` policy, but the database role remains the main protection.
All reasons and checks

yelog/lazydb

Install

Manual install

brew install yelog/tap/lazydb

First option of the Quickstart section. macOS and Linux also have an install script, Windows has a PowerShell script.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The agent runs queries against real databases; writes are closed by the `deny` policy, but the database role remains the main protection.

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

What it does

LazyDB is a keyboard-first database client for the terminal, written in Rust. It opens schemas, table data, Redis and Valkey keys, MongoDB documents, SQL consoles with completion and a monitoring dashboard. PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, ClickHouse, Snowflake, BigQuery, SQLite, DuckDB, Elasticsearch and more are supported. Agents get two entry points: a local stdio MCP server and the `lazydb agent` JSON CLI. `lazydb mcp setup` wires the server into Claude Code, Codex or OpenCode. The agent sees connection profiles of the current project plus global profiles, searches schema objects, describes tables and runs queries. Database writes are denied by default.

Who it is for. Developers debugging data across several databases who want Claude Code or Codex to read a project schema without a separate MCP server per engine.

Good fit when

  • An agent writes a migration and first inspects the real table schema.
  • A project keeps PostgreSQL, Redis and MongoDB, and one client for all of them is needed.
  • A quick `SELECT` runs from the terminal and the result goes to the agent as JSON.
  • Writes are allowed on dev and staging only, with production kept closed.

Not a fit when

  • A mouse-driven web interface for analysts without a terminal is required.
  • The agent may change production data without review.
  • The database is unreachable from the developer machine and no tunnel exists.

Example request

List the project tables, find the `email` column and run `SELECT * FROM users LIMIT 20` on the orders-dev profile.

Limitations

The project is in beta: features depend on the engine, with the list in `docs/database-capabilities.md`. Oracle needs Oracle Instant Client and DuckDB needs a separate C API runtime. Agents see global profiles as well as project ones, so keep unrelated connections in profiles of other projects. Writes are guarded by `--write-policy`, yet the real barrier is the database role itself: create a read-only role for read-only profiles.

How to disable. Delete the `lazydb` entry from the client MCP config (for example `.codex/config.toml` or `opencode.json`) and restart the agent. The client itself is removed as described in `docs/installation.md`.

FAQ

Can the agent change data?

Not under the default policy. `--write-policy deny` rejects `execute_change` and `execute_file` even after client approval. `non-production` opens writes on dev and staging, and `all` is required for production writes.

Which profiles does the agent see?

Profiles of the current Git project plus global profiles. Profiles bound only to another project stay hidden and cannot be selected by name or UUID.

How is the password stored?

It goes to the local encrypted LazyDB credential store. Pass it through an environment variable with `--password-env` and keep it out of the command and URL.

Does it work without MCP?

Yes. `lazydb agent connections`, `schema-search`, `describe` and `query` print JSON and suit scripts and agents without MCP support.

Which databases does the client support?

PostgreSQL, CockroachDB, MySQL, MariaDB, TiDB, Oracle, SQL Server, ClickHouse, Snowflake, BigQuery, SQLite, DuckDB, Redis, Valkey, MongoDB, Elasticsearch and OpenSearch. Features vary by engine and are listed in `docs/database-capabilities.md`.

Discussion

No questions or reviews yet.

CLI tools

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 database CLI for dozens of engines with an agent mode: JSON output, a read-only guard, limits and a broker that hides passwords

CLIBroad access92Repository stars
Official

The linq2db command-line tool with an MCP server: an agent reads a database schema and runs one SELECT at a time.

MCP serverExtended access3.3KRepository stars
Official

A desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use

MCP serverBroad access5.5KRepository stars
Official

A single-binary MCP server for MySQL, MariaDB, PostgreSQL and SQLite: read-only by default, with optional PII redaction

MCP serverBroad access33Repository stars

README in short

LazyDB serves developers as a terminal client. On top of that it gives agents schema and queries through MCP and a JSON CLI, with writes disabled until explicitly enabled.

README badge

Report a problem