erd-editor
dineug · dineug/erd-editor
Trình thiết kế sơ đồ cơ sở dữ liệu trực quan với MCP server cho phép AI agent tạo và chỉnh sửa sơ đồ thực thể - liên kết trực tiếp.
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.
Xem trước
Bạn có thể làm gì với nó
- Yêu cầu Cursor thiết kế sơ đồ cơ sở dữ liệu trực quan dựa trên yêu cầu
- Cho phép agent cập nhật sơ đồ ERD hiện có khi mã nguồn thay đổi
- Tạo SQL DDL từ một sơ đồ được thiết kế tương tác bởi một agent
Đã chạy thử thật · 60 tool
Chúng tôi đã khởi động MCP server này trong máy ảo cách ly, và nó cung cấp các tool sau:
erd_list_documentsLists 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_documentOpens 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_saveSaves 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_undoReverts 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_redoApplies again the edit erd_undo last reverted.
erd_readReads 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_listLists 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_getGives 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_tableAdds an empty table at a free spot and returns its id in createdIds. Name it with erd_change_table_name.
erd_remove_tableRemoves a table with its columns, indexes and every relationship that touches it.
erd_change_table_nameRenames a table.
erd_change_table_commentSets the comment of a table.
erd_change_table_colorSets the color of a table.
erd_move_tableMoves a table to an absolute canvas position.
erd_move_tablesMoves 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
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
ERD Editor
Entity-Relationship Diagram Editor
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 app | erd-editor.io | Installable PWA that launches offline, real-time collaboration |
| Google Drive | Google Workspace Marketplace | Adds ERD Editor to Drive's Open with and New menus, saving back to the same file |
| VS Code | Marketplace | Opens .erd.json files in a custom editor |
| IntelliJ | JetBrains Marketplace | Same, for IntelliJ-based IDEs |
| Obsidian | Community plugins | Opens .erd and .erd.json files in a vault tab, desktop only |
| Your app | npm install @dineug/erd-editor | The framework-free <erd-editor> custom element |
| Coding agents | @dineug/erd-editor-mcp | An 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+Nadds a table andAlt+Entera column,Alt+Ktoggles the primary key on the focused column, or on every selected column when it is one of them, andDeleteorBackspaceremoves 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_idforuser'sid), 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
Altwhile 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
.sqldump from any of the eight vendors below. The parser readsCREATE TABLE,CREATE INDEX,ALTER TABLEconstraints and table and column comments (COMMENT ON, SQL Server'ssp_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
.dbmlfile written for dbdiagram.io or dbdocs.io, or emitted bysql2dbmlorprisma-dbml-generator. Tables, columns, indexes, enums, header colors, everyRefspelling and eachTableGrouparrive; aProjector a stickyNoteis skipped rather than refused - AML import — bring in an
.amlfile 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