Airsc is free for everyone. If it helps you, support it with $2–$20.

Support
MCP serverSafeDatabase & backendBeginner friendly Verified live

erd-editor

dineug · dineug/erd-editor

Visual database schema designer with an MCP server that enables AI agents to create and edit entity-relationship diagrams live.

ERD Editor: design database schemas visually, import SQL DDL, GraphQL, DBML and AML, export DDL and code for 22 languages. Web app, Google Drive, VS Code, IntelliJ, Obsidian, a custom element, and an MCP server that lets coding agents edit diagrams live.

1.7k stars158License: MITUpdated 7 days ago0 opens

Preview

▍

What you can do with it

  • Ask Cursor to design a database schema visually based on requirements
  • Let an agent update existing ERD diagrams as code changes
  • Generate SQL DDL from a diagram designed interactively by an agent

Verified live · 60 tools

We started this MCP server in an isolated sandbox and it exposed these tools:

  • erd_list_documents

    Lists ERD documents with path, open, active, dirty and readonly. With an editor serving the working directory (the VS Code extension, the Obsidian plugin or the JetBrains IDE plugin) it lists that edi

  • erd_open_document

    Opens a document for editing, in the ERD editor of the editor that serves it, if one does (the VS Code extension, the Obsidian plugin or the JetBrains IDE plugin). With create it makes the file first

  • erd_save

    Saves a document an editor holds to disk. VS Code keeps edits unsaved until this is called; Obsidian and JetBrains IDEs save them as they save the user’s edits, and this writes them at once. On disk,

  • erd_undo

    Reverts the last edit this agent made to the document, never the user’s edits. Calls that made no undo entry are skipped and named.

  • erd_redo

    Applies again the edit erd_undo last reverted.

  • erd_read

    Reads a document as a snapshot, as DDL, as its raw JSON or, with the scripts format, its before and after scripts alone. The sql format of the whole document includes the document's before and after s

  • erd_list

    Lists a document: its settings and counts, then a page of tables, each with its id, position and size on the ERD canvas (the width approximate, the height exact), with their indexes and relationships

  • erd_get

    Gives the entities named, in full: tables with their columns and size, relationships with their columns, indexes with their columns, memos with their text, table groups with their tables. Ids and name

  • erd_add_table

    Adds an empty table at a free spot and returns its id in createdIds. Name it with erd_change_table_name.

  • erd_remove_table

    Removes a table with its columns, indexes and every relationship that touches it.

  • erd_change_table_name

    Renames a table.

  • erd_change_table_comment

    Sets the comment of a table.

  • erd_change_table_color

    Sets the color of a table.

  • erd_move_table

    Moves a table to an absolute canvas position.

  • erd_move_tables

    Moves several tables to absolute canvas positions in one edit, which one erd_undo reverts. Plan the layout from the positions and sizes erd_list gives.

npx -y @dineug/erd-editor-mcp · 12/10/2026

Safety check

Safe

No risky patterns found in the files we scanned.

Automated scan of the repo files. Always review code you run.

From the README

ERD Editor

Entity-Relationship Diagram Editor

English | 한국어 | 中文 | 日本語

Design a database schema visually, bring in one you already have from SQL DDL, GraphQL SDL, DBML or AML, and take it out as DDL or as generated code. ERD Editor is one editor and one file format on erd-editor.io, in Google Drive, VS Code, IntelliJ-based IDEs and Obsidian, and in your own page as a custom element, and a coding agent edits the same diagrams through its MCP server.

Where to use it

Install
Web apperd-editor.ioInstallable PWA that launches offline, real-time collaboration
Google DriveGoogle Workspace MarketplaceAdds ERD Editor to Drive's Open with and New menus, saving back to the same file
VS CodeMarketplaceOpens .erd.json files in a custom editor
IntelliJJetBrains MarketplaceSame, for IntelliJ-based IDEs
ObsidianCommunity pluginsOpens .erd and .erd.json files in a vault tab, desktop only
Your appnpm install @dineug/erd-editorThe framework-free <erd-editor> custom element
Coding agents@dineug/erd-editor-mcpAn MCP server for Claude Code, Codex or another client, live in VS Code, a JetBrains IDE or Obsidian, or on the file

To try it in an IDE, create an empty file with a .erd.json extension and open it. In Obsidian, run ERD Editor: Create new diagram from Obsidian's command palette. In Google Drive, choose New → More → ERD Editor.

Features

Design

  • Visual schema design — tables, columns, memos, and four relationship cardinalities (Zero One, Zero N, One Only, One N)
  • Quick edits — Alt+N adds a table and Alt+Enter a column, Alt+K toggles the primary key on the focused column, or on every selected column when it is one of them, and Delete or Backspace removes the selection, each in one undo step; the Shortcuts page of the editor's Settings tab lists every key
  • Link existing columns — while you draw a relationship with a mouse or a pen, the buttons beside the table it ends on either map the parent's key onto columns that table already has or add new ones, named after the parent table when the key is one word (user_id for user's id), and Map Columns in a relationship's right-click menu changes its columns later
  • Referential actions — set On Delete and On Update (NO ACTION, CASCADE, SET NULL, SET DEFAULT, RESTRICT) from a relationship's right-click menu, which marks one the current database leaves out; the line shows them at its child end as D:C U:R, and View Option's Referential Actions hides the labels. SQL, DBML and AML import read them, and the DDL export and the code generators that have a place for them write the ones the target supports
  • Alternate keys — View Option's Alternate Key marks the columns of each unique index over two or more columns as AK1.1, AK1.2, and SQL import reads a UNIQUE over several columns as one such index
  • Table groups — draw a box behind related tables, which you name and can color, with New Table Group in the canvas menu or the command palette, or group the selected tables from their right-click menu. A table joins a group when you drop it inside and leaves when you drop it outside, dragging a group by its title moves its tables with it, each member's header takes the group's color, View Option hides the groups, and DBML import and the Code Generator's DBML carry them as TableGroups
  • Auto Layout — place every table again by Force, Flow or a vertical or horizontal tree from the canvas menu or the command palette, table groups kept together, in one undo step; Force shows a preview you apply or cancel, and the others land at once
  • Copy, paste and colors — copy tables and memos and paste them as new ones, into another diagram too or into a spreadsheet as a grid, hold Alt while dragging to duplicate them, and color a table, memo or table group from its right-click menu
  • Clean diffs — the scroll position and zoom, the open tab, the code generator's language and name cases and the bracket type are locked by default, so the file keeps the values they had when locked and looking around never changes it; the file, written in a fixed order, also leaves out measured widths, connector anchors and removed items

Import

  • SQL DDL import — bring in a .sql dump from any of the eight vendors below. The parser reads CREATE TABLE, CREATE INDEX, ALTER TABLE constraints and table and column comments (COMMENT ON, SQL Server's sp_addextendedproperty), and skips what it does not recognize, so an awkward dump imports partially rather than failing outright
  • GraphQL SDL import — bring in a schema from any tool that emits SDL. Object types become tables, scalars map to the diagram's own dialect, and the fields that point at another type become the relationships; the root types and the wrapper types Relay, Federation and Hasura generate are left out rather than drawn as tables
  • DBML import — bring in a .dbml file written for dbdiagram.io or dbdocs.io, or emitted by sql2dbml or prisma-dbml-generator. Tables, columns, indexes, enums, header colors, every Ref spelling and each TableGroup arrive; a Project or a sticky Note is skipped rather than refused
  • AML import — bring in an .aml file written for Azimutt, in either the v2 or the legacy v1 spelling. Entities, attributes, indexes, enums, colors and every relation arrow arrive; a check and a struct type are skip
View source on GitHub