New:Socket for Asana Is Now Available.Learn more
Get Started

@frontmcp/storage-sqlite

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontmcp/storage-sqlite

SQLite storage backend for FrontMCP - local session, elicitation, and event persistence without Redis

latest
Source
npmnpm
Version
1.7.0
Version published
Weekly downloads
142
136.67%
Maintainers
1
Weekly downloads
 
Created
Source

@frontmcp/storage-sqlite

SQLite storage backend for FrontMCP — session, task, elicitation, and event persistence without running Redis.

NPM

When to use it

Reach for SQLite when you need state to survive a restart but do not want a network dependency:

  • Local development — restart frontmcp dev without losing sessions.
  • Single-node deployments — a VPS or container with a mounted volume.
  • CLI / desktop distributions — a single binary with embedded storage.
  • Background tasks — the CLI task runner spawns detached workers that need a shared store the parent process can also read.

Use Redis instead when more than one node has to see the same state — SQLite is a local file, so it cannot coordinate across machines.

Install

npm install @frontmcp/storage-sqlite

better-sqlite3 is a native module and is loaded lazily, so importing @frontmcp/sdk never pulls it in unless you actually enable SQLite. It does not work on Edge/V8-isolate runtimes (Cloudflare Workers) — use Redis or Upstash there.

Usage

Most servers never import this package directly. Point a store at SQLite in config and the SDK wires it up:

@FrontMcp({
  info: { name: 'my-server', version: '1.0.0' },
  apps: [MyApp],
  // Persist sessions across restarts.
  transport: { persistence: { sqlite: { path: './data/frontmcp.sqlite' } } },
  // Persist background tasks (required for the `cli` task runner).
  tasks: { enabled: true, sqlite: { path: './data/tasks.sqlite', walMode: true } },
})
class Server {}

Direct use

import { openDatabase, SqliteSessionStore } from '@frontmcp/storage-sqlite';

const store = new SqliteSessionStore({ path: './data/sessions.sqlite', walMode: true });
await store.set('session-id', { userId: 'u1' }, { ttlSeconds: 3600 });

Stores

ExportBacks
SqliteSessionStoreMCP transport sessions
SqliteTaskStoreBackground tasks (status, outcome, cancel signalling)
SqliteElicitationStorePending elicitation round trips
SqliteEventStoreStreamable-HTTP event replay
SqliteKvStoreGeneric key/value with TTL
SqliteStorageAdapterThe StorageAdapter the SDK's factories accept

Options

OptionDefaultNotes
pathDatabase file. Parent directories are created for you.
walModetrueWrite-ahead logging. Leave on for concurrent readers.
ttlCleanupIntervalMs60000How often expired rows are swept.
encryptionEncrypt values at rest; pass a key to enable.

Operational notes

  • Back up the file. It is ordinary SQLite — copy it, or use sqlite3 .backup.
  • WAL creates sidecar files (-wal, -shm). Ship the whole set, or check point before copying.
  • One writer. Multiple processes can read; concurrent writers serialize. The CLI task runner relies on WAL for exactly this.

Full guide: SQLite Setup

License

Apache-2.0

Keywords

mcp

FAQs

Package last updated on 01 Sep 2026

Related posts