Gives Claude read and write access to SQLCipher 4 encrypted databases through standard SQL operations. Useful when you need to work with encrypted SQLite files from apps like Signal, 1Password, WhatsApp, or MoneyMoney. Exposes tools to list tables and schemas, run arbitrary SQL queries, and perform CRUD operations with proper identifier validation. Supports custom cipher profiles if you're dealing with non-standard encryption settings. Handles passphrase encryption with AES-256-GCM and can pull keys from macOS Keychain. Built on the sqlite-jdbc-crypt driver and runs over stdio, with Docker images available if you don't want to mess with Java 21 locally.
Public tool metadata for what this MCP can expose to an agent.
sqlite_queryExecute a SELECT query on the SQLite database and return rows as a JSON array. Use this for reading data — supports any valid SELECT statement with optional parameter binding for safe queries.2 paramsExecute a SELECT query on the SQLite database and return rows as a JSON array. Use this for reading data — supports any valid SELECT statement with optional parameter binding for safe queries.
sqlstringparamsarraysqlite_executeExecute a write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) on the SQLite database. Returns the number of rows changed and the last inserted row ID. Use parameter binding for safe writes.2 paramsExecute a write statement (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) on the SQLite database. Returns the number of rows changed and the last inserted row ID. Use parameter binding for safe writes.
sqlstringparamsarraysqlite_run_scriptExecute multiple SQL statements in a single transaction. All statements succeed or all fail (atomic). Separate statements with semicolons. Use for migrations, seed data, or batch operations.1 paramsExecute multiple SQL statements in a single transaction. All statements succeed or all fail (atomic). Separate statements with semicolons. Use for migrations, seed data, or batch operations.
sqlstringsqlite_list_tablesList all tables and views in the database with their row counts. Use this as the first step to explore an unfamiliar database. Returns table name, type (table or view), and row count.1 paramsList all tables and views in the database with their row counts. Use this as the first step to explore an unfamiliar database. Returns table name, type (table or view), and row count.
_fieldsstringsqlite_describe_tableGet the column schema of a table — column names, data types, NOT NULL constraints, default values, and primary key flags. Also returns the CREATE TABLE SQL statement.1 paramsGet the column schema of a table — column names, data types, NOT NULL constraints, default values, and primary key flags. Also returns the CREATE TABLE SQL statement.
tablestringsqlite_list_indexesList all indexes on a table — index name, uniqueness, origin (manual or auto-created), and whether it is a partial index.1 paramsList all indexes on a table — index name, uniqueness, origin (manual or auto-created), and whether it is a partial index.
tablestringsqlite_list_foreign_keysList foreign key constraints on a table — referenced table, local and remote columns, ON UPDATE and ON DELETE actions.1 paramsList foreign key constraints on a table — referenced table, local and remote columns, ON UPDATE and ON DELETE actions.
tablestringsqlite_create_tableCreate a new table with column definitions. Each column has a name, type, and optional constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT). Use ifNotExists to skip if the table already exists.3 paramsCreate a new table with column definitions. Each column has a name, type, and optional constraints (PRIMARY KEY, NOT NULL, UNIQUE, DEFAULT). Use ifNotExists to skip if the table already exists.
tablestringcolumnsarrayifNotExistsbooleansqlite_alter_tableAlter an existing table — add a new column, rename a column, or rename the table. SQLite does not support dropping columns via ALTER TABLE.9 paramsAlter an existing table — add a new column, rename a column, or rename the table. SQLite does not support dropping columns via ALTER TABLE.
typestringtablestringactionstringadd_column · rename_column · rename_tablecolumnstringdefaultvaluenewNamestringnotNullbooleanoldNamestringnewTableNamestringsqlite_drop_tableDrop (delete) a table and all its data permanently. This action is irreversible. Use ifExists to avoid errors if the table does not exist.2 paramsDrop (delete) a table and all its data permanently. This action is irreversible. Use ifExists to avoid errors if the table does not exist.
tablestringifExistsbooleansqlite_create_indexCreate an index on one or more columns to speed up queries. Optionally create a UNIQUE index to enforce uniqueness. Index name is auto-generated if not provided.5 paramsCreate an index on one or more columns to speed up queries. Optionally create a UNIQUE index to enforce uniqueness. Index name is auto-generated if not provided.
tablestringuniquebooleancolumnsarrayindexNamestringifNotExistsbooleansqlite_drop_indexDrop (delete) an index by name. Does not affect the table data, only removes the index. Use ifExists to avoid errors if the index does not exist.2 paramsDrop (delete) an index by name. Does not affect the table data, only removes the index. Use ifExists to avoid errors if the index does not exist.
ifExistsbooleanindexNamestringsqlite_get_infoGet database metadata — file path, file size, table count, page count, page size, journal mode, WAL status, encoding, and SQLite version. Use this to understand the database state.1 paramsGet database metadata — file path, file size, table count, page count, page size, journal mode, WAL status, encoding, and SQLite version. Use this to understand the database state.
_fieldsstringsqlite_vacuumOptimize and compact the database file by rebuilding it. Reclaims space from deleted rows and defragments the file. Returns file size before and after. May take time on large databases.1 paramsOptimize and compact the database file by rebuilding it. Reclaims space from deleted rows and defragments the file. Returns file size before and after. May take time on large databases.
_fieldsstringsqlite_integrity_checkRun PRAGMA integrity_check to verify the database is not corrupted. Returns "ok" if the database is healthy, or a list of issues found. Use after crashes or suspicious behavior.1 paramsRun PRAGMA integrity_check to verify the database is not corrupted. Returns "ok" if the database is healthy, or a list of issues found. Use after crashes or suspicious behavior.
_fieldsstringMCP server for encrypted SQLite databases
A Model Context Protocol (MCP) server for working with encrypted SQLite databases using SQLCipher. This server provides tools to read database structures, query tables, and perform CRUD operations on encrypted SQLite databases.
Compatible with all MCP clients (Cursor, Claude Desktop, and others).
Works with encrypted databases from: MoneyMoney, 1Password, Signal, WhatsApp, Firefox, Telegram, KeePass, and other applications using SQLCipher encryption.
MCP_DEBUG environment variableMany popular applications use encrypted SQLite databases (SQLCipher) to protect sensitive data. This MCP server is specifically designed to work with these encrypted databases.
If you need to access data from any of these applications or other SQLCipher-encrypted databases, this MCP server provides the tools you need. Note that you need the passphrase of the encrypted database.
sqlite-jdbc-3.50.1.0.jar from sqlite-jdbc-crypt)The easiest way to install this MCP server in Cursor is via the Cursor MCP Store:
This server works with any MCP-compatible client. See the Configuration section below for setup instructions.
Use the pre-built Docker image from GitHub Container Registry:
docker pull ghcr.io/rosch100/mcp-encrypted-sqlite:latest
Quick Start: See DOCKER_QUICKSTART.md for Docker Desktop setup.
Detailed Configuration: See DOCKER_CONFIGURATION.md for advanced options.
Clone the repository:
git clone https://github.com/rosch100/mcp-encrypted-sqlite.git
cd mcp-encrypted-sqlite
Build the project:
./gradlew build installDist
The build process will automatically download sqlite-jdbc-3.50.1.0.jar from sqlite-jdbc-crypt releases and place it in the libs/ directory.
The executable will be available at build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite.
This MCP server works with any MCP-compatible client (Cursor, Claude Desktop, etc.). The configuration format follows the Model Context Protocol specification.
The server communicates via STDIO (standard input/output). Add the following configuration to your MCP client's configuration file:
Configuration file locations:
~/.cursor/mcp.json~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"your-passphrase\"}"
]
}
}
}
Optional Parameters:
transport: Defaults to "stdio" (can be omitted)cwd: Not needed when using absolute paths (can be omitted)env: Only needed if Java is not in your system PATH or for custom Java installation:{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"your-passphrase\"}"
],
"env": {
"JAVA_HOME": "/path/to/java/home"
}
}
}
}
{
"mcpServers": {
"encrypted-sqlite": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "/path/to/your/database.sqlite:/data/database.sqlite:ro",
"ghcr.io/rosch100/mcp-encrypted-sqlite:latest",
"--args",
"{\"db_path\":\"/data/database.sqlite\",\"passphrase\":\"your-passphrase\"}"
]
}
}
}
When using encrypted passphrases, you must pass the encryption key as an environment variable:
{
"mcpServers": {
"encrypted-sqlite": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "MCP_SQLITE_ENCRYPTION_KEY=your-encryption-key",
"-v", "/path/to/your/database.sqlite:/data/database.sqlite:ro",
"ghcr.io/rosch100/mcp-encrypted-sqlite:latest",
"--args",
"{\"db_path\":\"/data/database.sqlite\",\"passphrase\":\"encrypted:your-encrypted-passphrase\"}"
]
}
}
}
Important Notes:
-e flag must come before the -v flagsecurity find-generic-password -s "mcp-encrypted-sqlite" -a "encryption-key" -w:ro) by default. Remove :ro if you need write accessSecurity Warning: Storing both the encryption key and encrypted passphrase as plain text in your configuration file is a security risk. See DOCKER_CONFIGURATION.md for secure alternatives.
Override the default SQLCipher 4 settings by including a cipherProfile in the configuration JSON:
{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"your-passphrase\",\"cipherProfile\":{\"name\":\"SQLCipher 4 defaults\",\"pageSize\":4096,\"kdfIterations\":256000,\"hmacAlgorithm\":\"HMAC_SHA512\",\"kdfAlgorithm\":\"PBKDF2_HMAC_SHA512\"}}"
]
}
}
}
Note: All fields in cipherProfile are optional - only specify the ones you want to override from the defaults. You can also specify cipherProfile in individual tool calls, but it's recommended to configure it once in the MCP server configuration for consistency.
For enhanced security, you can store passphrases in encrypted form. The server uses AES-256-GCM encryption, which provides authenticated encryption and is both secure and fast.
Generate and store key in Keychain:
Run: ./store-key-in-keychain.sh --generate
Encrypt your passphrase:
Run: ./encrypt-passphrase.sh "your-plain-passphrase"
The key is automatically loaded from the Keychain when no environment variable is set.
Benefits:
Generate an encryption key:
Run: java -cp build/libs/mcp-encrypted-sqlite-VERSION.jar com.example.mcp.sqlite.config.PassphraseEncryption
Set the encryption key:
Run: export MCP_SQLITE_ENCRYPTION_KEY="<your-generated-key>"
Encrypt your passphrase:
Run: java -cp build/libs/mcp-encrypted-sqlite-VERSION.jar com.example.mcp.sqlite.util.EncryptPassphrase "your-plain-passphrase"
Use the encrypted passphrase (with encrypted: prefix) in your configuration:
On macOS with Keychain (recommended):
{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"encrypted:<encrypted-passphrase>\"}"
]
}
}
}
Note: No env section needed - the key is automatically loaded from macOS Keychain.
With environment variable (cross-platform):
{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"encrypted:<encrypted-passphrase>\"}"
],
"env": {
"MCP_SQLITE_ENCRYPTION_KEY": "<your-encryption-key>"
}
}
}
}
Important Security Notes:
MCP_SQLITE_ENCRYPTION_KEY environment variable)encrypted:) and decrypts themPassphraseEncryption.generateKey() to generate strong keys (256 bits / 32 bytes)list_tablesList all tables in the database. By default only table names, with include_columns=true also column details.
Parameters:
db_path (optional if configured): Path to the database filepassphrase (optional if configured): Database passphraseinclude_columns (optional, default: false): If true, column details are also returnedExample:
{
"name": "list_tables",
"arguments": {
"include_columns": true
}
}
get_table_dataRead data from a table with optional filtering, column selection, and pagination.
Parameters:
table (required): Table namecolumns (optional): Array of column names to selectfilters (optional): Object with column-value pairs for filteringlimit (optional, default: 200): Maximum number of rowsoffset (optional, default: 0): Offset for paginationExample:
{
"name": "get_table_data",
"arguments": {
"table": "accounts",
"columns": ["id", "name", "balance"],
"filters": {"status": "active"},
"limit": 50,
"offset": 0
}
}
execute_sqlExecute arbitrary SQL statements (SELECT, INSERT, UPDATE, DELETE, DDL).
Security Warning: This tool executes raw SQL without parameterization. Only use with trusted SQL or ensure proper validation and sanitization is performed before calling this tool. For safer operations, use the other tools (get_table_data, insert_or_update, delete_rows) which use parameterized queries.
Parameters:
sql (required): SQL statement to executeExample:
{
"name": "execute_sql",
"arguments": {
"sql": "SELECT COUNT(*) FROM transactions WHERE amount > 1000"
}
}
insert_or_updatePerform UPSERT operations (INSERT or UPDATE on conflict).
Parameters:
table (required): Table nameprimary_keys (required): Array of primary key column namesrows (required): Array of row objects to insert/updateExample:
{
"name": "insert_or_update",
"arguments": {
"table": "accounts",
"primary_keys": ["id"],
"rows": [
{"id": 1, "name": "Account 1", "balance": 1000.0},
{"id": 2, "name": "Account 2", "balance": 2000.0}
]
}
}
delete_rowsDelete rows from a table based on filters.
Parameters:
table (required): Table namefilters (required): Object with column-value pairs for filteringExample:
{
"name": "delete_rows",
"arguments": {
"table": "transactions",
"filters": {"status": "cancelled"}
}
}
get_table_schemaRetrieves detailed schema information for a table (columns, indexes, foreign keys, constraints).
Parameters:
table (required): Table nameExample:
{
"name": "get_table_schema",
"arguments": {
"table": "accounts"
}
}
list_indexesLists all indexes of a table.
Parameters:
table (required): Table nameExample:
{
"name": "list_indexes",
"arguments": {
"table": "accounts"
}
}
The server supports optional debug output via the MCP_DEBUG environment variable. When enabled, detailed debug information is written to stderr (not stdout, to comply with MCP protocol requirements).
Enable debug mode:
{
"mcpServers": {
"encrypted-sqlite": {
"command": "/path/to/mcp-encrypted-sqlite/build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite",
"args": [
"--args",
"{\"db_path\":\"/path/to/your/database.sqlite\",\"passphrase\":\"your-passphrase\"}"
],
"env": {
"MCP_DEBUG": "true"
}
}
}
}
Debug output includes:
Note: Debug output is disabled by default to keep logs clean. Only enable it when troubleshooting issues.
The server uses SQLCipher 4 defaults by default:
cipher_page_size: 4096kdf_iter: 256000cipher_hmac_algorithm: HMAC_SHA512cipher_kdf_algorithm: PBKDF2_HMAC_SHA512cipher_use_hmac: ONcipher_plaintext_header_size: 0These settings match the defaults used by tools like "DB Browser for SQLite" with SQLCipher 4.
See DEVELOPMENT.md for development setup, building, testing, and project structure.
char[] arrays, though this is not currently implemented.PassphraseEncryption.generateKey() (256 bits / 32 bytes)chmod 600)The MCP server includes extensive debugging features to help diagnose communication problems.
In MCP clients:
stderrManual testing:
Run: ./build/install/mcp-encrypted-sqlite/bin/mcp-encrypted-sqlite --args '{"db_path":"/path/to/db.sqlite","passphrase":"secret"}' 2>&1 | tee mcp-debug.log
1. Server does not start
mcp.json)command and args fields2. JSON Parsing Errors
3. Missing or Incorrect Responses
STDOUT is available (logged at startup)4. Invalid Requests
method, id)method and id fields are present5. Database Connection Problems
The server automatically logs:
Startup Information:
Request Processing:
Error Handling:
Database Operations:
java -versionJAVA_HOME is set correctly in the MCP configurationThe server automatically handles FTS virtual tables that may not have accessible metadata. These tables will appear with empty column lists.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
See NOTICE for detailed attribution information.
Contributions are welcome! Please feel free to submit a Pull Request. See CONTRIBUTING.md for guidelines.
For issues, questions, or contributions, please open an issue on GitHub.
Like this integration? Feel free to buy me a coffee! Your support helps me continue working on cool features.
DB_PATH*Path to the encrypted SQLite database file
DB_PASSPHRASE*secretPassphrase for decrypting the database
hovecapital/read-only-local-postgres-mcp-server
cocaxcode/database-mcp
io.github.infoinlet-marketplace/mcp-mysql
io.github.cybeleri/database-admin
io.github.yash-0620/postgres-mcp-secured