@frontmcp/storage-sqlite provides a local storage backend for FrontMCP using SQLite. It replaces Redis for single-process deployments where you need persistence without managing external infrastructure.
Zero Infrastructure
No Redis or external database needed — just a local file
Persistent Sessions
Sessions, elicitation state, and SSE events survive restarts
Optional Encryption
AES-256-GCM at-rest encryption via HKDF-SHA256
WAL Mode
Write-Ahead Logging enabled by default for better read concurrency
When to Use SQLite
Installation
Quick Start
With Unix Socket (Recommended)
The simplest way to use SQLite is via thesqlite option on FrontMcpInstance.runUnixSocket():
With @FrontMcp Decorator
Configuration Options
Encryption
Enable at-rest encryption to protect stored session data. Keys are stored in plaintext (needed for lookups); only values are encrypted.- Your secret is run through HKDF-SHA256 to derive a 256-bit key
- Each value is encrypted with AES-256-GCM using a random 96-bit IV
- Stored format:
base64url(iv):base64url(tag):base64url(ciphertext)
Store Types
@frontmcp/storage-sqlite provides three specialized stores, all built on a common SqliteKvStore:
Session Store
Stores MCP session data with TTL support.Event Store
Stores SSE events for resumability with max event limits and TTL-based eviction.Elicitation Store
Stores pending elicitation requests with EventEmitter-based single-process pub/sub.Comparison: SQLite vs Redis vs Vercel KV
Troubleshooting
Error: Cannot find module 'better-sqlite3'
Error: Cannot find module 'better-sqlite3'
Cause: The If you’re using yarn with PnP, you may need to add it as a dependency (not devDependency).
better-sqlite3 native module is not installed.Solution:SQLITE_CANTOPEN: unable to open database file
SQLITE_CANTOPEN: unable to open database file
Cause: The parent directory for the SQLite file doesn’t exist.Solution: Ensure the directory exists before starting the server:
Database is locked
Database is locked
Cause: Multiple processes are trying to write to the same SQLite file simultaneously.Solution: SQLite is designed for single-process access. If you need multiple processes, use Redis instead. WAL mode (enabled by default) helps with read concurrency but doesn’t solve multi-writer scenarios.
Encryption errors after changing the secret
Encryption errors after changing the secret
Cause: Existing data was encrypted with a different secret.Solution: Either restore the original secret or delete the database file and let the server create a fresh one. There is no migration path between encryption keys.
Related Documentation
Unix Socket
Run FrontMCP as a persistent local server over Unix sockets
Redis Setup
Configure Redis for multi-instance production deployments
Vercel KV
Edge-compatible storage for Vercel deployments
Runtime Modes
Compare SDK, Server, and Handler deployment modes