Skip to content
Rowsafe
Docs

MCP server

Connect Claude Code, Claude Desktop and other MCP clients to Rowsafe, with every tool listed.

Rowsafe's MCP server lets AI assistants read what the dashboard shows and, if you allow it, set Marks, run backups, Proof and checks, change production, or create Rowsafe Cloud servers. Changes run right away as the person who connected the agent, with that person's dashboard rights, or Rowsafe refuses them and says why (How AI agents act). Part of Guard.

TransportCredentialsWrite tools
rowsafe mcpstdio, on your machineThe CLI's login, or ROWSAFE_API_KEYOff by default. --allow-restore-points or --allow-writes.
https://api.rowsafe.sh/mcpStreamable HTTPSign in with Rowsafe (OAuth), or Authorization: Bearer rsk_...API keys: always listed (a read-only key can't use them). Signed-in apps: create_restore_point with Save Marks; write tools, request_change, the change tools and create_app_database with Act for you.

ChatGPT, Claude, Cursor, VS Code, Codex or Windsurf: see Connect AI apps.

Set up

Run rowsafe login first, then pick a mode:

# Read-only
claude mcp add rowsafe -- rowsafe mcp

# Read-only, plus Marks (what the Claude Code plugin uses)
claude mcp add rowsafe -- rowsafe mcp --allow-restore-points

# Also backups, Proof, checks, schedules, and changes to production as you
claude mcp add rowsafe -- rowsafe mcp --allow-writes

# A specific key instead of your login, in every project
claude mcp add --scope user rowsafe -e ROWSAFE_API_KEY=rsk_... -- rowsafe mcp

--scope project writes .mcp.json into your repo for everyone. Don't put a key there; use the stdio form (each developer's own login).

Sign in with Rowsafe (OAuth)

The remote endpoint is an OAuth 2.1 protected resource per the MCP authorization spec (2026-07-28). Clients discover everything from the first 401: give them only the URL.

Protected resource metadata (RFC 9728)https://api.rowsafe.sh/.well-known/oauth-protected-resource/mcp, named in WWW-Authenticate on every 401
Authorization server metadata (RFC 8414)https://api.rowsafe.sh/.well-known/oauth-authorization-server (issuer https://api.rowsafe.sh)
Client registrationClient ID metadata documents (an HTTPS client_id), or dynamic registration (RFC 7591) at /oauth/register. Public clients, no secret.
GrantAuthorization code with PKCE, S256 only. The response carries iss (RFC 9207).
Redirect URIsExact match. ChatGPT's, Claude's, VS Code's and Cursor's published callbacks, and loopback (http://127.0.0.1, http://[::1], http://localhost, any port).
Resource (RFC 8707)https://api.rowsafe.sh/mcp. Tokens work on /mcp only.
Scopesrowsafe:read (always). rowsafe:marks (optional, Save Marks: adds create_restore_point). rowsafe:act (optional, Act for you: adds the write tools, copy tools, request_change, create_cloud_server, cloud_firewall, apply_fix, create_app_database, and lets the app act as the person who allowed it). offline_access accepted; other scopes ignored.
TokensAccess: 1 hour. Refresh: 30 days, single use, rotated each refresh; reusing one disconnects the app. Revocation (RFC 7009) at /oauth/revoke.

An owner or admin approves each app in the dashboard, for one organization; the app then acts as that person. Settings, Connected apps lists apps, who allowed them, whether they can act yet, and lets you disconnect them.

Safety model

  • Same API as the CLI. Same key, checks, plan limits and audit log. Every change is in rowsafe audit, attributed to the key or app and the person it acts as.
  • Only what the API can do. Tools queue fixed agent tasks and change schedules. Nothing runs commands or SQL on production or reads backup contents: Rowsafe can't.
  • Changes to production run as the agent's person. Restores, rewinds, restarts, fixes, settings, updates, standbys, moves, pooling, security fixes, Rowsafe Cloud servers and the rest go through request_change (or create_cloud_server, cloud_firewall, apply_fix, create_app_database). Rowsafe checks the current role of the person behind the agent (who allowed the app, made the key, or approved the CLI login). Owner or admin: it makes the dashboard's own API call as them, at once, with the same checks, confirmations and Marks. Restarts still need root's permission at install. The tools never call those endpoints directly.
  • Or Rowsafe refuses, and nothing changes. For example: a member's agent, a key made by another key, an app or key from before agents could act, no backup before a destructive change, a first payment only an owner can make, a server key to compare, over the agents' budget. The agent tells you the reason. Nothing waits for a person. Keys and assistants can't change what AI agents may do. When Rowsafe refuses.
  • Read-only unless you say otherwise. rowsafe mcp registers read tools plus copy tools, which never touch production (preview_migration runs SQL on a fresh copy as a regular role; create_safe_copy makes masked copies only, within your plan). --allow-restore-points adds only create_restore_point. --allow-writes adds actions that don't touch production, request_change, create_cloud_server, cloud_firewall, apply_fix and create_app_database.
  • No secrets through Rowsafe. People set passwords in the dashboard: new users, resets, restored copies, safe copies made through the remote endpoint. Exception, create_app_database: from local rowsafe mcp the password is made on your machine and only its verifier is sent; on the remote endpoint the person creates the database in the dashboard, where only their browser sees the password. Bucket keys and the passphrase never leave your server. Outputs are size-capped.
  • Not exposed: enrollment tokens, API keys, removing hosts, members and roles, plan changes, agent update settings, what root allowed on a server.
  • Annotations. Read tools are marked read-only. request_change, cloud_firewall, apply_fix, update_schedule (lower retention deletes old backups) and delete_safe_copy are marked destructive, so clients that confirm destructive calls ask you. Tool descriptions also tell agents to confirm disruptive, destructive or paid changes with you in chat first.

Tools

Read: always there. Marks: --allow-restore-points or Save Marks. Copies (never production): always for rowsafe mcp and API keys; signed-in apps need Act for you. Write: --allow-writes, a read-write key, or Act for you.

Is it safe? Marks and Rewind

ToolAccessWhat it does
safety_checkreadIs the database protected now?
create_restore_pointMarksSet a Mark and wait until it's in your bucket.
list_restore_pointsreadMarks with status and the backup to restore from.
rewind_windowreadHow far back you can rewind: earliest and latest second, newest Marks, any restored copy, data kept aside by a rewind, and whether the whole database can be rewound on its server.
find_momentreadFind the moment rows were deleted or changed, or a table emptied or dropped: the exact time and the point just before. Also lists earlier searches.

Fleet, backups and tasks

ToolAccessWhat it does
fleet_healthreadEvery problem in the fleet, worst first, with the next step.
get_orgreadPlan, limits, usage, and the AI agents setting agent_autonomy: level (act, default, or budget), budget_cents (null: none), unlimited, spend_cents (agents' servers' monthly cost now), remaining_cents, set_by, acting_as (this agent's person) and asks_first (this app or key can't change anything until its person lets it act). Its text says who the agent acts as and what Rowsafe refuses.
list_hostsreadHosts: online or not, agent version, update channel and state.
list_databasesreadDatabases with a health summary.
get_databasereadOne database in depth: settings, schedules, WAL, recent backups, Proof runs, tasks, problems.
list_backupsreadBackups, newest first.
list_drillsreadProof runs with failures and warnings.
list_tasksreadTasks, filtered by database, status and type.
get_taskreadOne task: result, end of its log, next step.
backup_storagereadBackup size per bucket, estimated monthly cost, and whether a second copy exists and is current.
files_statusreadFolders backed up with a database, or with server, with a server itself: status, last snapshot, size, how far back; with at, the files backup nearest that time.

Pulse: health and monitoring

ToolAccessWhat it does
database_healthreadPulse: health score (0-100) and findings with what to do. Without a database: every score.
database_insightsreadLargest tables, unused and duplicate indexes, estimated bloat, dead rows, tables that may need an index.
query_trendsreadQueries that took the most time, and which got slower; or one query over time.
recommendationsreadRecommendations: schema, query and capacity ideas with why, cost and a plan, and indexes proven on a copy with each query's speedup. Without a database: each one's top one.
list_alertsreadFiring, resolved or all alerts, newest first, with value vs threshold and next step; one alert by ID; or the alert rules and where notifications go (channel names and kinds, never addresses).
live_activityreadWhat a database runs now, longest first, and lock chains (who blocks whom). Ends nothing.
database_metricsreadDatabase and server numbers over time (CPU, memory, load, disk, connections, transactions, cache hits, locks, lag, size): min, average, max, latest, or data points.
disk_forecastreadWhen the disk fills: free space, growth per day and week, estimated date.
uptimereadHow often the database answered over 24 hours, 7 and 30 days, and the incidents.
database_settingsreadServer settings that matter, explained, with memory, CPUs, disk, what Rowsafe recommends, and recent changes.
get_logsreadThe database's log (values removed on the server): errors, slow queries, lock waits, failed logins, or repeated messages with counts.
security_statusreadSecurity grade (A to F), findings worst first, a checklist, and checks from the internet. Never shows passwords or keys.
weekly_pulseread"Your weekly Pulse" for the last 7 days. Sends nothing.
audit_logreadWho did what, when: filter by target, action, actor and time.

Running the database

ToolAccessWhat it does
updates_statusreadUpdates: running version, newer minor and majors, the server's security updates and reboot, automatic updates, latest upgrade check and rehearsal.
standby_statusreadThe standby: in sync or not, streaming or via the bucket, lag, fenced old primaries, automatic failover, connection strings; with candidates, servers that could hold one.
pooling_statusreadConnection pooling: on or off, whether root allowed it, settings, connection strings (no passwords), live pool numbers.
list_forksreadForks and move-ins with progress, or one fork. When the database's server is offline, source_lost: since when, whether it can be restored to another server now, and the servers that can take it.
list_databases_on_serverreadDatabases, users and extensions inside one server, as last read.

Copies: never production

ToolAccessWhat it does
preview_migrationcopiesPreview a migration: run its SQL on a fresh copy and get a verdict with suggestions.
get_previewreadA preview's result, if not done within the wait; without an ID, a database's recent previews.
create_safe_copycopiesA safe copy, always masked. Locally the password is made on your machine and returned once; on the remote endpoint the copy starts without one and you set it at the returned dashboard link.
list_safe_copiesreadSafe copies, status, where to connect; with masking, which columns are masked and how.
extend_safe_copycopiesKeep a safe copy longer (up to 168 hours from now).
delete_safe_copycopiesDelete a safe copy.

Actions that don't touch production

ToolAccessWhat it does
run_backupwriteQueue a full, diff or incr backup.
run_drillwriteQueue a Proof run.
verify_databasewriteProve WAL reaches the bucket; activates the schedules.
update_schedulewrite, destructiveChange the schedules (UTC cron) and retention_full.
plan_adoptionwriteRegister a database on a host and make a read-only plan, or plan again. Turning backups on is a change (request_change turn_on_backups).
ack_alertwriteAcknowledge a firing alert: no more repeats.
dismiss_recommendationwriteSet a recommendation aside with a reason, or bring it back (undo).
run_index_checkwriteLook for missing indexes now, tested on a copy on the database's server.
check_upgradewriteRead-only preflight for a major upgrade: blockers and possible modes.
rehearse_upgradewriteUpgrade a throwaway copy, check it, measure downtime, delete it. A passed rehearsal allows the real upgrade.
run_security_checkwriteRe-read security settings and re-check the port from the internet now.
backup_fileswriteBack up the database's folders (or with server, a server's own) now, optionally tagged; with check, run the files Proof instead.

Rowsafe Cloud

ToolAccessWhat it does
cloud_catalogreadWhat a new Rowsafe Cloud server can be: engines (postgresql, mysql, mariadb, valkey, clickhouse, opensearch, qdrant, meilisearch where offered) with versions, ports, memory needed and whether backups are snapshots only; each cloud's regions and sizes (CPUs, memory, disk); hourly price and monthly maximum; traffic included; what's sold out; where a standby is possible; PostgreSQL extensions available from the start; whether pay as you go is active; how many servers the organization may have.
list_cloud_serversreadServers Rowsafe created for the organization (Rowsafe Cloud and your own cloud accounts): status, region, size, price, the name apps connect to, who can connect, and the database once ready.
get_cloud_serverreadOne server: status and progress (or what went wrong), size, price, how apps connect (host like x7kq2mfa3pzd.cloud.rowsafe.sh, read-only host, port, sslmode), who can connect, its database once ready. Can wait during setup.

An agent that needs a database for its app follows Need a database?: cloud_catalog, create_cloud_server (after you agree to the price), get_cloud_server, cloud_firewall if needed, then create_app_database.

Changes to production

ToolAccessWhat it does
request_changewriteChange production: action, database, params and your reason, like the dashboard's button. Runs at once: the answer starts with Done, names the person it ran as, and the change is approved (done) or failed, with its result and dashboard page. Or: Rowsafe refused this change, and nothing changed: and the reason.
create_cloud_serverwriteCreate a Rowsafe Cloud server: name, region, size, engine (PostgreSQL unless mysql, mariadb, valkey, clickhouse, opensearch, qdrant or meilisearch), engine_version, allowed_ips, standby, extensions, reason. Same as request_change create_cloud_server. When a first payment is needed, an owner's agent gets a checkout_url for you; the server is created once paid.
cloud_firewallwriteSet who can connect to a Rowsafe Cloud server: server and the whole new allowed_ips list. Same as request_change cloud_firewall.
apply_fixwriteApply a fix Rowsafe proposed: database, finding_id, fix_id, and confirm if it restarts the database. Like Apply fix: Rowsafe recomputes the fix and saves a Mark first when the fix says so.
describe_changereadActions by group, with risk and the JSON schema of their params. For one action, also whom it would run as here and what would make Rowsafe refuse it.
get_approvalreadOne change an agent made: approved (done, with its tasks) or failed (with why). Older records may say pending, denied, expired or cancelled: those never ran. Name kept for compatibility.
list_approvalsreadChanges AI agents and API keys made, newest first.
create_app_databasewriteA new empty database and its owner user, for the app you're building, on a Rowsafe Cloud server running PostgreSQL 15+, MySQL, MariaDB or ClickHouse. Rowsafe never sees the password. PostgreSQL from local rowsafe mcp: made on your machine, created at once as the agent's person (an owner or admin), full connection string returned. MySQL, MariaDB, ClickHouse, and the remote endpoint: the tool says so, and the person creates it in the dashboard (Databases & users), which shows the connection string once. Valkey has no separate databases: make the app's login in the dashboard. OpenSearch, Qdrant and Meilisearch: the person makes the app's user or API key in the dashboard (Databases & users), shown once.

The actions request_change can make:

GroupActions
Pulseapply_fix, change_settings, revert_settings, index_check_settings, restart, turn_on_backups
Rewindrestore_copy, compare_copy, extend_copy, delete_copy, bring_back_rows, rewind_in_place, undo_rewind, finish_rewind
Updatesupdate_database, upgrade_database, undo_upgrade, finish_upgrade, security_updates, reboot_server, auto_updates
Standbycreate_standby, promote_standby, rebuild_standby, remove_standby, unfence, forget_fence, failover_settings
Movemove_database, move_schedule, move_switch, move_cancel, move_switch_back, move_finish, fork_database, restore_elsewhere, retire_database
Securitypooling_on, pooling_off, security_settings, security_action
Datacreate_app_database (through the create_app_database tool), manage_databases_users, masking_rules, delete_database
Filesrestore_files, undo_files_restore, restore_server_files, undo_server_files_restore
Alertsalert_rule
Rowsafe Cloudcreate_cloud_server, cloud_firewall, resize_cloud_server, clone_to_new_server, delete_cloud_server
  • Paid. create_cloud_server, resize_cloud_server and clone_to_new_server record the size and price; the agent tells you first. A first payment is always an owner's: an owner's agent gets the checkout link, others are refused. delete_cloud_server is destructive: Rowsafe types the server's name for the agent and records it. Rowsafe Cloud changes.
  • Extensions. manage_databases_users turning on vector, postgis or timescaledb installs the package first where root allowed PostgreSQL updates. timescaledb needs restart: true in params unless already loaded: Rowsafe saves a Mark, then restarts PostgreSQL once (apps disconnect for a few seconds); the agent tells you first. Extensions.
  • Restart later. restart takes params.at: a time (RFC 3339, up to 30 days ahead) or "window" for a Rowsafe Cloud server's next maintenance window. Restart now or later.
  • A lost server. restore_elsewhere restores a database whose server has been silent 10 minutes onto another server with the same storage and passphrase (name, host_id, and at or mark; neither: the latest point). retire_database then removes the old one (confirm: its name); its backups are kept. Server lost.
  • A server's files. restore_server_files and undo_server_files_restore take host (hostname or ID) and confirm (its hostname). A server's own files.
  • Always refused. create_standby, rebuild_standby, move_database and fork_database: a person compares the server's key in the dashboard or CLI. A destructive action with no backup yet (the agent can run_backup and retry). Where Proof runs is a dashboard setting agents can't change.
  • Within a budget. create_cloud_server runs on the owner's behalf, plus create_app_database, cloud_firewall and clone_to_new_server on servers created this way; everything else runs as the agent's person. When Rowsafe refuses.

Two prompts: incident_triage checks the fleet, reads the evidence behind each problem, and proposes next steps without changing anything. fix_what_pulse_found lists a database's fixable findings, lets you pick, and files each with request_change.

Troubleshooting

  • "not logged in" in the client's MCP log: run rowsafe login, or set ROWSAFE_API_KEY in the server's environment.

  • Tools missing: write tools, request_change and the change tools need --allow-writes; Marks need --allow-restore-points. Restart the client after changing flags. A signed-in app needs Act for you (and Save Marks); reconnect it to change that.

  • forbidden (403): This API key is read-only.: the key can only read.

  • "Rowsafe refused this change, and nothing changed": the reason follows (When Rowsafe refuses). If the app or key predates agents acting as their person, that person clicks Let it act as me in Settings → Connected apps (or Let agents using it act as me under API keys), or reconnects it.

  • A new Rowsafe Cloud server isn't created yet: it waits for its first payment. An owner pays at the checkout link the agent gave.

  • A 402 error: a plan limit is reached. get_org shows usage.

  • Smoke test without a client:

    printf '%s\n' \
      '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"0"}}}' \
      '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
      '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | (cat; sleep 2) | rowsafe mcp
Edit on GitHub