Cursor database: how to give your Cursor app one

By Codata IO team Last updated 8 Nov 2026 7 min read
Animation: a Cursor card writes code and connects out over an MCP server with OAuth sign-in to a cloud card, where database, login, app email and hosting tick in one by one. A closing strip reads: every schema change is a plan you approve before it deploys.
TL;DR

Cursor now gives cloud-agent apps a Postgres database, which suits internal tools. For an app with its own users, you also need sign-up, email, and a way to review and undo the agent's schema changes. That's what a cloud like Codata IO adds.

Cursor built your app in an afternoon, and a Cursor database is now one prompt away. The harder question comes later: what happens when the app gets real users and the agent keeps changing the schema?

This guide covers both routes, when you outgrow the built-in one, and how to connect a cloud over MCP.

Can Cursor connect to a database?

Yes, in two ways. Apps built by a Cursor cloud agent get a Postgres database that Cursor provisions, on paid plans. In the editor, Cursor connects to any other database through an MCP server.

MCP, the Model Context Protocol, is an open standard for connecting AI apps to outside systems such as databases and tools. Cursor asks for your approval before the agent uses an MCP tool, unless auto-run is on, per Cursor's MCP docs.

Cursor's Apps docs cover provisioning, publish checks and sharing. They don't describe how schema changes to that database are reviewed or reversed. That matters once the data is real.

Cursor databases: built in for internal tools, a cloud for real users

The real choice is between two routes. Cursor Apps suit a tool your team signs in to. A cloud such as Codata IO suits an app that strangers sign up for.

Cursor Apps, built inCodata IO
DatabasePostgres, provisioned by CursorPlanned and migrated for you, with a REST API per table; no SQL console or connection string
Who signs inPeople you share with, via Cursor sign-in, or anyone with a public linkYour app's own users, with email, Google or guest sign-in
Email to usersNot in Cursor's docs yetSent from your own domain
Schema changesNot in Cursor's docs yetA plan with a diff that you approve
UndoNot in Cursor's docs yet; admins can unpublishRestore any version in about 45 seconds
ExportNot in Cursor's docs yetAll data and users, bcrypt hashes included
Built forInternal tools, dashboards, shareable appsCustomer-facing apps

Sources: Cursor Apps docs and changelog, checked 8 Nov 2026; Codata IO product review, 2 Nov 2026.

Start with Cursor Apps for a team tool. Nothing goes live until its security checks pass and you publish. Codata IO is the cloud for agentic coding: where agents deploy safely and apps run and go live.

Two other routes exist. A local SQLite file suits testing, but users cannot reach it. A hosted database such as Supabase over MCP gives you Postgres and sign-in, and you wire hosting and app email yourself. Our guide to Supabase alternatives compares them.

Signs you've outgrown a built-in database

These are the moments where vibe-coded apps break after launch:

  • Strangers sign up, so the app needs its own accounts, not your team's sign-in.
  • You need to email users: confirmations, password resets, receipts.
  • A schema change has to keep the rows you already have.
  • The agent changed something, and you need it undone today.
Animation on a dark background: a path from an internal tool on Cursor Apps to an app with real users on Codata IO. Five additions tick in along the way: sign-up for your own users, email from your domain, plan approval, restore and export.
From internal tool to real users. Illustration, not a real screenshot.

How to review and undo your agent's schema changes

Review each schema change before it deploys, and keep versions you can restore. A cloud agent will change this schema again, often while you're not watching.

What is a schema migration?

A schema migration is a versioned change to a database's structure, such as adding a table, renaming a field or changing a type. Safe migrations are backward compatible, so old and new code keep working during the rollout.

The usual pattern is expand and contract. Add the new field, backfill it from existing rows, switch the app over, then drop the old one.

Destructive steps, like dropping a column or narrowing a type, are the risky case because they remove data. An agent asked to rename a field may drop and recreate it in one step, and the old values go with it.

How Codata IO reviews schema migrations

On Codata IO, every schema change Cursor makes is a plan with a diff of tables, endpoints and relationships. Nothing deploys until you approve it, in your coding agent or with Deploy in the dashboard.

Guardrails check each change against existing data and block unsafe migrations. In one test, a plan refused to make an older table private in place, which would have exposed or hidden every row.

Every deploy is a version. A restore takes about 45 seconds and keeps the history, but it brings back the schema, not deleted data. Values in fields the restore removes do not come back, so export first.

After each deploy, Codata re-tests every endpoint against the live API. Coach turns a live error into a fix prompt for your agent.

Animation on a dark background: a plan from Cursor lists an added field and updated endpoints with Discard and Deploy v2 buttons. A version line grows from v1 to v2, then Restore v1 adds v3 marked from v1, with history kept. An amber panel reads: a restore brings back the earlier schema, not the values stored in fields it removes. Export your data first.
Plan, version, restore. Illustration, not a real screenshot.
Your agent will change this schema again. Will you see the plan first?Connect Cursor

Which platforms run coding agents in the cloud, triggered from your own app?

Cursor's Cloud Agents, formerly Background Agents, run in isolated cloud VMs, and they build Cursor Apps. Your app can start one with a POST to /v1/agents in the Cloud Agents API, in public beta.

GitHub documents starting its Copilot cloud agent through an API. The Claude Code GitHub Action runs on any GitHub event, built on the Claude Agent SDK.

An agent that changes apps unattended is exactly why each schema change should come back as a plan you approve. That is agentic infrastructure done safely.

How coding agents work with Codata IO

Your coding agent runs where it already does: Cursor, Claude Code, Codex, Copilot, Lovable or Replit. It connects to Codata IO over MCP with a one-line setup prompt and OAuth sign-in. From there it reads the project's current state and docs, proposes each change as a plan, and waits for your approval. What your own agent does costs nothing.

Prefer not to bring an agent? Choose "Build it here with Codata" instead. You describe the app in Codata's chat, and Codata builds the backend, then the app, with a live preview. That route uses App Builder credits.

How to connect Cursor AI to a database with MCP

To connect Cursor AI to a database, add its MCP server to Cursor, sign in and ask the agent to set up your tables. Here is the flow, with Codata IO as the example.

  1. Open Cursor's MCP settings. Go to Cursor Settings, then Tools & MCP. Or list servers in .cursor/mcp.json, or ~/.cursor/mcp.json for every project.
  2. Add the server URL. Add a server named codata with the URL https://mcp.codata.io/mcp. The exact Cursor config is in Codata IO's Cursor setup guide.
  3. Sign in when asked. Codata IO uses OAuth 2.1 sign-in, so there are no API keys or tokens to paste.
  4. Give the first prompt. In Cursor's agent chat, type "Set up Codata as my backend", then describe your app.
  5. Approve the tool calls. Cursor asks before each MCP tool runs, unless auto-run is on.
  6. Approve the plan, then check the tables. Codata returns a plan with a diff and an explanation, and waits for your approval in Cursor. Then open Databases to see who can see each table.

Sources: Cursor docs: Model Context Protocol (mcp.json, tool approval). Settings path per Supabase's MCP docs. Both checked 4 Nov 2026.

Nothing is charged for what Cursor does over MCP; you pay only for usage. For Claude Code and Codex, see how to give your AI agent a database through MCP.

Which backend database is ideal for vibe coding?

For most vibe-coded apps, a hosted Postgres-family database is the common default. The engine matters less than what surrounds it.

What a vibe-coded app needs from its database:

  • Sign-in tied to rows, so each user owns their data.
  • Access rules you can read, then test as a real user.
  • Schema changes the agent cannot push through without review.
  • Backups or a full export, so a bad change is recoverable.
OptionData modelAccess rulesSchema changes
Cursor AppsPostgres, provisioned by CursorCursor sign-in, team sharing or a public linkNot in Cursor's docs yet
SQLiteRelational files the app reads directly, with no serverYour app codeYour own migration scripts
SupabaseA full Postgres database per projectRow Level Security policies you write in SQLMigrations through its MCP server; branching on paid plans
Firebase (Cloud Firestore)NoSQL documents in collectionsSecurity Rules with Firebase AuthenticationNo fixed schema; the rules carry the access logic
NeonPostgres with copy-on-write branchesPostgres roles and policies you write; managed auth built on Better AuthBranches for testing; instant restore
Codata IOPlanned and migrated for you; a REST API per tableRow ownership enforced by the database; "Who can see this", "View as user"Plan you approve, guardrails, restore

Sources: SQLite, Supabase database, Supabase MCP, Cloud Firestore, Neon, checked 5 Nov 2026. Cursor Apps, checked 8 Nov 2026. Codata IO product review, 2 Nov 2026.

Pick by who owns the access rules. If an engineer will write RLS policies, Supabase or Neon fit. If nobody will, choose generated, checkable rules. Need realtime updates or vector search? Codata IO has neither today, and Firestore's realtime listeners suit live sync.

What to do if Cursor deleted your database

If Cursor deleted or changed your data, stop the agent first. Then restore from a backup or an earlier version.

  1. Stop the agent. Stop the run in Cursor and turn off auto-run.
  2. Find out what changed. Read the agent's tool calls and note which tables or fields it dropped.
  3. Check backups and version history. On Supabase, Free has no automatic backups, and Pro keeps daily backups for 7 days, per Supabase pricing. On Codata IO, restore the last good version.
  4. Restore, then check the data. Confirm the rows you need are back.

FAQ

Can Cursor connect to a database?

Yes. A Cursor App built by a cloud agent gets a Postgres database from Cursor, on paid plans with cloud agents. For any other database, add an MCP server in Cursor's settings or an mcp.json file, and approve each tool call.

Does Cursor have a built-in database?

Yes, for apps built by a cloud agent: Cursor Apps provisions Postgres on paid plans with cloud agents. That suits internal tools. Sign-up for your own users, email, migrations, rollback and export aren't in Cursor's docs yet. An app with real users needs a cloud that covers them.

How do I add a database to a Cursor app?

Two ways. Ask a Cursor cloud agent to build an app, and Cursor provisions Postgres for it. Or add an MCP server in Cursor's settings and ask the agent to set up tables. With Codata IO, add https://mcp.codata.io/mcp, sign in, type "Set up Codata as my backend" and approve the plan.

What are the best MCP servers for Cursor?

The best MCP servers for Cursor depend on the job. A database server, such as Supabase's, gives the agent your tables. A docs server gives it current documentation. Codata IO's server adds sign-in, email and hosting. Our guide to giving an AI agent a database compares the options.

Can I undo a database change Cursor made?

Yes, if your database keeps versions or backups. On Codata IO, every deploy is a version, and restoring one brings back its schema in about 45 seconds. Data in fields the restore removes does not come back, so export your data before you restore.

Is there an enterprise backend for vibe-coded apps?

Codata IO gives reviewers the controls agent-built apps need: plan approval before deploy, hash-pinned plans and agent deploys tagged with their source. It adds row ownership, write-only secrets, signed webhooks and full export. SSO, MFA, enforced roles, an SLA and backup or region commitments are not available yet.

Give your Cursor app real users, and every change a plan you approve

Connect Cursor to Codata IO with one MCP server. Your users sign up, get email from your domain, and every schema change waits for your approval.

Connect Cursor
Related reading
Blog MCP database: how to give your AI agent a real database Blog Best Supabase alternatives in 2026: 7 options for AI builders