LiteDB desktop
Connects to MariaDB databases and lets agents read and write through the app's own guarded connection, with row-count approval, an audit log and Undo.
Connects to MySQL databases (SSL modes, SSH tunnels, session pooler strings) and lets agents run queries and data changes that wait for approval, with the affected rows shown before commit.
Connects to PostgreSQL databases with every schema, SSL modes and SSH tunnels, letting agents query and modify data through approval-gated statements with previewed rows, audit log and Undo.
Opens SQLite database files in place and gives agents access to their tables and schemas: run SQL, read and edit rows, with every write classified, previewed with its row count and held until the user approves.
LiteDB
A desktop database client for SQLite, PostgreSQL and MySQL that lets AI agents in without letting them loose. When Claude Code, Cursor or any MCP agent wants to change your data, LiteDB shows you the statement, the exact row count and the rows it changes, and nothing runs until you click Approve. Every change, an agent's or your own, can be undone from the audit log.
It is also an everyday client: a real SQL editor with Text to SQL, inline editing, saved connections, SSH tunnels and production tags.

Claude Code asks to move 13 customers from FR to DE. LiteDB shows exactly which rows and waits; after Approve, the audit log names the agent, and one click puts the rows back. (Video version.)
If this would make you trust an agent with your database, a ⭐ helps others find it.
Install
macOS:
brew install --cask createdbyadham/tap/litedb, or download the Apple silicon or Intel .dmg. Signed and notarized by Apple.Windows: Scoop (below),
winget install AdhamEhab.LiteDBonce its winget listing is approved, or download the installer or .msi. The installers are not code-signed yet, so SmartScreen may warn: choose More info, then Run anyway.
scoop bucket add litedb https://github.com/createdbyadham/scoop-bucket
scoop install litedb/litedbRelated MCP server: SafeDataBaseMCP
Connect Claude Code in 30 seconds
Open a database in LiteDB: drop a SQLite file on the window, or paste a
postgres://ormysql://URL.Add LiteDB as an MCP server, then start a new Claude Code session:
# macOS claude mcp add litedb --scope user -- /Applications/LiteDB.app/Contents/MacOS/LiteDB --mcp# Windows, default install claude mcp add litedb --scope user -- "$env:LOCALAPPDATA\LiteDB\LiteDB.exe" --mcpSettings → Agents in LiteDB copies the exact command for your install, adds LiteDB to Claude Desktop in one click, and has snippets for Cursor, VS Code and OpenCode.
Ask Claude to "delete the shipped orders". LiteDB shows the rows it would delete and waits. Click Approve, then Undo in the Audit tab to put them back.
More hosts, and what the agent can and cannot do: Connect an agent.
What it does
With agents
Approve in the app. An agent's write waits in the LiteDB window with the exact row count and the rows it changes, even when the agent's app runs tools without asking.
Undo any change. Agents, Text to SQL, the editor, grid edits, imports and new tables: what a change touches is saved before it runs, and Undo puts it back without overwriting anything changed since. What Undo covers.
Audit log of every statement that ran, who or what wrote it, and who approved it.
Production tag: the connection opens read-only for you and for agents, with a red title bar.
Built-in MCP server:
LiteDB --mcp, no Node needed. Agents follow the connection on screen and work through the app's own connection. MCP server, and where your password is kept.
Every day
SQLite opened in place, so multi-gigabyte files open instantly, and PostgreSQL with every schema, SSL modes and SSH tunnels. Supabase works with its session pooler string.
MySQL and MariaDB, with the same approval, Undo, SSL modes and SSH tunnels.
SQL editor with autocomplete for the columns of the tables in your query, run the statement under the cursor, tabs that survive a restart, history and saved scripts.
Text to SQL (
Ctrl/Cmd+K), Explain and Fix with AI, with OpenAI, Anthropic, Gemini, any OpenAI-compatible endpoint, or Ollama on your machine.Table editor: edit cells, insert and duplicate rows, filter, follow foreign keys, edit JSON, copy rows as CSV, JSON, INSERT or Markdown.
CSV, Excel and JSON files open like a database, and CSV imports into a table.
Schema diagram with auto-layout, exported as PNG or SVG.
pgvector semantic search with local embedding models.
The full tour: User guide.
Measured, not asserted
The Text-to-SQL agent ships with a public benchmark: 109 cases scored by
execution accuracy, with a held-out split written after the prompt work and
never tuned against. qwen2.5-coder:7b, running locally on a 6 GB laptop GPU,
on SQLite:
Overall | Held-out | |
Schema context + execution-guided repair | 77.3% | 67.6% |
+ retrieved few-shot exemplars | 85.6% | 76.5% |
On a second schema it never saw, it scores 91.7%. Every number reruns with
npm run eval -- --provider ollama; the method and all six experiments,
including the two that were rejected, are in evals/README.md.
85.6% is good for a 7B model on reads, which are the easy case. That is why generated SQL never runs unattended: see Write safety.
Compared honestly
LiteDB is a SQLite, Postgres and MySQL desktop client with an agent and a write-safety layer. It is not a replacement for a general DBA workbench. If a mark in another column is wrong or out of date, please open an issue.
LiteDB | TablePlus | Beekeeper Studio | DBeaver | |
SQLite + PostgreSQL | ✓ | ✓ | ✓ | ✓ |
MySQL / MariaDB | ✓ | ✓ | ✓ | ✓ |
SQL Server, Oracle and the rest | ✗ | ✓ | ✓ | ✓ |
SSH tunnel / jump host | ✓ | ✓ | ✓ | ✓ |
ERD | ✓ | paid | plugins | ✓ |
Text to SQL (local or cloud) | ✓ | ✗ | ✗ | Pro AI |
Write safety (classify, row-count approval, audit) | ✓ | ✗ | ✗ | ✗ |
MCP server through those guardrails | ✓ | ✗ | ✗ | ✗ |
An agent's write waits for Approve, with the rows it changes | ✓ | ✗ | ✗ | ✗ |
Undo a change after it ran, from the audit log | ✓ | ✗ | ✗ | ✗ |
pgvector semantic search in the app | ✓ | ✗ | ✗ | ✗ |
JDBC / every obscure driver | ✗ | ✗ | ✗ | ✓ |
Native polish / years of query UX | ✗ | ✓ | ✗ | ✗ |
The loss that matters in practice is three dialects. If you need SQL Server or Oracle, use those tools. Use this one when a model is allowed near the database, when production should be hard to change by accident, or when pgvector is the point.
Docs
User guide: connecting, the table editor, the SQL editor, files, the schema diagram, vector search
Write safety: how statements are classified, the four modes, approval, the audit log and Undo
Connect an agent and the MCP server
Text to SQL and its benchmark
Build from source
Node.js 22.5 or later, and Rust stable:
git clone https://github.com/createdbyadham/LiteDB
cd LiteDB
npm install
npm run tauri devCONTRIBUTING.md lists the tests and how to open a pull request. Issues labelled good first issue are small and each a tour of one part of the code.
License
MIT. See LICENSE.
Available Tools
8 toolsaudit_logRead the audit logARead-only
The most recent statements recorded against this database, newest first , from this server and from the LiteDB desktop app, which share the file. Shows what was proposed, what was approved, and what ran.
Inputs: limit.
describe_tableDescribe a tableARead-only
Columns and types for one table, with primary keys, NOT NULL, defaults, foreign keys, indexes, and, for low-cardinality text columns, the distinct values they actually contain. Read this before writing SQL against a table you have not seen.
Inputs: table (required), include_sample_values.
execute_approvedExecute an approved statementADestructive
Second step, after query. Runs the statements a previous query call previewed. Takes only the token, the SQL is held server-side, so what runs is exactly what was previewed. Single-use, and expires five minutes after the preview. Confirm the row count with the person you are working for before calling this. While LiteDB is open, the request appears in its window and nothing runs until they approve it there: a call can come back WAITING, and then you call again with the same token once they have answered.
Inputs: token (required).
list_tablesList tablesARead-only
Every table in the database, with its column count, approximate row count and primary key. The place to start.
Inputs: no named parameters.
list_vector_columnsList pgvector columnsARead-only
Vector columns in the database and their dimensions. PostgreSQL with the pgvector extension only.
Inputs: no named parameters.
queryRun SQLARead-only
Run SQL against the database. A read executes and returns rows. Anything that would change the database does NOT execute: it comes back classified, with the number of rows it would affect and the query plan, plus a single-use token for execute_approved. A statement the policy forbids is refused and says why.
Inputs: sql (required).
semantic_searchSemantic searchARead-only
Nearest-neighbour search over a pgvector column. Give text to search by meaning, it is embedded by a model running on this machine, so the text never leaves it, or row_id to find rows similar to an existing one. The first text search downloads the embedding model (~23 MB for the default) and may take a minute.
Inputs: table (required), column (required), text, limit, +2 more.
writeWrite in one callADestructive
Run a write in one call, where the person has allowed that for this connection in LiteDB (Settings → Agents): an INSERT of listed rows, or an UPDATE or DELETE with a WHERE clause, that changes no more rows than the limit they set. The limit is checked before it runs and enforced while it runs. Anything else, or any write when it is not allowed, comes back as a preview with a token for execute_approved, exactly as from query, with the reason it did not run.
Inputs: sql (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a stated role, and the descriptions explicitly delimit the tricky boundaries: query previews writes, write only runs them when pre-authorised, and execute_approved runs them by token. The residual overlap is real (query and write can both end up producing the same preview/token, and semantic_search is a specialised query), but the documentation resolves it well enough that an agent should pick correctly.
All names are snake_case and mostly follow a verb_noun shape (describe_table, list_tables, list_vector_columns, audit_log, execute_approved). The minor deviations are the bare verbs `query` and `write` and the noun-first `audit_log`, which are readable but not strictly parallel.
Eight tools is well within a healthy range and each one maps to a distinct step in the read/write/approve workflow plus schema inspection, auditing and vector search. Nothing looks redundant or bolted on.
The surface covers schema discovery, reads, guarded writes with an approval lifecycle, and an audit trail, which is essentially full lifecycle for a desktop DB agent. Gaps are minor but present: no way to cancel or revoke a pending token, no transaction/connection controls, and no explicit index or DDL guidance beyond describe_table's output.
Maintenance
Related MCP Connectors
AI agents propose database changes as reviewable requests — no direct write access.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
SQLite databases for AI agents: build custom apps, share data between agents, optimize agent runs
Preventive human-approval write-gate for AI agents: writes commit only after a human approves.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to safely work with SQLite databases by enforcing read/write separation, dry-run writes with confirmation, automatic backups, and an audit trail.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to read and write real databases safely by gating every write behind a mandatory propose/confirm preview and securing AWS RDS connections with short-lived IAM tokens.6MIT
- AlicenseAqualityBmaintenanceRead-only-by-default MySQL/MariaDB, PostgreSQL and SQLite access for AI agents: explore schemas and foreign keys, search, sample, query and EXPLAIN with token-efficient TOON output. Writes only when enabled, always previewed and atomic.1131 PyPI1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceGives AI agents controlled access to an existing, live SQLite database that another application owns, with permission-gated schema, read, structured write, backup, and diagnostics tools. Structured writes with mandatory filters, row limits counting cascades, and request idempotency keep a mistaken but authorized agent from causing unrecoverable damage.1Apache 2.0