Set up with an AI assistant
Paste one prompt into any AI assistant and let it provision a CapyDB Postgres database - you approve access once in a browser.
One prompt, one approval
You don't have to set up CapyDB by hand. Paste one prompt into any AI assistant - Claude Code, Cursor, Copilot, ChatGPT - and the assistant does the setup: install, authentication, project creation, provisioning, and writing connection variables into your project. You are needed exactly once, in a browser tab: to sign up (if you don't have an account), complete the 1-month free trial checkout (if your organization has no plan), and approve the assistant's access.
Copy this prompt:
Set up a CapyDB Postgres database for this project.
Fetch https://capydb.dev/agents.md and follow the instructions for your environment.
You'll need me once: to approve access in a browser tab. Everything else is yours.The prompt deliberately contains no instructions of its own. It points the assistant at https://capydb.dev/agents.md, a hosted instruction sheet that is versioned with the product - so the steps the assistant follows are always current, and a prompt you copied months ago doesn't rot.
What the assistant does
agents.md routes the assistant down one of three paths based on what it can actually do:
Terminal agents (Claude Code, Cursor, Copilot CLI)
Agents that can run shell commands install the CLI and run a single command:
capydb create --yes --output jsonThat one command covers the whole setup: authentication (it prints a browser approval URL and waits for you to approve), project creation, waiting for provisioning to finish, linking the current directory, and writing connection variables into your env file. The final JSON summary on stdout tells the agent what was created and which env var names were written - without the credential values.
MCP clients
Agents that speak MCP but can't run shell commands add the @capydb/mcp server. When no CAPYDB_API_KEY is configured, the first tool call returns a browser approval URL - you open it, approve, and the server proceeds with project creation and connection details through its tool surface.
Chat-only assistants
Assistants with no execution environment (a chat window in a browser) get a guided path: they walk you through sign-up, the trial checkout, project creation, and creating an API key in the dashboard, and generate the wiring code for your framework for you to paste.
Security
The credential minted through the browser approval is designed to pass through agent context and transcripts, so it is treated as semi-public:
- Scope-limited and expiring. The key carries a fixed, limited scope set and expires after 90 days. Re-approving mints a fresh key.
- Labeled and revocable. It appears under Settings → API keys labeled "AI agent", so you can audit and revoke it anytime.
- Connection strings stay out of chat. Agents are instructed never to print connection strings into the conversation or commits; the CLI writes credentials to a gitignored env file.
- Prefer project-scoped keys for long-lived setups. The approval flow mints an org-wide key suited to interactive sessions. If an agent runs against CapyDB long-term (CI, a standing MCP config), create a project-scoped API key in the dashboard instead, so it can only touch the projects it needs.
Beyond setup
Once connected, the MCP server's tool surface covers the whole working loop, not just provisioning:
- Schema awareness:
get_schemareturns the complete database schema in one call, andgenerate_typesrenders it as TypeScript interfaces, Zod schemas, or a Drizzle schema for the agent to write into your repo - see Type generation. - Undoable changes:
create_restore_point/list_restore_points/delete_restore_pointlet the agent checkpoint before a risky migration and recover into a preview database if verification fails - the agent safety loop. - Sandboxes: preview databases remain the disposable playground for experiments; production-overwrite restores are deliberately not exposed to agents at all.
Next steps
- Prefer doing it yourself? Follow the Quickstart.
- Give your agent ongoing database access with the MCP server - previews, backups, SQL, and more.
- Let agents change schemas safely with the agent safety loop.
- The full command surface is in the CLI reference.
- Wire up a disposable preview database per pull request with the GitHub Action.