What is MCP Server and Why It Matters for Database Design
The Model Context Protocol (MCP) lets AI tools interact with external services. Learn how ER Flow's MCP Server enables AI assistants to create and modify database schemas automatically.
If you've used AI coding assistants like Cursor or Windsurf, you know they're great at generating code. But until recently, they were limited to reading and writing files. The Model Context Protocol (MCP) changes that β it lets AI tools interact with external services like databases, APIs, and design tools.
What is MCP?
The Model Context Protocol is an open standard developed by Anthropic that defines how AI assistants communicate with external tools. Think of it like USB for AI β a standard interface that lets any AI tool connect to any external service.
Before MCP, each AI tool had its own proprietary way of connecting to external services (if it could at all). MCP creates a universal standard: the AI tool is the "client," and external services are "servers." The client discovers what tools the server offers, and uses them as needed.
How ER Flow's MCP Server Works
ER Flow provides an MCP Server at https://app.erflow.io/api/mcp/{uuid}. When you configure your AI coding assistant to use this server, the AI gains the ability to read and modify your database schema directly.
The server exposes 25+ tools organized by entity type: tables, columns, indexes, foreign keys, views, triggers, procedures, and primary keys. Each tool has a well-defined interface that the AI understands automatically.
The most important tool is get-data-model-dbml, which returns your entire schema in DBML format. The AI calls this first to understand your current structure before making any changes.
Authentication
The {uuid} in the URL serves as the authentication token. Each data model in ER Flow has a unique UUID, and the server uses it to identify which schema to operate on. No API keys or OAuth flows needed β the UUID grants full read/write access to that specific data model.
You can find your UUID in the ER Flow editor settings or share modal.
Setting Up MCP in Cursor
To connect Cursor to ER Flow, create a .cursor/mcp.json file in your project root:
{
"mcpServers": {
"erflow": {
"url": "https://app.erflow.io/api/mcp/YOUR_UUID_HERE"
}
}Once configured, Cursor can call ER Flow tools when you describe schema changes. For example, telling Cursor "Add a notifications table linked to users and posts" will result in the AI calling create-table, create-column, and create-foreign-key tools automatically.
The Batch Operations Advantage
One of the most powerful tools is batch-operations, which lets the AI execute multiple operations in a single request. Instead of making 20 separate API calls to create a table with 10 columns, 3 indexes, and 2 foreign keys, the AI can do it all at once.
This is especially valuable for initial schema creation: "Create a complete e-commerce schema with users, products, categories, orders, and order items" generates an entire schema in one batch operation.
Real-Time Visual Feedback
Every change the AI makes through the MCP Server appears on the ER Flow visual canvas in real-time. If you have ER Flow open in a browser tab while working in Cursor, you can watch tables and relationships appear as the AI builds your schema.
This visual feedback loop is critical β it lets you verify that the AI is building what you actually need, and catch issues early before they compound.
Why MCP Matters
MCP is still a new standard, and ER Flow is one of the first database design tools to fully embrace it. As more AI tools adopt MCP, the ability to interact with your database schema through natural language will become a standard part of the development workflow.
For developers, this means faster iteration. For non-developers (vibe coders), this means database design becomes accessible without learning SQL. And for teams, it means AI-generated schema changes are visible and reviewable on a visual canvas, not hidden in opaque migration files.