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).
MCP server for SQLCipher 4 encrypted SQLite databases with full CRUD operations and query support
DB_PATH, DB_PASSPHRASE
Terakhir diperiksa
2026-11-10
Bintang
—
Tool
—
Uptime
—
Works with encrypted databases from: MoneyMoney, 1Password, Signal, WhatsApp, Firefox, Telegram, KeePass, and other applications using SQLCipher encryption.
Features
Encrypted SQLite Support: Works with SQLCipher 4 encrypted databases - the key differentiator of this MCP server
Encrypted Passphrases: Support for AES-256-GCM encrypted passphrases with macOS Keychain integration
Database Exploration: List tables, columns, indexes, and schema metadata
CRUD Operations: Insert, update, and delete rows with filtering
Configurable Cipher Profiles: Support for different SQLCipher configurations
MCP Protocol: Full Model Context Protocol implementation via STDIO
Security: SQL identifier validation to prevent SQL injection
Debug Mode: Optional debug output via MCP_DEBUG environment variable
Input Validation: Comprehensive validation for limits, offsets, and identifiers
Why Encrypted SQLite?
Many popular applications use encrypted SQLite databases (SQLCipher) to protect sensitive data. This MCP server is specifically designed to work with these encrypted databases.
Applications Using Encrypted SQLite Databases
MoneyMoney (macOS): Financial management app with encrypted local databases
1Password: Password manager using SQLCipher for local vault storage
Signal: Encrypted messaging app with SQLCipher-protected message databases
WhatsApp: Messaging app using encrypted SQLite for local message storage
Firefox: Browser using SQLCipher for encrypted login databases
Telegram: Messaging app with encrypted local database storage
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.
Requirements
Java 21 or higher (JDK)
Gradle (wrapper included)
SQLite JDBC driver with encryption support (sqlite-jdbc-3.50.1.0.jar from sqlite-jdbc-crypt)
Quick Start
Cursor (One-Click Installation)
The easiest way to install this MCP server in Cursor is via the Cursor MCP Store:
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.
Configuration
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: ~/.cursor/mcp.json
Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
Other clients: Refer to your client's documentation
cwd: Not needed when using absolute paths (can be omitted)
immutable: Optional boolean in the --args JSON. When true, opens the DB with SQLite URI file:…?immutable=1 (no file locks). Use for peeking at DBs locked exclusively by another app (e.g. MoneyMoney). All write tools/SQL are disabled in this mode (insert_or_update / delete_rows omitted; execute_sql accepts read-only statements only).
env: Only needed if Java is not in your system PATH or for custom Java installation:
macOS Keychain is NOT accessible from Docker containers - pass the encryption key explicitly
Get your encryption key: security find-generic-password -s "mcp-encrypted-sqlite" -a "encryption-key" -w
The database file is mounted as read-only (:ro) by default. Remove :ro if you need write access
Security 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.
Custom Cipher Profile
Override the default SQLCipher 4 settings by including a cipherProfile in the configuration JSON:
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.
Encrypted Passphrases
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.
macOS Keychain (Recommended for macOS)
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:
Key is securely encrypted and stored by macOS
No environment variables needed
Automatic unlock with macOS user password
Works system-wide for all applications
Environment Variable (Cross-Platform)
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"
Usage
Use the encrypted passphrase (with encrypted: prefix) in your configuration:
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 execute
Example:
{
"name": "execute_sql",
"arguments": {
"sql": "SELECT COUNT(*) FROM transactions WHERE amount > 1000"
}
}
insert_or_update
Perform UPSERT operations (INSERT or UPDATE on conflict).
Parameters:
table (required): Table name
primary_keys (required): Array of primary key column names
rows (required): Array of row objects to insert/update
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).
Server startup information (Java version, OS, arguments)
Configuration parsing details
Request processing information
Response sizes and structures
Database connection details
Note: Debug output is disabled by default to keep logs clean. Only enable it when troubleshooting issues.
Default Cipher Profile
The server uses SQLCipher 4 defaults by default:
cipher_page_size: 4096
kdf_iter: 256000
cipher_hmac_algorithm: HMAC_SHA512
cipher_kdf_algorithm: PBKDF2_HMAC_SHA512
cipher_use_hmac: ON
cipher_plaintext_header_size: 0
These settings match the defaults used by tools like "DB Browser for SQLite" with SQLCipher 4.
Development
See DEVELOPMENT.md for development setup, building, testing, and project structure.
Security Considerations
General Security
Passphrases: Passphrases are only stored in memory and never logged
Encrypted Passphrases: Use encrypted passphrases with AES-256-GCM for storing passphrases in configuration files (see Encrypted Passphrases section)
Memory: Note that decrypted passphrases remain in memory as Java Strings (immutable). For maximum security, consider using char[] arrays, though this is not currently implemented.
Transport: Use secure transport channels (e.g., encrypted sessions) when accessing the server remotely
File Permissions: Ensure database files have appropriate file system permissions
Security Best Practices
Use encrypted passphrases with AES-256-GCM encryption
Generate strong keys using PassphraseEncryption.generateKey() (256 bits / 32 bytes)
Store encryption keys securely: Use macOS Keychain (recommended on macOS) or secure secret storage
Never store both encryption key and encrypted passphrase in the same configuration file - Use wrapper scripts or environment variables to load the key securely (see DOCKER_CONFIGURATION.md for details)
Rotate keys periodically - when rotating, re-encrypt all passphrases with the new key
Use different keys for different environments (development, staging, production)
Never commit keys or encrypted passphrases to version control
Restrict file permissions on configuration files containing secrets (chmod 600)
Troubleshooting
Debugging MCP Server Communication Issues
The MCP server includes extensive debugging features to help diagnose communication problems.
Belum ada daftar tool. Server remote mendapatkannya setelah pemeriksaan kesehatan pertama.
FAQ
Pertanyaan
Bagaimana cara menginstal MCP Sqlite?
Salin konfigurasi stdio untuk Cursor, Claude Desktop, Claude Code, atau VS Code di halaman ini. Konfigurasi ini memakai instalasi dari penerbit, bukan proxy PlugMCP.
Apakah MCP Sqlite memerlukan kunci API?
Penerbit mencantumkan variabel lingkungan berikut: DB_PATH, DB_PASSPHRASE.
Transport apa yang digunakan MCP Sqlite?
MCP Sqlite berjalan secara lokal melalui stdio.
Kapan MCP Sqlite terakhir diperiksa?
Terakhir diperiksa 2026-11-10. MCP server for SQLCipher 4 encrypted SQLite databases with full CRUD operations and query support