dbwatch
Supports local Cloudflare D1 SQLite database files (d1:./local-d1.sqlite) as a target for row-diff tracking, letting agents inspect and revert data changes made by a command against a local D1 database.
Generates a two-line natural-language summary of a database diff's side effects using a local Ollama model (e.g. qwen2.5-coder:7b).
Generates a two-line natural-language summary of a database diff via an OpenAI-compatible API endpoint, which can also point at LM Studio or vLLM servers.
Wraps any command while tracking row-level changes to a SQLite database, returning a compact git-style diff of inserted/updated/deleted rows and allowing the changes to be reverted with inverse SQL.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
dbwatch
One line: npx @kanchingyg/dbwatch sqlite:./app.db -- npm test (or bunx @kanchingyg/dbwatch sqlite:./app.db -- bun test): git-style SQLite/D1 row diff around any command with instant --revert.
Install
bunx @kanchingyg/dbwatch sqlite:./local.db -- npm test
npx @kanchingyg/dbwatch sqlite:./local.db -- npm test
# or install in your project / globally
bun add -d @kanchingyg/dbwatch
npm i -D @kanchingyg/dbwatchJSR:
bunx jsr add @kanchingyg/dbwatch
npx jsr add @kanchingyg/dbwatchRelated MCP server: Drizzle Sentinel MCP
Quick start
npx @kanchingyg/dbwatch sqlite:./local.db -- npm test
bunx @kanchingyg/dbwatch sqlite:./local.db -- bun test
npx @kanchingyg/dbwatch sqlite:./local.db --revert --allow-write -- npm test
npx @kanchingyg/dbwatch --mcpLocal models
npx @kanchingyg/dbwatch sqlite:./app.db --explain --model ollama/qwen2.5-coder:7bPoint baseUrl in MCP explain_side_effects to LM Studio or vLLM (http://127.0.0.1:1234).
Supported DSNs
sqlite:./path/to.dborfile:./path/to.dbd1:./local-d1.sqlite(local Cloudflare D1 SQLite file)Postgres DSN parsing is reserved; use SQLite/D1 for zero-config local diffs today.
MCP Tools Reference
Tool | Mutates | Description |
|
| Snapshot SQLite/D1 tables, execute a child command, and return exit status plus row-level INSERT/UPDATE/DELETE diffs (requires |
|
| Execute inverse SQL statements from the most recent captured diff to restore prior table state (requires |
|
| Summarize captured row mutations in two lines via a local Ollama or OpenAI-compatible model. |
Editor and Agent Integration
Cursor (.cursor/mcp.json)
{
"mcpServers": {
"dbwatch": {
"command": "npx",
"args": ["-y", "@kanchingyg/dbwatch", "--mcp"]
}
}
}Claude Code CLI
claude mcp add dbwatch -- npx -y @kanchingyg/dbwatch --mcpProgrammatic Usage (JSR / TypeScript)
import * as bridge from "jsr:@kanchingyg/dbwatch/bridge";Runtime Safety and Guardrails
Stdio frame isolation:
--mcpkeeps JSON-RPC onstdoutclean.Read-only default:
run_with_db_diff/revert_last_diffneed--allow-write;--dry-runsimulates.Loop breaker: Identical MCP tool calls halt after three repeats.
Revert SQL: Inverse statements use quoted identifiers and escaped literals (SQLite/D1 local files only today).
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Your Supabase account in natural language: run SQL, apply migrations, manage tables, storage, edge f
Executes SQL in a real ephemeral database: rows, typed errors with suggestions, plans, diffs.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
Related MCP Servers
- AlicenseAqualityAmaintenanceOperations toolchain for SQLite, Cloudflare D1, and Turso. Every command is available as both a CLI and an MCP tool: inspect, diff, migrate, monitor, back up, and repair databases. 22 stdio tools, read-only by default.141AGPL 3.0
- FlicenseNot gradedqualityCmaintenanceEnables database governance for Drizzle ORM projects by inspecting schemas, linting migrations for unsafe operations, detecting schema drift, and explaining query plans with performance checks.-
- AlicenseNot gradedqualityAmaintenanceCaptures checkpoints of project files and SQLite tables before an AI agent makes risky changes, then reports differences and rolls them back byte-for-byte, including dropped tables and agent-created junk. Enables agents to snapshot, diff, list, and restore working state with explicit confirmation required before any destructive action.10 npm1MIT
- AlicenseNot gradedqualityAmaintenanceEnables local AI agents to work with SQL workspaces and databases by inspecting schemas, running bounded queries, and managing recoverable imports, previews, applies, diffs, and undos over stdio.1MIT