Your AI Agent Can Now Design, Edit and Export Database Schemas with MCP
AI coding assistants are getting better at writing code.
But what happens when your AI agent needs to understand your database?
You could paste your entire database schema into a conversation.
You could export a SQL file, copy it into your AI assistant, ask it to make changes, and manually transfer the result back into your diagramming tool.
Or you could connect your AI agent directly to your database design environment.
That's exactly what Model Context Protocol (MCP) makes possible.
And this is one of the things I've been working on with SchemaSketch.
What if your AI agent could actually work with your database diagrams?
Imagine asking your AI assistant:
- Show me all my database diagrams.
- Explain the relationships in my existing database.
- Add an orders table to my e-commerce schema.
- Check whether my database relationships are correct.
- Convert this SQL schema into a visual database diagram.
- Generate Laravel migrations from my database design.
- Export my schema as PostgreSQL SQL.
- Convert a Mermaid ER diagram into DBML.
Instead of simply discussing these tasks, an MCP-connected AI agent can interact directly with SchemaSketch and perform the corresponding operations.
No manual copy-pasting of DBML between applications.
What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI applications to connect to external tools and services.
Think of it as a bridge between an AI assistant and the applications you already use.
Instead of building a separate integration for every AI provider, an application can expose its capabilities through an MCP server.
An MCP-compatible client can then discover available tools and invoke them when needed.
For SchemaSketch, this means your AI assistant can interact with your actual database diagrams.
Introducing the SchemaSketch MCP Server
SchemaSketch provides a hosted MCP server that exposes 15 tools for working with database diagrams.
It is not a separate AI diagramming engine.
The AI works with the same DBML source used by the SchemaSketch editor.
Here is what it can do.
1. Read and understand your diagrams
Your AI assistant can:
-
get_dbml_syntax_guide- Read the DBML syntax reference. -
list_diagrams- List your saved diagrams. -
get_diagram- Retrieve a diagram, including its DBML source and layout.
This gives the AI access to your actual database design instead of relying on manually supplied information.
2. Create, edit and validate schemas
Your AI assistant can:
-
validate_dbml- Check syntax errors and semantic warnings. -
create_diagram- Create a new database diagram. -
update_diagram- Update an existing diagram or rename it. -
delete_diagram- Delete a diagram.
One important detail: SchemaSketch uses the same DBML validation logic as its visual editor.
Before saving changes, the AI can validate the schema and identify problems such as duplicate names, dangling references and mismatched types.
When updating an existing diagram, the AI can first retrieve the current DBML source, make the requested changes, validate the result and save it.
3. Generate real development artifacts
This is where things get particularly interesting.
Your AI assistant can generate:
| Tool | Output |
|---|---|
export_sql |
PostgreSQL, MySQL, SQL Server or Oracle |
export_laravel_migrations |
Laravel migration files |
export_laravel_models |
Eloquent models with casts and relationships |
export_mermaid |
Mermaid ER diagrams |
export_plantuml |
PlantUML entity diagrams |
You can go from a database design to actual development artifacts without manually converting the schema.
4. Import existing database structures
Already have a database design?
You don't have to start from scratch.
SchemaSketch also provides:
-
import_sql- Convert SQL DDL into DBML. -
import_mermaid- Convert Mermaid ER diagrams into DBML. -
import_plantuml- Convert PlantUML entity diagrams into DBML.
This makes it possible to bring existing database structures into the same workflow.
A practical example
Let's say you're starting a new e-commerce application.
You ask your AI assistant:
Create a database schema for an e-commerce platform with customers, products, categories, orders, order items and payments. Include appropriate primary keys, foreign keys, timestamps and relationships.
With the SchemaSketch MCP server connected, your AI agent can:
- Read the DBML syntax guide.
- Design the database structure.
- Validate the generated DBML.
- Create a new diagram in SchemaSketch.
- Export Laravel migrations and Eloquent models.
- Make further changes when requirements evolve.
You can then open the diagram in SchemaSketch and visually inspect the result.
The important part is that the diagram and the AI-generated schema are working with the same underlying DBML.
Connecting SchemaSketch to your AI assistant
Getting started is straightforward.
Inside SchemaSketch:
- Open the application.
- Click Connect AI agent.
- Generate your personal access token.
- Follow the generated configuration for your AI client.
For clients supporting remote MCP connections over Streamable HTTP, the endpoint is:
https://mcp.schemasketch.dev/mcp
A typical configuration looks like this:
{
"mcpServers": {
"schemasketch": {
"url": "https://mcp.schemasketch.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN"
}
}
}
}
SchemaSketch provides connection options for Claude Code, Claude Desktop and other compatible clients. Claude Desktop uses a packaged extension because its remote connector configuration handles authentication differently.
You can find the complete setup instructions here:
SchemaSketch MCP Documentation
What about Zapier?
MCP isn't limited to coding assistants.
SchemaSketch can also connect to Zapier's MCP Client, allowing its remote MCP tools to be used within Zapier workflows.
Zapier supports connections to remote MCP servers using Streamable HTTP and bearer-token authentication.
The connection uses:
- Server URL:
https://mcp.schemasketch.dev/mcp - Transport: Streamable HTTP
- Authentication: Bearer token generated by SchemaSketch
Once connected, you can make SchemaSketch tools available to your Zapier workflows.
This opens up interesting possibilities for connecting database design operations with other applications and automation workflows.
For example, imagine an automation workflow that uses an AI agent to review a proposed database structure, validate it and create a diagram in SchemaSketch.
The database design becomes part of a wider automation ecosystem.
Learn more about connecting remote MCP servers to Zapier.
Why does this matter?
I believe we're moving towards a development workflow where AI agents don't just generate code.
They interact with the tools developers already use.
Database design is an important part of that workflow, but it is often disconnected from the rest of the development process.
With MCP, SchemaSketch brings database diagrams into the AI development ecosystem.
You can use an AI assistant to explore a schema, propose changes, validate them, and generate development artifacts while keeping the visual database representation available for review.
And because MCP is an open standard, you're not locked into a single AI provider.
What's next?
I'm continuing to expand SchemaSketch and explore more ways to integrate database design into modern development workflows.
The goal is simple:
Make database design accessible not only to developers, but also to the AI tools they use every day.
SchemaSketch is free, including its MCP server. There is no separate AI subscription or premium MCP tier.
If you want to experiment with it:
Let's discuss
I'm curious how other developers are using MCP in their development workflows.
Would you let an AI agent modify your database schema directly, provided every change is validated before being saved?
And what would you want your AI assistant to do with your database that it cannot easily do today?
I'd love to hear your thoughts.
Top comments (0)