AI agents are becoming first-class citizens in developer workflows. They can read code, run tests, and deploy apps. But one thing they struggle with is understanding database schemas.
Database design tools haven't changed in 20 years. You either use a heavyweight desktop app (Navicat, PDManer) or a pretty but closed web app (dbdiagram). Neither supports versioning, real-time collaboration, or AI agent integration.
I built ERD Online to solve this. It's an open-source database design tool that combines Git-like versioning with Figma-like collaboration, plus MCP integration for AI agents.
In this article, I'll show you how to let Cursor, Claude, or Cline read and write your database schema through MCP, while you keep full control.
Database schema changes are hard to track:
- Who changed what?
- When did they change it?
- Why did they change it?
- How do I rollback?
And now with AI agents, there's a new problem: how do you let an AI agent suggest schema changes without giving it a black box that generates random ER diagrams?
The wrong approach: ask AI to "generate an ER diagram for an e-commerce app." You get a diagram, but it has no connection to your actual project, no versioning, and no approval flow.
The right approach: let the AI agent read your existing schema, suggest changes, and submit them as a version that you review and approve.
That's what ERD Online + MCP does.
MCP (Model Context Protocol) is a protocol for AI agents to interact with external tools. Think of it as a USB-C port for AI applications. It standardizes how agents discover and call tools.
MCP has three main primitives:
-
Tools: Functions the AI can call (like
list_projectsorcreate_version) -
Resources: Data the AI can read (like
project.json) - Prompts: Pre-defined templates for common tasks
ERD Online exposes MCP tools that let AI agents:
-
list_projects: List all your ERD projects -
get_project: Get a project's projectJSON -
create_version: Suggest a new version of your schema
The key boundary: AI agents read/write the same projectJSON the human designer uses. They don't generate ER diagrams from a sentence. You stay in control.
Step 1: Mint a PAT in ERD Online
Sign in to ERD Online and go to Account Settings → Personal Access Tokens. Create a new token (read-only is enough to start).
Step 2: Add MCP config to Cursor
Open ~/.cursor/mcp.json and add:
1. AI agents become useful, not dangerous
By giving AI agents structured access to your schema, they can make useful suggestions. But because they go through create_version and you review the diff, they can't silently break your database.
2. Versioning becomes the source of truth
Every AI-suggested change creates a version. You can see exactly what changed, when, and why. This is essential for database schema management.
3. Collaboration improves
Multiple people (and agents) can work on the same schema. Changes are merged, versioned, and reviewed.
4. No vendor lock-in
projectJSON is an open format. You can export your schema, self-host ERD Online, or build your own tools on top of it.
ERD Online
- Live demo (no signup): https://www.erdonline.com/demo
- GitHub: https://github.com/erdonline/erdonline
- MCP docs: https://doc.erdonline.com/docs/guide/api-and-mcp/
- Cursor bridge: https://www.erdonline.com/cursor-mcp/
What would you build?
I'd love to hear what AI + database schema workflows you'd want. Drop a comment or open an issue on GitHub.
Top comments (0)