Rowsafe

السجل الرسمي البيانات وقواعدها

Database backups and an AI agent safety net: restore points, health, audited changes as you.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

Remote (streamable-http)
Claude Code
claude mcp add --transport http rowsafe 'https://api.rowsafe.sh/mcp' --header 'Authorization: <Optional. Without it, your AI app signs in with Rowsafe (OAuth 2.1): you approve it in the Rowsafe dashboard and it can read your databases'\'' health, backups and recommendations, save Marks if you allow, and, if you allow it to act, run backups and checks and make changes as you, right away, with your rights. With an API key, it acts as the person who created the key. For clients without OAuth, send a Rowsafe API key instead.>'
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "rowsafe": {
            "type": "http",
            "url": "https://api.rowsafe.sh/mcp",
            "headers": {
                "Authorization": "<Optional. Without it, your AI app signs in with Rowsafe (OAuth 2.1): you approve it in the Rowsafe dashboard and it can read your databases' health, backups and recommendations, save Marks if you allow, and, if you allow it to act, run backups and checks and make changes as you, right away, with your rights. With an API key, it acts as the person who created the key. For clients without OAuth, send a Rowsafe API key instead.>"
            }
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Rowsafe
  2. Try it now
  3. Link it to the dashboard
  4. What's in this repository
  5. Safety
  6. Build
  7. Contributing and security
  8. License

Rowsafe

The database admin you never hired. Rowsafe looks after the databases you run on your own servers: backups you can restore to any second, a restore test every week, monitoring with one-click fixes, and a safety net for AI coding agents.

This repository is the open-source part of Rowsafe: the agent, the rowsafe CLI, the installer and the MCP server. Everything that touches your data is here, under Apache-2.0.

Docs: rowsafe.sh/docs

Databases, on Linux servers and in Docker:

  • PostgreSQL 13–18, MySQL 8.0/8.4, MariaDB 10.6–11.4, MongoDB 6.0–8.0, ClickHouse 24.8–26.8
  • Redis 7.0+ and Valkey 7.2+ (standalone servers)
  • SQLite (restore to any second needs WAL mode)
  • OpenSearch 2.x/3.x (single node; snapshots every 5 minutes: restores go back to a snapshot or a Mark, not to any second)
  • Qdrant 1.13+ (single servers; snapshots every 15 minutes, only of the collections that changed: restores go back to a snapshot or a Mark, not to any second)
  • Meilisearch 1.12+, Community Edition, on Linux servers (snapshots every 15 minutes when something changed: restores go back to a snapshot or a Mark, not to any second)

Features per database: protocol.EngineCapabilities.

Try it now

On your database server (Linux, or Docker):

curl -fsSL https://rowsafe.sh | sudo sh
sudo rowsafe status shop                  # protected? backups, the change log, the last restore test
sudo rowsafe mark shop before-migration   # a restore point (a Mark)
sudo rowsafe restore shop --to "10m ago"  # a copy as it was then, next to production; rewind rows brings rows back
sudo rowsafe channels add --type slack --name ops --url https://hooks.slack.com/...   # alerts, and the weekly Pulse
sudo rowsafe upgrade shop --to 18         # a new PostgreSQL major: a test on a copy, a Mark, then the upgrade (undo for 7 days)

Every engine above, with nothing sent to Rowsafe: continuous backups to your own bucket (encrypted on the server, with a passphrase only you have), Marks, a weekly restore test, restore to any second (or rewind the whole database, with undo), a second copy, alerts, Pulse with history, logs, security fixes, file backups, standbys and Prometheus metrics. From your laptop or an AI agent, over SSH: rowsafe add shop ssh://root@db1. All of it: Rowsafe on your server.

From anywhere, on a database you can connect to (managed ones too):

curl -fsSL https://rowsafe.sh/cli | sh
rowsafe add shop postgres://user@host:5432/dbname   # once: checks it connects, saves it on this computer
rowsafe pulse shop                                  # a 0–100 health score and what to fix
rowsafe fix shop                                    # apply a fix, after you confirm
rowsafe insights | top | activity | settings | tune shop
rowsafe schema shop [TABLE…]                        # tables, columns, keys, indexes (used or not): compact for an AI agent
rowsafe explain shop "SELECT …"                     # why a query is slow, and the index that would likely help
rowsafe preview shop 0042.sql                       # check a migration first: locks, rewrites, a verdict
rowsafe mcp shop --allow-writes                     # the same as MCP tools for Claude Code, Codex or Cursor
rowsafe use shop                                    # in a project: then just `rowsafe pulse`

Pulse checks cleanup falling behind, bloat, duplicate and unused indexes, stuck sessions, locks, connections, replication slots, transaction ID wraparound and settings. The connection string stays in your config folder, readable only by you; rowsafe pulse postgres://… works once without saving, and rowsafe use shop makes it a project's database. Through a pooler, everything works but the fixes that run inside the database. Nothing is sent to Rowsafe. rowsafe help local has the rest; the demo above is a real recording.

MySQL and MariaDB work the same way (rowsafe add shop mysql://user@host:3306/dbname), and so do MongoDB (mongodb://), Redis and Valkey (redis://). MySQL and MariaDB: stuck sessions and locks, long transactions, InnoDB's old row versions, the buffer pool, free space inside tables, unused and duplicate indexes, tables without a primary key and the slow query log, with fixes to end a session, drop an index, turn on the slow log and rebuild a table. Not yet: schema, explain, preview, replication checks, and MariaDB settings changes (they live in its configuration file).

On Windows, download rowsafe-windows-amd64.exe (or -arm64.exe) from the latest release; the commands from anywhere work there, fixes included, except MySQL for now.

The dashboard adds every server and database in one place, alerts from outside when a server is down, email, charts, teams and Rowsafe Storage. Free for one server.

sudo rowsafe login                    # on a server set up above: keeps its backups, Marks and restore tests
rowsafe login                         # on your computer
rowsafe hosts add root@203.0.113.10   # then add more servers: installs the agent over SSH

Or install on a new server already linked: curl -fsSL https://rowsafe.sh | sudo sh -s -- --account.

Rewind: continuous backups, restore to any second.

rowsafe mark before-drop                  # a named restore point (a Mark)
rowsafe rewind copy app --at "14:04"      # a copy as of 14:04, next to production
rowsafe rewind compare app                # rows missing or changed in production
rowsafe rewind rows app public.orders     # bring the missing rows back
rowsafe rewind database app --at "14:04"  # rewind in place, with undo

Proof: a weekly automatic restore test (rowsafe proof app).

Pulse: a 0–100 health score with fixes you apply (rowsafe pulse, rowsafe fix app), slow queries (rowsafe top app), insights and tuning.

Guard: rowsafe mcp, the Claude Code and Codex plugins and the GitHub Action save a Mark before migrations, destructive SQL and deploys. AI agents act as the person who connected them, right away, with exactly that person's rights, like a CLI token; what that person can't do, Rowsafe refuses and says why. Owners can set a monthly budget for agents (Settings → AI agents). Every agent action is in the audit log.

Rowsafe Cloud: PostgreSQL servers Rowsafe runs for you, billed by the hour (never more than the monthly price), with all of the above on from the first minute.

rowsafe cloud sizes                         # clouds, regions, sizes, prices, what is sold out
rowsafe cloud create shop-db --wait         # the cheapest size free now; only this computer may connect
rowsafe env --on shop-db                    # the app's database and login, DATABASE_URL in .env
rowsafe connect shop-db                     # psql, as a temporary user removed when you quit
rowsafe cloud allow shop-db 203.0.113.4     # let the app's server connect
rowsafe cloud resize shop-db medium         # a Mark first; asks before the restart
rowsafe cloud clone shop-db shop-test --at "10m ago" --delete-after 1d
rowsafe cloud passphrase shop-db --file shop-db-passphrase.txt
rowsafe cloud delete shop-db                # asks you to type the name

The first server billed by the hour gives you a link to add a card, once. Database passwords never pass through Rowsafe: rowsafe env makes the password on your computer and sends only its SCRAM verifier, and other passwords are made on the database server and encrypted for your terminal. rowsafe help cloud has the details.

The CLI does what the dashboard does, as the person behind the key and with that person's rights: security (rowsafe security fix app restrict_access --allow 10.0.0.0/16), the server's security updates and reboots, alert rules, logs and log forwarding, the maintenance window, standbys, moves, upgrades and more. Every change asks first on a terminal; scripts and AI agents pass --yes, and --json prints JSON. rowsafe help all lists everything.

Full guide: Quickstart.

What's in this repository

PathWhat it is
cmd/rowsafe-agent, internal/agentThe agent: outbound HTTPS only, a fixed set of tasks, no arbitrary commands or SQL.
cmd/rowsafe, clientThe CLI.
mcp, integrations/Guard: the MCP server, Claude Code and Codex plugins, and the GitHub Action (rowsafe/action).
collect, tuneMonitoring, and settings recommendations.
pulse, localThe health score and its fixes, and Rowsafe on a connection string (rowsafe pulse postgres://…).
protocolAPI types shared by the agent, the CLI and the control plane.
internal/pgbackrest, internal/pginspectPostgreSQL.
internal/engineMySQL/MariaDB, MongoDB, ClickHouse, Redis/Valkey, SQLite, Qdrant, Meilisearch.
scripts/install.shThe installer served at https://rowsafe.sh.
scripts/cli.shThe CLI installer served at https://rowsafe.sh/cli (macOS and Linux).
integrations/npmThe rowsafe npm package: downloads the release's CLI for the platform (checked against SHA256SUMS) on first run.
release, cmd/rowsafe-releaseRelease signing and verification.

Safety

  • Never restarts or changes production on its own. Restarts, fixes, rewinds and settings changes run only when a person confirms them, or when an AI agent they connected asks with their rights (audited; Rowsafe saves a Mark first for risky ones).
  • Fixes come from a fixed list and are re-checked on the server right before they run.
  • Restore tests and copies are isolated from production and its backups.
  • Your data and secrets stay on your server. Backups are encrypted before upload; Rowsafe sees table names and counts, not rows.
  • Signed, reproducible releases with automatic rollback. See verifying releases.
  • Monitoring is read-only. ROWSAFE_COLLECT_QUERY_TEXT=false keeps query text on your server; ROWSAFE_MONITORING=false turns it off.
  • No usage tracking unless you turn it on. The CLI sends nothing about how you use it by default. rowsafe telemetry on sends, after each command, its name (cloud create, never its arguments), the CLI version, OS, exit code, a duration range, whether a terminal or an AI agent ran it, whether you're logged in, and a random ID made on this computer. rowsafe telemetry status shows exactly what goes out; rowsafe telemetry off, ROWSAFE_TELEMETRY=0 or DO_NOT_TRACK=1 stop it. The schema is protocol/telemetry.go.

Build

make build. Locally built agents never auto-update.

Contributing and security

CONTRIBUTING.md · docs in rowsafe/docs · report vulnerabilities through security advisories (SECURITY.md).

License

Apache License 2.0. Copyright 2026 Adraa Labs.

الأسئلة الشائعة

ما هو Rowsafe؟

Database backups and an AI agent safety net: restore points, health, audited changes as you.

كيف أثبّت Rowsafe؟

يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http rowsafe 'https://api.rowsafe.sh/mcp' --header 'Authorization: <Optional. Without it, your AI app signs in with Rowsafe (OAuth 2.1): you approve it in the Rowsafe dashboard and it can read your databases'\'' health, backups and recommendations, save Marks if you allow, and, if you allow it to act, run backups and checks and make changes as you, right away, with your rights. With an API key, it acts as the person who created the key. For clients without OAuth, send a Rowsafe API key instead.>'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Rowsafe إلى مفتاح API؟

نعم. يتطلب Authorization، وتضبطها في إعداداته.

هل Rowsafe مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص Apache-2.0.

من يصون Rowsafe؟

ينشره rowsafe. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.