How to let an AI agent design your database, and stay in charge

An AI agent can design a perfectly reasonable database schema in about a minute. That has been true for a while. What has changed is where the result goes. In a chat window it is a block of text you copy somewhere. Connected over MCP, the agent works inside the same project your team does: it reads the real schema, changes real documents, and moves cards on a diagram other people are looking at.

That is more useful and more dangerous, in the ordinary way that giving anyone write access is. This is a workflow for getting the first without the second: the agent does the drafting, and a person decides what lands.

The short version

  1. Connect the agent to a project, not to a database
  2. Start read-only
  3. Brief it like a colleague
  4. Ask for a proposal, not an edit
  5. Review the diagram, not just the text
  6. Merge it yourself, then generate the migration

1. Connect the agent to a project, not to a database

There are two very different things an agent can be connected to. One is a live database, where it runs SQL. The other is a description of a database: a schema document and its diagram. Design belongs in the second. A wrong idea there is a line of text to delete; a wrong idea against a live database is an incident.

DB Planner’s MCP server is the second kind. It is hosted, so there is nothing to install. In Claude Code it is one command:

terminal
claude mcp add --transport http db-planner https://api.dbplanner.io/mcp

Cursor and other clients take the same URL in their MCP configuration. The first time the agent calls a tool, a browser window opens, you sign in, and you choose what it may do. No password or API key is stored in the client. Steps for each client are in the MCP setup guide.

2. Start read-only

The consent screen has a switch for write access. Turn it off for the first session.

This is a real guarantee and not a setting the agent is asked to respect. Read and write are separate OAuth scopes, and every tool that changes something checks for the write scope on the server. An agent holding a read-only token that tries to edit a document is refused, whatever it was told and whatever it decides.

Use the session to find out whether the agent understands what you have. Ask it to list the documents, describe the schema, and name anything that looks wrong. If its description of your schema is off, its changes to your schema will be too, and you have learned that for free. The agent also only ever sees the organizations and projects your own account can, so connecting it at work does not hand it a colleague’s private project.

3. Brief it like a colleague

The most common failure of an AI-designed schema is not bad SQL. It is a schema that is correct in general and wrong for you, because the rules that make your domain yours were never written down. An agent will not guess that invoices must be immutable. It will model them as rows with an updated_at.

So say the rules, and ask for questions before a design:

prompt
You are helping me design the schema for a subscription billing system.
Use the DB Planner project "Billing".

Rules that are not negotiable:
- The billable entity is an account, never a user. A user can belong to several accounts.
- Money is stored as integer minor units. No floats anywhere.
- Invoices are immutable once issued. A correction is a credit note, not an update.
- Nothing financial is ever hard-deleted.

Before you design anything, read the project and ask me whatever you need to know.
When you are ready, submit your change as a proposal. Do not edit the documents directly.

Four sentences of constraints do more than four paragraphs of description. The last two lines matter most: read first, and propose instead of editing. For more openers, see prompts for designing a database with an AI agent.

4. Ask for a proposal, not an edit

With write access on, an agent can edit a schema document directly. For anything beyond a trivial change, do not let it. Ask for a proposal.

A proposal is new text for one or more documents, recorded in the project’s Review tab beside the comment threads. It shows up as a change a person can read. It alters nothing until someone merges it in the app, and it refuses to merge if the document has moved on since the proposal was written, so it cannot silently overwrite a teammate’s work.

The part worth knowing is what the agent cannot do here. There is no tool for merging a proposal. Not a restricted one, not one behind a confirmation: it does not exist. An agent can propose all day and the schema stays exactly as it was until a person presses the button. That is the control point, and it is built into the server, not into a prompt.

5. Review the diagram, not just the text

Reading a generated schema line by line is slow and misses what matters, which is the shape: what hangs off what, which tables stand alone, where a relationship is missing. That is visible in a diagram in seconds.

While the agent works, it is visible too. Each call it makes against a project shows up in the board’s presence list, named after the client and tagged as an agent acting for you, with the table it is working on highlighted. Your teammates are not surprised by cards moving on their own.

The agent can also look. It has a tool that renders the board as an image, so after arranging a layout it can check for overlapping cards and tangled lines the way you would, instead of inferring them from coordinates. Ask it to. “Render the board and fix anything that overlaps” is a complete instruction. When it moves cards, it sends only the ones it moved, so it does not undo a layout someone else is in the middle of changing.

6. Merge it yourself, then generate the migration

Once the proposal reads right and looks right, merge it. Then turn the design into a change you can ship. DB Planner keeps versions of each schema document and compares any saved version with the current one, listing what changed and writing the migration script for PostgreSQL, MySQL, or SQL Server, with the statements that lose data marked.

That script is the second review. A column the agent quietly renamed shows up there as a drop and an add, which is exactly when you want to notice. You can try the same comparison on any two schemas with the free SQL migration generator, and score the result with the schema checker.

What to keep for yourself

An agent is fast at the parts of schema design that are mechanical. It is not accountable for the parts that are not. Keep these:

  • What a thing means. Whether two columns are one fact stored twice or two facts that happen to match is a question about your business. See database normalization for why no tool can answer it.
  • What is allowed to be deleted. Cascades are easy to write and hard to take back.
  • The merge. The server keeps this one for you whether you remember or not.
  • Anything public. Publishing a schema as documentation or as a template reaches people outside your team. An agent with write access can do it, so say in the brief if it must not. It can never set a price: charging for a template needs your own identity and bank details, and no tool takes one.

Why this is different from asking a chatbot

A schema designed in a chat is a draft nobody else can see, built from whatever you pasted in. A schema designed over MCP starts from the real project, lands where the team works, and passes through a review step the agent has no way around. The agent gets better context and you keep the decision. Reading over MCP is part of the free plan; an agent making edits is part of Pro, which has a 7-day free trial.