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.
| Transport | Credentials | Write tools | |
|---|---|---|---|
rowsafe mcp | stdio, on your machine | The CLI's login, or ROWSAFE_API_KEY | Off by default. --allow-restore-points or --allow-writes. |
https://api.rowsafe.sh/mcp | Streamable HTTP | Sign 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 registration | Client ID metadata documents (an HTTPS client_id), or dynamic registration (RFC 7591) at /oauth/register. Public clients, no secret. |
| Grant | Authorization code with PKCE, S256 only. The response carries iss (RFC 9207). |
| Redirect URIs | Exact 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. |
| Scopes | rowsafe: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. |
| Tokens | Access: 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(orcreate_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 mcpregisters read tools plus copy tools, which never touch production (preview_migrationruns SQL on a fresh copy as a regular role;create_safe_copymakes masked copies only, within your plan).--allow-restore-pointsadds onlycreate_restore_point.--allow-writesadds actions that don't touch production,request_change,create_cloud_server,cloud_firewall,apply_fixandcreate_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 localrowsafe mcpthe 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) anddelete_safe_copyare 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
| Tool | Access | What it does |
|---|---|---|
safety_check | read | Is the database protected now? |
create_restore_point | Marks | Set a Mark and wait until it's in your bucket. |
list_restore_points | read | Marks with status and the backup to restore from. |
rewind_window | read | How 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_moment | read | Find 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
| Tool | Access | What it does |
|---|---|---|
fleet_health | read | Every problem in the fleet, worst first, with the next step. |
get_org | read | Plan, 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_hosts | read | Hosts: online or not, agent version, update channel and state. |
list_databases | read | Databases with a health summary. |
get_database | read | One database in depth: settings, schedules, WAL, recent backups, Proof runs, tasks, problems. |
list_backups | read | Backups, newest first. |
list_drills | read | Proof runs with failures and warnings. |
list_tasks | read | Tasks, filtered by database, status and type. |
get_task | read | One task: result, end of its log, next step. |
backup_storage | read | Backup size per bucket, estimated monthly cost, and whether a second copy exists and is current. |
files_status | read | Folders 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
| Tool | Access | What it does |
|---|---|---|
database_health | read | Pulse: health score (0-100) and findings with what to do. Without a database: every score. |
database_insights | read | Largest tables, unused and duplicate indexes, estimated bloat, dead rows, tables that may need an index. |
query_trends | read | Queries that took the most time, and which got slower; or one query over time. |
recommendations | read | Recommendations: 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_alerts | read | Firing, 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_activity | read | What a database runs now, longest first, and lock chains (who blocks whom). Ends nothing. |
database_metrics | read | Database and server numbers over time (CPU, memory, load, disk, connections, transactions, cache hits, locks, lag, size): min, average, max, latest, or data points. |
disk_forecast | read | When the disk fills: free space, growth per day and week, estimated date. |
uptime | read | How often the database answered over 24 hours, 7 and 30 days, and the incidents. |
database_settings | read | Server settings that matter, explained, with memory, CPUs, disk, what Rowsafe recommends, and recent changes. |
get_logs | read | The database's log (values removed on the server): errors, slow queries, lock waits, failed logins, or repeated messages with counts. |
security_status | read | Security grade (A to F), findings worst first, a checklist, and checks from the internet. Never shows passwords or keys. |
weekly_pulse | read | "Your weekly Pulse" for the last 7 days. Sends nothing. |
audit_log | read | Who did what, when: filter by target, action, actor and time. |
Running the database
| Tool | Access | What it does |
|---|---|---|
updates_status | read | Updates: running version, newer minor and majors, the server's security updates and reboot, automatic updates, latest upgrade check and rehearsal. |
standby_status | read | The 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_status | read | Connection pooling: on or off, whether root allowed it, settings, connection strings (no passwords), live pool numbers. |
list_forks | read | Forks 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_server | read | Databases, users and extensions inside one server, as last read. |
Copies: never production
| Tool | Access | What it does |
|---|---|---|
preview_migration | copies | Preview a migration: run its SQL on a fresh copy and get a verdict with suggestions. |
get_preview | read | A preview's result, if not done within the wait; without an ID, a database's recent previews. |
create_safe_copy | copies | A 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_copies | read | Safe copies, status, where to connect; with masking, which columns are masked and how. |
extend_safe_copy | copies | Keep a safe copy longer (up to 168 hours from now). |
delete_safe_copy | copies | Delete a safe copy. |
Actions that don't touch production
| Tool | Access | What it does |
|---|---|---|
run_backup | write | Queue a full, diff or incr backup. |
run_drill | write | Queue a Proof run. |
verify_database | write | Prove WAL reaches the bucket; activates the schedules. |
update_schedule | write, destructive | Change the schedules (UTC cron) and retention_full. |
plan_adoption | write | Register 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_alert | write | Acknowledge a firing alert: no more repeats. |
dismiss_recommendation | write | Set a recommendation aside with a reason, or bring it back (undo). |
run_index_check | write | Look for missing indexes now, tested on a copy on the database's server. |
check_upgrade | write | Read-only preflight for a major upgrade: blockers and possible modes. |
rehearse_upgrade | write | Upgrade a throwaway copy, check it, measure downtime, delete it. A passed rehearsal allows the real upgrade. |
run_security_check | write | Re-read security settings and re-check the port from the internet now. |
backup_files | write | Back up the database's folders (or with server, a server's own) now, optionally tagged; with check, run the files Proof instead. |
Rowsafe Cloud
| Tool | Access | What it does |
|---|---|---|
cloud_catalog | read | What 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_servers | read | Servers 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_server | read | One 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
| Tool | Access | What it does |
|---|---|---|
request_change | write | Change 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_server | write | Create 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_firewall | write | Set who can connect to a Rowsafe Cloud server: server and the whole new allowed_ips list. Same as request_change cloud_firewall. |
apply_fix | write | Apply 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_change | read | Actions 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_approval | read | One 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_approvals | read | Changes AI agents and API keys made, newest first. |
create_app_database | write | A 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:
| Group | Actions |
|---|---|
| Pulse | apply_fix, change_settings, revert_settings, index_check_settings, restart, turn_on_backups |
| Rewind | restore_copy, compare_copy, extend_copy, delete_copy, bring_back_rows, rewind_in_place, undo_rewind, finish_rewind |
| Updates | update_database, upgrade_database, undo_upgrade, finish_upgrade, security_updates, reboot_server, auto_updates |
| Standby | create_standby, promote_standby, rebuild_standby, remove_standby, unfence, forget_fence, failover_settings |
| Move | move_database, move_schedule, move_switch, move_cancel, move_switch_back, move_finish, fork_database, restore_elsewhere, retire_database |
| Security | pooling_on, pooling_off, security_settings, security_action |
| Data | create_app_database (through the create_app_database tool), manage_databases_users, masking_rules, delete_database |
| Files | restore_files, undo_files_restore, restore_server_files, undo_server_files_restore |
| Alerts | alert_rule |
| Rowsafe Cloud | create_cloud_server, cloud_firewall, resize_cloud_server, clone_to_new_server, delete_cloud_server |
- Paid.
create_cloud_server,resize_cloud_serverandclone_to_new_serverrecord 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_serveris destructive: Rowsafe types the server's name for the agent and records it. Rowsafe Cloud changes. - Extensions.
manage_databases_usersturning onvector,postgisortimescaledbinstalls the package first where root allowed PostgreSQL updates.timescaledbneedsrestart: trueinparamsunless already loaded: Rowsafe saves a Mark, then restarts PostgreSQL once (apps disconnect for a few seconds); the agent tells you first. Extensions. - Restart later.
restarttakesparams.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_elsewhererestores a database whose server has been silent 10 minutes onto another server with the same storage and passphrase (name,host_id, andatormark; neither: the latest point).retire_databasethen removes the old one (confirm: its name); its backups are kept. Server lost. - A server's files.
restore_server_filesandundo_server_files_restoretakehost(hostname or ID) andconfirm(its hostname). A server's own files. - Always refused.
create_standby,rebuild_standby,move_databaseandfork_database: a person compares the server's key in the dashboard or CLI. A destructive action with no backup yet (the agent canrun_backupand retry). Where Proof runs is a dashboard setting agents can't change. - Within a budget.
create_cloud_serverruns on the owner's behalf, pluscreate_app_database,cloud_firewallandclone_to_new_serveron 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 setROWSAFE_API_KEYin the server's environment. -
Tools missing: write tools,
request_changeand 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_orgshows 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