SchemaSketch MCP Server
Converts SchemaSketch diagrams or raw DBML into Laravel migration files and Eloquent models, including fillable fields, casts, and relationships for Laravel 10 or 11+.
Exports SchemaSketch diagrams or DBML to Mermaid erDiagram syntax and imports Mermaid erDiagram syntax back into DBML.
Exports SchemaSketch diagrams or raw DBML as MySQL SQL DDL.
Exports SchemaSketch diagrams or raw DBML as PostgreSQL SQL DDL.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SchemaSketch MCP Server Convert my ecommerce diagram to Laravel migrations and Eloquent models"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SchemaSketch MCP server
Lets AI agents (Claude, Cursor, Windsurf, Gemini and any other MCP client) read and edit your SchemaSketch database diagrams: list them, read and write DBML, validate it, and convert to and from SQL, Laravel migrations and Eloquent models, Mermaid and PlantUML.
1. Get a token
Sign in at schemasketch.dev/app (free), click Connect AI agent, and generate a token. Choose Read & edit, or Read-only if the agent should only look; read-only tokens hide the tools that change diagrams.
Related MCP server: liz-whiteboard-mcp
2. Connect your agent
Run it locally (npm)
Needs Node 18 or newer. Add this to your MCP client's config:
{
"mcpServers": {
"schemasketch": {
"command": "npx",
"args": ["-y", "schemasketch-mcp-server"],
"env": { "SCHEMASKETCH_TOKEN": "your-token" }
}
}
}Instead of a token you can set SCHEMASKETCH_EMAIL and SCHEMASKETCH_PASSWORD; the
server then logs in by itself. A token is safer, since it can be read-only, expires, and
can be revoked without changing your password.
Or use the hosted server (no install)
Clients that support remote MCP servers with a custom header can connect directly:
{
"mcpServers": {
"schemasketch": {
"url": "https://mcp.schemasketch.dev/mcp",
"headers": { "Authorization": "Bearer your-token" }
}
}
}In Claude Code: claude mcp add --transport http schemasketch https://mcp.schemasketch.dev/mcp --header "Authorization: Bearer your-token"
Claude Desktop
Download schemasketch.mcpb and drag it onto Claude Desktop; it asks for your token.
Tools
The same 15 tools in every setup:
Tool | Does |
| Returns the DBML syntax reference. Call it before writing or editing DBML. |
| Lists your saved diagrams. |
| Fetches one diagram's DBML source and positions. |
| Parses DBML and reports syntax errors and warnings, without saving. |
| Creates a diagram. |
| Replaces a diagram's DBML and/or renames it. |
| Permanently deletes a diagram. |
| SQL DDL (PostgreSQL, MySQL, SQL Server, Oracle) for a diagram or raw DBML. |
| Laravel migration files for a diagram or raw DBML. |
| Laravel Eloquent models (fillable, casts, relationships) for Laravel 10 or 11+. |
| Mermaid |
| PlantUML entity syntax. |
| Converts SQL DDL into DBML (save it with |
| Converts Mermaid |
| Converts PlantUML entity syntax into DBML. |
Good to know
The hosted server allows 60 requests a minute per token. Going over returns
429withretry_afterin seconds.An invalid or expired token returns a message telling you to create a new one.
Agents work better with the SchemaSketch skill installed:
npx skills add SchemaSketch-dev/schemasketch-skills(more install options).
Full documentation: schemasketch.dev/docs
Source and issues
Source: github.com/SchemaSketch-dev/schemasketch-mcp-server. Report problems in its issues or at hello@schemasketch.dev. Changes are listed in CHANGELOG.md.
License
MIT
Available Tools
15 toolscreate_diagramA
Create a new diagram. The DBML is validated first: syntax errors or relationships to missing tables/columns mean nothing is saved; warnings are returned with the result.
Inputs: name (required), dbml_source.
delete_diagramADestructiveIdempotent
Permanently delete a diagram. This cannot be undone — confirm with the user before calling it.
Inputs: diagram_id (required).
export_laravel_migrationsBRead-only
Generate Laravel migration files (one per table, plus a foreign-keys migration) for a diagram.
Inputs: diagram_id, dbml_source.
export_laravel_modelsBRead-only
Generate Laravel Eloquent model files (fillable, casts, and inferred relationships including belongsToMany through plain pivot tables) for a diagram.
Inputs: diagram_id, dbml_source, laravel_version.
export_mermaidBRead-only
Generate Mermaid erDiagram syntax for a diagram.
Inputs: diagram_id, dbml_source.
export_plantumlCRead-only
Generate PlantUML entity syntax for a diagram.
Inputs: diagram_id, dbml_source.
export_sqlBRead-only
Generate CREATE TABLE / ALTER TABLE SQL DDL for a diagram, in a given dialect.
Inputs: dialect, diagram_id, dbml_source.
get_dbml_syntax_guideARead-only
Read this before writing or editing any DBML — the exact syntax SchemaSketch accepts, with a full example.
Inputs: no named parameters.
get_diagramARead-only
Fetch one diagram by id, including its full DBML source and table positions.
Inputs: diagram_id (required).
import_mermaidARead-only
Convert Mermaid erDiagram syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
Inputs: mermaid (required).
import_plantumlARead-only
Convert PlantUML entity syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
Inputs: plantuml (required).
import_sqlARead-only
Convert CREATE TABLE / ALTER TABLE SQL DDL into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.
Inputs: sql (required).
list_diagramsARead-only
List the signed-in user's saved diagrams (id, name, last updated).
Inputs: no named parameters.
update_diagramADestructiveIdempotent
Replace a diagram's DBML source (and/or rename it). This overwrites the whole source — fetch it with get_diagram first if you need to edit rather than replace it outright, and pass its version as base_version so you never overwrite someone else's newer change. New DBML is validated first: errors mean nothing is saved; warnings are returned with the result.
Inputs: diagram_id (required), name, renames, dbml_source, +1 more.
validate_dbmlARead-only
Parse DBML and report syntax errors plus semantic warnings (duplicate names, dangling refs, unrecognized/mismatched types) before saving it. Read-only — never touches the server.
Inputs: dbml_source (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct resource+action: CRUD on diagrams (list/get/create/update/delete), read-only converters (import_sql/import_mermaid/import_plantuml), generators (export_* per format), plus validate_dbml and get_dbml_syntax_guide. The import/export prefixes make directionality explicit, so import_plantuml vs export_plantuml cannot be confused. The descriptions actively reinforce the read-only vs persisted-write boundary.
Uniform snake_case verb_noun pattern throughout: list/get/create/update/delete_diagram, import_*/export_*, validate_dbml. The only mild irregularity is get_dbml_syntax_guide being longer, but it still follows verb_noun and reads clearly.
Fifteen tools for a diagram editor with multi-format import/export is well-scoped: 5 CRUD, 3 imports, 5 exports, plus validation and a syntax guide. Each tool maps to a distinct format or lifecycle operation rather than duplicating another.
Core lifecycle is fully covered: list/get/create/update/delete, validation, syntax help, three import formats and five export formats. Minor gaps exist such as no duplicate/rename-only helper (rename is folded into update_diagram) and no per-table or partial-edit operation, forcing whole-source replacement, but these are workable.
Maintenance
Related MCP Connectors
Read and edit DB Planner database schemas, diagrams and board layouts as an AI agent.
Generate, edit, and export data-architecture diagrams from your AI. Column lineage, PNG in chat.
Create, edit and organize hand-drawn diagrams (flowcharts, ER, architecture) from any AI agent.
ER diagrams from SQL, Prisma or ORM models. One tool, no account, nothing stored.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to generate UML diagrams from text descriptions using PlantUML, supporting multiple output formats (PNG, SVG, PDF), syntax validation, and diagram source extraction.10 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to read and edit entity-relationship diagrams and SQL database schemas on the liz-whiteboard collaborative whiteboard through natural language, supporting table, column, and relationship management.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create, read, update, and delete Draw.io diagrams, allowing automated generation of architectural diagrams, flowcharts, and visual documentation.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to format SQL, explain queries in plain English, analyze schemas, build queries from natural language, and generate migrations, all without requiring a database connection.543 npmMIT