SuperAPI AI Directory

Litescope

Operations toolchain for SQLite, Cloudflare D1 and Turso: inspect, diff, migrate, monitor, back up and repair databases. Read-only by default.

Open website

About this tool

Litescope is an operations toolchain for production SQLite, primarily serving Cloudflare D1, Turso, and local SQLite files. It aims to solve the problem of SQLite's lack of observability and operational tooling at production scale, especially in multi-tenant architectures where there is one database per tenant and the number of databases can reach thousands.

Purpose

Litescope is used for operational management of SQLite databases, including inspection, diff, migration, monitoring, backup, and repair. It also provides AI agents with a safe database operation interface, letting agents safely interact with production SQLite: diagnose before writing, and be able to roll back after writing.

Main Capabilities

  • MCP integration: Lets agents such as Claude directly access D1 databases via the MCP protocol. Provides a Claude Code plugin containing an MCP server and five skills (lock doctor, safe writes, migration review, fleet sweep, corruption recovery). Supports MCP clients such as Cursor, Claude Desktop, and Windsurf.
  • Read-only tools:litescope_query Enforces token budgets, including a max_rows limit, column projection, and truncation reporting, to prevent large tables from blowing up the agent context window.
  • Write tools: Off by default, require --allow-writes to start; every write defaults to dry-run, and it will not commit without an automatically captured undo point.
  • Prompts and resources: The MCP server exposes prompts (such as diagnose_locked_database, review_migration, safe_optimize, health_checkup) and resources (schema, data dictionary, live health, live lock diagnostics), with subscribable push updates.
  • Interactive views (MCP Apps): Four tools return interactive panels within the conversation; the views are self-contained documents that do not load network resources and do not write.
  • Remote/hosted (Streamable HTTP): Supports stdio and Streamable HTTP transports, with configurable token and Origin allowlists.
  • D1 CLI operations: Rewind (D1 Time Travel), Pull/Push (sync between D1 and local SQLite), Migrate (D1 schema changes), Bisect (binary search for the commit that broke a D1 database).
  • doctor: One-shot check that combines integrity checking, WAL/fragmentation health, index advisor, and schema lint, and can serve as a CI quality gate.
  • snapshot / restore: Point-in-time backup; snapshots are stored in the .litescope-snapshots/ directory, and restore performs an integrity check and a pre-restore safety snapshot first.
  • autopilot: Self-driven optimization that runs ANALYZE + PRAGMA optimize, adds missing foreign key indexes, optionally VACUUMs and removes redundant indexes, defaults to dry-run, and automatically snapshots before real changes.
  • locks: Diagnoses "database is locked", checks journal mode, busy_timeout, locking mode, and WAL bloat, and gives PRAGMA/DSN fix suggestions; --live identifies currently lock-holding processes; --watch records history, --timeline aggregates contention views.
  • diff: Schema and data diff.
  • migrate: Generates and applies migrations, applying safe sequence packagesIncludes preflight integrity checks, VACUUM INTO backups, single transactions, foreign key validation, and automatic rollback on failure.
  • lint: schema anti-pattern checks, with rules including no-primary-key, untyped-column, not-strict, autoincrement-overhead, non-integer-pk.
  • schema: inspect schema and ERD.
  • dump: portable SQL export.
  • import / export: supports CSV, TSV, JSON, Excel (.xlsx), with no external dependencies.
  • monitor: schema drift detection.
  • serve: local Web dashboard, including fleet topology graph, health triage, schema fingerprints, interactive ERD, paginated data browser, visual query builder, drag-and-drop import, and visual diff panel.
  • CI GitHub Action: runs Litescope on every pull request, lints the schema, diffs against the base branch, and comments on the impact scope.
  • npm / npx: for JS and wrangler users, no separate installation required.
  • Binary download: supports macOS, Linux, Windows.

Usage

  • Install the Claude Code plugin to get the MCP server and five skills.
  • Install only the MCP server (read-only): one-line command.
  • To enable writes and D1: add --allow-writes and Cloudflare environment variables; Litescope will still dry-run every write and capture a rollback point before applying.
  • Cursor: one-click add litescope (read-only installation; add in mcp.json --allow-writes and Cloudflare environment variables to enable writes).
  • Claude Desktop / Windsurf / any MCP client: add directly to the configuration file.
  • Remote/hosted: use the Streamable HTTP transport, POST JSON-RPC messages to the endpoint (default /mcp). Before exposing publicly, use --http-token(or the LITESCOPE_MCP_TOKEN environment variable) and --http-origin to lock it down.
  • Bind a database:litescope mcp ./app.db, or via litescope://schema/{source}、litescope://dictionary/{source}、litescope://health/{source}、litescope://locks/{source} to access any source.

Use cases

  • Multi-tenant applications managing hundreds of databases on Turso and D1.
  • Need to let AI agents safely modify production databases with rollback capability.
  • Check schema changes and migration risks in CI.
  • Diagnose issues such as database locks, WAL bloat, and schema drift.
  • Perform point-in-time backup and restore for local and Turso databases.

Limitations

  • Write tools are disabled by default and must be explicitly enabled.
  • The remote HTTP endpoint is open if there is no token, and the server will print a warning.
  • Interactive views do not perform writes; button actions are handed back to the conversation.
  • The hosted dashboard is a paid service, but the software and all features are free and self-hostable.
  • A commercial license (AGPL exception + support SLA) must be obtained by contacting us.
  • Specific pricing and hosted plan details are not yet provided.