# mcp-sqlite [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/rosch100/mcp-sqlite  
**GitHub Stars:** 0  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-sqlite

## Description
MCP server for SQLCipher 4 encrypted SQLite databases with full CRUD operations and query support

## Tools
Capabilities this server exposes over MCP:

- **list_tables** — List all tables in the database. By default only table names, with `include_columns=true` also column details.
- **get_table_data** — Read data from a table with optional filtering, column selection, and pagination.
- **execute_sql** — Execute arbitrary SQL statements (SELECT, INSERT, UPDATE, DELETE, DDL).
- **insert_or_update** — Perform UPSERT operations (INSERT or UPDATE on conflict).
- **delete_rows** — Delete rows from a table based on filters.
- **get_table_schema** — Retrieves detailed schema information for a table (columns, indexes, foreign keys, constraints).
- **list_indexes** — Lists all indexes of a table.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/rosch100/mcp-sqlite), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
git clone https://github.com/rosch100/mcp-encrypted-sqlite.git
```

2. Install:

```sh
./gradlew build installDist
```

3. Configure:

```sh
./store-key-in-keychain.sh --generate
```

4. Configure:

```sh
./encrypt-passphrase.sh "your-plain-passphrase"
```

5. Start the server:

```sh
./build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite --args '{"db_path":"/path/to/db.sqlite","passphrase":"secret"}' 2>&1 | tee mcp-debug.log
```

## Documentation

## What mcp-sqlite does

The mcp-sqlite MCP server gives an MCP-compatible client access to an encrypted SQLite database through a standard input/output connection. It is designed for SQLCipher 4 databases and requires the database passphrase. The repository notes compatibility with encrypted database files used by applications including MoneyMoney, 1Password, Signal, WhatsApp, Firefox, Telegram, and KeePass, as well as other applications using SQLCipher.

The server supports database discovery and data changes. Agents can inspect tables, columns, indexes, foreign keys, and constraints; read rows with filters and pagination; execute SQL statements; and insert, update, or delete records. SQL identifier validation and input checks are included for identifiers, limits, and offsets.

## How it works

The mcp-sqlite MCP server communicates over STDIO. An MCP client starts the server with a database path and passphrase supplied in the server arguments. The default configuration uses SQLCipher 4 settings, while a `cipherProfile` object can override values such as page size, key-derivation iterations, HMAC algorithm, and KDF algorithm.

An `immutable` option opens the database through SQLite's immutable URI mode. This is intended for inspecting files that another application has locked exclusively. In immutable mode, write tools are omitted, and `execute_sql` accepts read-only statements only.

Passphrases may be provided directly or in encrypted form. Encrypted passphrases use AES-256-GCM. On macOS, the server can load the encryption key from Keychain; Docker containers cannot access the macOS Keychain, so the key must be supplied explicitly in that environment.

## Setup and configuration

Running from source requires Java 21 or newer. The project includes a Gradle wrapper and downloads an encryption-capable SQLite JDBC driver during the build. Build and install the distribution with `./gradlew build installDist`, then configure the generated executable in the MCP client's server settings.

Docker users can run the published image from GitHub Container Registry and mount the database into the container. The documented Docker example mounts the database read-only by default; remove the read-only mount option when write access is needed. When using an encrypted passphrase in Docker, set `MCP_SQLITE_ENCRYPTION_KEY` and pass the encrypted value with the `encrypted:` prefix.

The client configuration can include `db_path`, `passphrase`, `transport`, `cwd`, `immutable`, and `cipherProfile`. The transport defaults to `stdio`. Absolute paths avoid needing a working-directory override. The repository provides example locations for Cursor and Claude Desktop configuration files.

## Tools and capabilities

- `list_tables` lists table names and can include column details.
- `get_table_data` reads selected columns with optional filters and pagination.
- `execute_sql` runs SELECT, INSERT, UPDATE, DELETE, and DDL statements unless immutable mode restricts it to reads.
- `insert_or_update` performs an upsert when a conflict occurs.
- `delete_rows` removes rows matching supplied filters.
- `get_table_schema` returns columns, indexes, foreign keys, and constraints for a table.
- `list_indexes` lists indexes associated with a table.

These tools make the mcp-sqlite MCP server suitable for inspecting application databases, querying encrypted records, and making controlled database changes through an MCP client.

## Limitations and notes

The database passphrase is required; the server cannot access an encrypted database without it. Docker does not provide access to the host macOS Keychain, so encrypted-passphrase deployments need an explicit encryption key. Database write behavior also depends on both the server's immutable setting and the filesystem mount permissions.

The server is delivered through STDIO rather than a network transport. Debug output can be enabled with `MCP_DEBUG` when needed.

_Full upstream README: https://allmcps.com/mcp/mcp-sqlite/readme_

