MantisDocs

Introduction

Mantis is a hosted Postgres backend for AI coding agents — Claude Code, Codex, Cursor, Windsurf, Cline, and Antigravity. Your agent gets a backend it can't break.

You describe the app; your agent builds it. Mantis gives your agent a Postgres 17 database per branch, a typed client, live queries, built-in auth, pgvector hybrid search, file and HLS video storage, and declarative webhooks and crons — while making sure nothing it does to main is permanent until a person says so.

How it keeps the backend safe

  • Branches & snapshots. A branch is a full copy of main, schema and data. Save named snapshots before risky scripts, restore them instantly, or reset any branch back to its parent.
  • Schema & mass-write guardrails. On main, dropping a table or column, changing a type, loosening an access rule, or running an unfiltered or bulk update/delete (write guardrails) is held until someone on your team approves it in the dashboard. Safe steps apply at once.
  • Scoped agent keys & activity feed. Give coding agents an agent (mk_agent_) or branch_only (mk_branch_) key that can never write to main. Every action is logged in the Agent Activity Feed with 1-click Rewind.
  • Rewind. Every write is recorded. Preview and rewind a branch, a table, or a single row back to any timestamp, or undo the latest migration with its dropped data brought back.
  • GitHub PR previews. npx shipmantis ci init provisions an isolated pr-<n> branch per pull request, posts a schema safety comment, and cleans up on close.

The pieces

PieceWhat it is
npx shipmantis@latest initSigns you in, picks a project, writes keys to .env.local, and configures Claude Code, Codex, Cursor, Windsurf, Cline, and Antigravity.
@shipmantis/sdkTypeScript schema DSL (tables, pgvector, rules, guardrails, webhooks, crons), typed client, live queries (useQuery), built-in auth (client.auth, useUser), and files.
VideoHLS packages made by your own ffmpeg, stored as one entry each and played from public or signed links.
The 19 MCP toolsWhat your agent uses to read schemas, plan and apply migrations, branch, snapshot, reset, rewind, inspect activity and webhooks, trigger crons, and query data.
The CLIEvery operation in a terminal: push, branch, snapshot, activity, ci init, pr-check, rewind, undo, connect, video.
The dashboardApprove held schema changes and mass writes, browse tables and end-users, inspect activity, replay webhooks, run crons, manage snapshots, and rewind.

Where things run

Your app talks to one URL, https://data.shipmantis.com, using one of four key kinds:

  • Secret (mk_secret_…) stays on your server. Full access to schema, branches, rewind, and rows.
  • Publishable (mk_pub_…) is safe in a browser. Queries, built-in auth, and storage only, enforced by your access rules.
  • Agent (mk_agent_…) is for coding agents. Attributed as agent in the activity feed; schema drops, mass writes, and rewinds on main are held for human approval.
  • Branch-only (mk_branch_…) is for sandboxed agents and CI. Full read/write on non-main branches; writes and schema changes on main are refused.

On this page