dineug139 downloadsEdit Entity-Relationship Diagrams in .erd files: design tables and relationships, import SQL and export DDL.
Entity-Relationship Diagram Editor for Obsidian

Design a database schema visually, right inside your vault. Diagrams are plain JSON files in your vault, next to your notes, so they sync, diff and back up like everything else in the vault.
The editor never connects to a database: it reads and writes your diagram files. You bring a schema
in from a .sql dump or a GraphQL SDL, DBML or AML file, and take one back out as DDL or generated
code.
Desktop only.
In Obsidian, open Settings → Community plugins, turn on community plugins if asked, choose Browse, search for ERD Editor (listing), then select Install and Enable.
To install by hand instead, download main.js, manifest.json and styles.css from the
latest release into a folder
named erd-editor under your vault's .obsidian/plugins, then turn on ERD Editor in
Settings → Community plugins.
Run ERD Editor: Create new diagram from Obsidian's command palette, or right-click a folder in
the file explorer and choose New ERD. Either one creates an empty .erd file and opens it in
the diagram view.
An empty diagram you can edit opens on the welcome screen, a menu of New Table, New Memo, Import,
Command Palette and Shortcuts, which stays until its first table, shown memo or shown table group.
Alt+N adds a table and Alt+Enter adds a column to it; Delete or Backspace removes the
selection, and Alt+K toggles the primary key on the focused column.
To start from a schema you already have, right-click the canvas and choose Import, then Schema
SQL for a .sql dump, GraphQL for a .graphql, .gql or .graphqls file, DBML for a
.dbml file or AML for an .aml file; json opens an .erd.json file as it was saved, and
takes no .erd file. Each one replaces the diagram in one undoable step, a schema's tables laid out
by their relationships. Import and Add beside it takes the same five and adds the file to the
diagram instead, its tables placed as new ones below everything already there, in one undoable step.
The diagrams Create new diagram and New ERD make are .erd files, so to import or compare
one, use a copy renamed to .erd.json.
Obsidian saves a diagram the way it saves a note: about two seconds after you stop editing, and when you close the tab or quit. Opening a file never rewrites it. Undo and redo are the diagram editor's own history.
.erd files show up in the file explorer and open in the diagram view..erd.json files open in the diagram view from links. Obsidian reads their extension as json,
so the file explorer and the quick switcher leave them out; turn on
Settings → Files and links → Detect all file extensions and both list them and open them in
the diagram view.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 keyuser_id for user's id), and
Map Columns in a relationship's right-click menu changes its columns laterD: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 supportsAK1.1, AK1.2, and SQL import reads a UNIQUE over several columns as one
such indexTableGroupsAlt while dragging to duplicate them, and
color a table, memo or table group from its right-click menu.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.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 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 skipped rather than refused, and a view arrives as a
table.sql, GraphQL, DBML, AML or .erd.json file to the diagram instead of replacing it: its
tables arrive below everything already there, laid out the same way (an .erd.json file keeps its
own placement), selected, and one undo takes them away. A table whose name is already taken
arrives as a second table rather than merging, and a foreign key to a table outside the file is
dropped.sql file or copies itUSE or CREATE + USE header, each where the
database has it, and the tables by table group, and keeps SQL of your own to write before and
after the tables. The statements, header and tables stay with this editor until you close it and
never reach the file; the scripts are saved in the document.erd.json, .sql, .png and .svg, written into the vault where your attachments
go (the file explorer lists an .erd.json file only with Detect all file extensions on, see
Files); the images from a dialog with a preview: transparent background, light or dark,
the PNG at 1x to 3x or copied to the clipboard insteadCtrl/Cmd+K opens the editor's command palette to run editor commands (new
table, import, export, Auto Layout, tabs, theme, language and more), or to jump to a table after
#, a column after @, and a comment or memo after :; Korean also matches by its initial
consonants (ㅅㅇㅈ finds 사용자)Ctrl/Cmd+F searches table and column names, comments and memos, with
match case, whole word and regular expressions, and one undo takes back a Replace AllAlt+F does for the
selection, and neither view writes its layout into the file.json file from the canvas menu; an .erd
diagram goes in as a copy renamed to .erd.jsonCtrl/Cmd+Z and Ctrl/Cmd+Shift+Z,
in the editor's own historyThe canvas scroll position and zoom level, the open tab (Canvas Type in the Lock list), the code generator's language and name cases, and the bracket type are locked in every diagram by default: the file keeps the values they had when locked, so panning around or switching tabs never changes it, and a git history of the vault stays limited to the schema. The editor's Settings tab lists each under Lock with the value the file keeps. Unlock the viewport for a diagram that should open where you left it, or unlock and lock it again to fix a new starting view. Files saved before the locks open with all of them on, their scroll, zoom and tab at the start.
The file holds only what the diagram is: its tables, columns, relationships, indexes, memos, table groups and settings, written in a fixed order, without the measured widths, connector anchors, stacking order or deleted items the editor keeps while it is open. Opening a diagram and closing it without an edit leaves the file as it was, and an edit made on any device, with any fonts, changes only the parts it touches. A file an earlier release of ERD Editor saved is rewritten in this form once, on its first edit.
The same diagram can be open in several panes at once, and they stay in sync as you edit in any of them. Keep it in the main window: popout windows are not supported.
A coding agent such as Claude Code or Codex can edit the diagrams in your vault through the
@dineug/erd-editor-mcp
MCP server. The agent joins the editor like a collaborator: each change shows up on the canvas as it
happens, and the agent's undo reverts only its own edits.
The server needs Node.js 22.12 or later. npx downloads it the first time the agent starts it, so
there is nothing else to install.
Claude Code — run in your vault folder:
claude mcp add --transport stdio erd-editor -- npx -y @dineug/erd-editor-mcp
Codex — add to ~/.codex/config.toml, or to .codex/config.toml in a trusted project:
[mcp_servers.erd-editor]
command = "npx"
args = ["-y", "@dineug/erd-editor-mcp"]
Any other MCP client — run npx -y @dineug/erd-editor-mcp as a stdio server. Start it in your
vault folder: it resolves relative document paths against its working directory.
Keep ERD Editor and the MCP server up to date together. When one speaks an older hub protocol than the other, the server refuses to connect and says which one to update.
.erd so the file explorer
lists them; the agent picks .erd.json when you give no extension.A diagram that is not open yet opens in a background tab as soon as the agent opens or edits it, without taking focus from what you are working on. With no VS Code window, Obsidian vault window or JetBrains IDE running ERD Editor that has the document open, or has open the folder, vault or project that holds it, the agent edits the file on disk instead. A vault window counts only while the plugin is enabled; with Coding agents turned off, the agent's writes are refused instead (see the next paragraph).
Settings → ERD Editor → Coding agents, on by default, turns the connection off for the vault. The agent can still read the diagrams from disk, but it never writes one behind the editor, where the next save would overwrite the change. The MCP server's README lists the tools.
Obsidian installed from Flathub runs in a Flatpak sandbox, which the MCP server cannot reach, so its windows never serve the agent, and the agent edits the files on disk unless an editor outside the sandbox, such as a VS Code window, has the document or a folder that holds it open. Obsidian picks the change up as it picks up any change made outside it, and an edit of yours it has not saved yet gives way to the agent's. The plugin says so each time the vault opens, until you turn off Coding agents.
The plugin makes no network requests and sends no telemetry. The one connection it accepts is local inter-process communication from an MCP server on this computer, through a socket file or named pipe, never a network port. With Coding agents on, which is the default, each vault window lets that server find it through two files in your home folder, outside the vault:
~/.erd-editor/ide/<pid>.json — a lock file, readable by your user account only, naming the vault
folder, the diagrams open in the window and a random token the MCP server must present. It is
rewritten as diagrams open and close.~/.erd-editor/ide/<pid>.sock — the local socket the MCP server connects to (a named pipe on
Windows; in the system temporary folder when the home folder path is too long for a socket).Both are removed when the window closes or Obsidian quits, and when the plugin is turned off; a reload of the window replaces them. A window that starts also removes the ones windows that have exited left behind, as the ERD Editor extension for VS Code and the ERD Editor plugin for JetBrains IDEs do in the same folder. With Coding agents off, the window keeps only the lock file, with no socket, so an agent still knows not to write the vault's diagrams behind the editor. A window in a Flatpak sandbox writes none of these files and removes none.
Settings → ERD Editor, kept per vault:
| Setting | Default | Values |
|---|---|---|
| Appearance | Auto | Auto, Light, Dark |
| Gray color | Slate | Gray, Mauve, Slate, Sage, Olive, Sand |
| Accent color | Indigo | 26 Radix accents — Gray, Gold, Bronze, Brown, Yellow, Amber, Orange, Tomato, Red, Ruby, Crimson, Pink, Plum, Purple, Violet, Iris, Indigo, Blue, Cyan, Teal, Jade, Green, Grass, Lime, Mint, Sky |
| Display language | Auto | Auto, then the 25 languages by their own names, in the editor's picker order: Bahasa Indonesia, Deutsch, English, Español, Euskara, Français, Italiano, Nederlands, Polski, Português, Português Brasileiro, Română, Slovenčina, Slovenščina, Svenska, Türkçe, Русский, Українська, עברית, العربية, فارسی, 日本語, 简体中文, 繁體中文, 한국어 |
| Coding agents | on | on, off — on, coding agents edit this vault's diagrams live through the MCP server; off, they can still read the files but write none (see Coding agents) |
Changing any of the three theme settings re-themes every open diagram immediately. Auto follows Obsidian's light or dark theme and switches with it.
The theme builder in the editor's toolbar changes these same three values and saves them here, so a
theme you pick in the editor persists. Its System is Auto: picking a color there keeps the
appearance as it is, and Light, Dark or System sets it. Theme in the editor's command palette
(Ctrl/Cmd+K) picks System, Light or Dark the same way.
Changing Display language changes every open diagram immediately. Auto follows the language
Obsidian shows, and English stands in for one the editor does not offer. The language button in
the editor's toolbar and Display Language in that palette (Ctrl/Cmd+K) change this same
setting and save it here; their System is Auto. The plugin's own settings and notices stay in
English.
@dineug/erd-editor — the editor as a custom
element for your own app@dineug/erd-editor-mcp — the MCP server
coding agents edit diagrams throughFound a bug or want a feature? Open an issue. The
plugin's source lives in the erd-editor monorepo, in
packages/obsidian-plugin.
MIT © SeungHwan-Lee