MCP Server

The MCP server lets your own AI agent work inside DbSchema. An AI agent is an AI program that does tasks for you, such as Claude Code, Codex, Cursor or GitHub Copilot. Through the server, the agent can read and change your design, and query the databases that you allow.

MCP stands for Model Context Protocol. It is an open standard that lets an AI agent use the tools of another program. Each tool is one action that the agent can ask DbSchema to do, such as "list the tables" or "add a column".

Beta feature. The MCP server settings show only after you turn on beta features. The server needs DbSchema Pro or Architect.

What the agent can do

You ask the agent in your own words, as you would ask a colleague. For example: "In DbSchema, list the tables of the open project and explain how orders relate to customers." The agent then chooses the DbSchema tools that the task needs.

AreaWhat the agent can do
ProjectsList the open projects. Open, create or save a project.
The designRead tables and columns. Create and change tables, columns, indexes and foreign keys.
DiagramsCreate a diagram, add tables to it and arrange them. Add groups, notes and shapes.
DatabasesRead sample rows, run a query and show its query plan, on the connections that you allow.
ChangesCompare the design with a database, and open the synchronization dialog for you to review.
EditorsOpen the SQL Editor, the Query Builder or the Data Explorer with the agent's work in it.

The design is your DbSchema project: the tables, columns and diagrams that you see in DbSchema. The database is the real database on the server. A change to the design does not change the database until you apply it.

Turn on the MCP server

  1. Choose Edit → Settings.
  2. Choose Projects in the tree, and tick Enable Beta Features.
  3. Choose AI → MCP in the tree, and tick Enable MCP server.
The DbSchema Settings dialog on the Projects page, with Enable Beta Features ticked at the bottom

The server starts at once. The line under the check box says where it runs, such as "Serving at http://127.0.0.1:29292/mcp, no calls yet". The number at the end of the address is the port, 29292 by default.

The MCP page of the DbSchema Settings: Enable MCP server ticked, the server serving at 127.0.0.1 on port 29293, the security token and the Security box

The server starts again each time you start DbSchema, until you untick Enable MCP server. With the free Community edition, ticking the box asks you to upgrade first.

Connect your AI agent

Each AI agent has a settings file. The file tells the agent the address of the server and the security token, a secret code that proves the agent may connect. DbSchema writes these settings for you.

  1. On the same AI → MCP page, find your agent in the list of Claude Code, Codex, Cursor and GitHub Copilot.
  2. Press Configure beside it.
  3. Restart the agent if it is running, so that it reads the new settings.
The agent list of the MCP page: Claude Code is Configured, Codex is Not configured, each with its Configure button

The status beside the agent changes to "Configured": the agent's settings file now holds the server's address and token. "Not installed" means that DbSchema did not find the agent on this computer.

For an agent that is not in the list, see Configure other agents.

Try your first request

  1. Open a project in DbSchema.
  2. In your agent, type a request that names DbSchema, such as "In DbSchema, list the tables of the open project."

The agent answers with the tables of your project. In DbSchema, the MCP badge in the toolbar pulses while the agent works. See what the agent did shows where to find each request.

Let the agent use a database

The agent can read the design of the open projects. It can use a real database only through a connection that you allow.

  1. Choose Database → Manage Connections.
  2. Press the edit button of the connection.
  3. Open the Access and Model tab, and tick Allow AI tools to access this database connection.
  4. In the dialog that asks you to confirm, press Allow AI access.
The Access and Model tab of the PostgreSQL connection, with Allow AI tools to access this database connection ticked
The AI Access dialog: Let the AI use the connection PostgreSQL? It says that DbSchema asks before every change, and suggests a database user for the AI

The agent connects with the database user and password of that connection. To limit what the agent can do, create a database user with only the permissions that the agent needs. Then use that user in the connection.

The same check box also lets DbSchema's own AI Assistant use the database.

Approve what the agent asks

Each project has an AI tool preset: a setting that decides which tools run without asking, which ask you first, and which are off. To choose it, choose File → Properties and set AI Tool Preset.

PresetWhat the agent may do in the project
No model accessNothing.
Read onlyRead the design.
Edit accessRead and change the design. It asks before it deletes something or saves the project file. This is the default.
Full accessRead and change the design without asking.

The preset does not control the two kinds of request that use a database:

  • DbSchema asks you before the agent reads the rows of a table. You can change that in Edit → Settings → AI → Security.
  • DbSchema always asks you before the agent changes a database. No setting turns this question off.

When a request asks first, DbSchema opens Confirm the AI's request, and the agent waits for your answer.

The Confirm the AI's request dialog for data_sample on the PostgreSQL connection: risk class Read data, the arguments, the SELECT statement, and the buttons Allow, Allow until DbSchema exits and Don't allow

The dialog shows the tool that the agent wants to use, the values that it passes to the tool, and the SQL statement. Then choose one:

  • Allow runs this request.
  • Allow until DbSchema exits runs this request. Until you close DbSchema, every other request that only reads data on this connection runs without asking.
  • Don't allow refuses the request.

Edit → Settings → AI → Security also holds the rules for the tools that are not part of a project, such as running SQL or changing settings. AI Permissions explains every one of these settings.

See what the agent did

While the server runs, an MCP badge shows in the toolbar. Click it to open the AI → MCP page of the settings. The connection box beside it says "AI access" when agents may use that database.

The DbSchema toolbar with the PostgreSQL connection marked AI access and the MCP badge

DbSchema records every request that an agent sends to its tools. To see them, choose Help → Output Logs and open the AI tool calls tab. The link Show the calls of AI agents, on the AI → MCP page, opens the same tab.

The AI tool calls tab of the Output Logs: the time, the consumer MCP agent, the tool, the outcome and the duration of each call

Click a request to see the database connection, the values that the agent passed to the tool, and your answer.

Keep the server safe

The Security box on the AI → MCP page sums up how the server is protected:

  • Only this computer can connect. The server uses the address 127.0.0.1, which always means "this computer". Other computers on your network cannot connect to it.
  • Only programs that send the security token can use the server.
  • You choose which databases and tools the agents may use.
  • DbSchema records every request of an agent.

If someone else may have seen your security token, press Regenerate beside it. Then press Configure again for each agent, and restart the agent. Until then, the agent still sends the old token, and the server refuses it.

Configure other agents

Configure writes these files, where ~ stands for your home folder:

AgentSettings file
Claude Code~/.claude.json
Codex~/.codex/config.toml
Cursor~/.cursor/mcp.json
GitHub Copilot (VS Code and Copilot CLI)~/.copilot/mcp-config.json

Configure updates only the DbSchema settings in the file, and keeps all your other settings. Comments in a JSON file are removed, though. Before DbSchema changes a file for the first time, it saves a copy with .bak added to the name.

For any other agent that supports MCP, press Copy JSON. DbSchema copies the settings that the agent needs, with the address and the security token. Add them to the agent's list of MCP servers. Keep these settings private, because they hold the token.

Common problems

The MCP page is missing from the settings

Beta features are off. Tick Enable Beta Features in Edit → Settings → Projects.

"Couldn't start … port 29292 was in use, possibly by another DbSchema window"

Another program already uses the port, often a second DbSchema window.

The MCP page showing Couldn't start: port 29292 was in use, possibly by another DbSchema window, with the Retry button and the port 29292

Close the other window and press Retry. Or type another port, such as 29293, and press the check-mark button beside it. The server's address changes with the port, so press Configure again for each agent, and restart it.

The status says that the server needs DbSchema Pro

Your license stopped covering Pro while the server was on. DbSchema now runs as the free Community edition, so the server refuses every request. Register a Pro or Architect license.

The agent says that it has no database

No connection allows AI access yet. Tick Allow AI tools to access this database connection, as Let the agent use a database shows.

The agent stopped working after I pressed Regenerate

The agent still sends the old security token. Press Configure for it again, and restart it.

Next steps