Skip to main content
Glama
LiteDB desktop

LiteDB desktop

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.

Download for macOS Download for Windows Download for Linux

Claude Code asks to change 13 customers; LiteDB shows the rows and waits for Approve, the audit log names the agent, and Undo puts the rows back

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.LiteDB once 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.

  • Linux: AppImage, .deb or .rpm.

scoop bucket add litedb https://github.com/createdbyadham/scoop-bucket
scoop install litedb/litedb

Related MCP server: SafeDataBaseMCP

Connect Claude Code in 30 seconds

  1. Open a database in LiteDB: drop a SQLite file on the window, or paste a postgres:// or mysql:// URL.

  2. 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" --mcp

    Settings → 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.

  3. 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

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 dev

CONTRIBUTING.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 tools
audit_logRead the audit logA
Read-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 tableA
Read-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 statementA
Destructive

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 tablesA
Read-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 columnsA
Read-only

Vector columns in the database and their dimensions. PostgreSQL with the pgvector extension only.

Inputs: no named parameters.

queryRun SQLA
Read-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).

writeWrite in one callA
Destructive

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

    A4.1/5.0

    Scored across 8 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables 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
    • A
      license
      A
      quality
      D
      maintenance
      Enables 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.
      6
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Read-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.
      11
      31 PyPI
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Gives 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.
      1
      Apache 2.0