Database MCP servers explained: schema access vs data access

“Database MCP server” describes two different things, and the difference decides how much you should worry about connecting one. Some MCP servers connect an AI agent to a running database, where it can run queries. Others connect it to a schema: the design of a database, as documents and a diagram. They solve different problems and carry very different risk, and it is worth knowing which one you are installing before you paste a connection string anywhere.

What MCP is, in one paragraph

The Model Context Protocol is an open standard for giving an AI assistant tools. A server advertises a list of things it can do, each with a name and a description, and a client such as Claude Code, Claude Desktop, or Cursor lets the model call them. Instead of you copying text into a chat and copying the answer back out, the assistant reads and acts on the real thing, within whatever the server allows.

“Within whatever the server allows” is the whole subject of this article.

Kind one: a server in front of a running database

This kind holds a connection to a database and exposes tools to inspect it and run SQL. It is what most people picture, and it is useful for questions about data: how many orders shipped late last week, which rows look wrong, why this query is slow.

It also means the agent’s reach is the database user’s reach. The things to check:

  • What can the database user do? A read-only role is a real limit. A prompt saying “only run SELECT” is not: it is a request.
  • Which database? A replica or a copy with test data costs little to get wrong. A production primary does not.
  • Where does the data go? Rows the agent reads become part of a conversation with a model. For customer data that is a decision for whoever owns your privacy obligations, not a default.
  • Where does the credential live? Often in a local config file, in plain text, on a laptop.

None of this makes these servers a bad idea. It makes them infrastructure, to be set up with the care you would give any new database client.

Kind two: a server in front of a schema

The second kind never touches a database. It gives the agent the design: tables, columns, keys, relationships, and the diagram, as documents it can read and edit. This is the kind for designing a new schema, changing an existing one, reviewing a proposed change, or simply giving a coding agent an accurate picture of the tables it is writing queries against.

The risk is of a different order:

  • There are no rows to leak. The agent sees structure, not customers.
  • Nothing it does reaches production. A bad change is text in a document, with history, until a person turns it into a migration and runs it.
  • There is no database credential to store.

The trade is that a schema server cannot answer a question about data. It knows that orders has a status column; it does not know how many are pending.

Side by side

In front of a databaseIn front of a schema
The agent works onLive tables and rowsSchema documents and a diagram
Good forQuestions about data, debugging queriesDesigning, changing, and reviewing a schema
Can it see customer data?Whatever the database user canNo
Can it break production?If the user can write, yesNo. It changes a design
What it needsA database credentialA sign-in to the design tool
Where a mistake shows upIn the dataIn a diff, before anything runs

They are not rivals. A team can sensibly run both: a schema server for design work, and a read-only data server against a replica for analysis. The mistake is using the first kind for the second kind’s job, and designing a schema by letting an agent run ALTER TABLE against something real.

Five questions to ask of any MCP server that touches a schema

  1. Is read separate from write, and who enforces it? If the split lives in the client or in a prompt, it is a courtesy. It has to be refused by the server.
  2. Whose permissions does the agent have? It should have yours, and no more: the projects you can see, with the role you hold.
  3. Is there a step the agent cannot take? The strongest control is not a confirmation dialog. It is an action that only a person can perform.
  4. Can other people see what it is doing? On a shared workspace, an invisible editor is a problem regardless of whether it is a model.
  5. Where is the credential? A browser sign-in with a token the client manages beats a key in a file.

How DB Planner’s server answers them

DB Planner hosts a schema MCP server at https://api.dbplanner.io/mcp. It is the second kind: it works on DBML documents and the ER diagram, and has no connection to any database of yours.

  1. Read and write are separate OAuth scopes, chosen on a consent screen. Every tool that changes something checks for the write scope on the server and refuses a read-only token.
  2. Each tool runs as you. It goes through the same permission checks as the app, so the agent sees the organizations and projects your account can and holds the role you hold in each.
  3. An agent can propose a change and cannot merge one. A proposal sits in the project’s Review tab until a person merges it in the app. There is no merge tool. In the same spirit, no tool can set a price on a published template, because that needs the account holder’s own identity and bank details.
  4. The agent appears on the board while it works, in the presence list beside the people there, named after the client and marked as acting for you, with the table it is touching highlighted.
  5. Sign-in is OAuth 2.1 in the browser. No password or API key is written into the client’s configuration.

Setup is one URL; see AI database design. For the working method once it is connected, read how to let an AI agent design your database.

Which one do you need?

If the question starts with “how many” or “why is this slow”, you need the first kind, set up carefully. If it starts with “design”, “add”, “change”, “review”, or “what does our schema look like”, you need the second, and you can connect it without a conversation with your security team about production access, because it has none.