erd-editor MCP server
Commit Nov 3, 2026Lets coding agents design and edit database schemas visually through ERD diagrams in your IDE or browser.
Also known as dineug/erd-editor, @dineug/erd-editor-mcp
- Stars
- 1,751
- Tools
- 77
- Downloads, 30 days
- 1,071
- Latest version
- —
- Last commit
- Nov 3, 2026
- License
- MIT
What is erd-editor MCP?
erd-editor lets coding agents design and edit database schemas visually through ERD diagrams in your IDE or browser. It exposes 77 tools, such as erd_list_documents, erd_open_document, erd_save.
Summary generated from the project's README
About erd-editor MCP server
erd-editor allows developers and coding agents to design and modify database schemas using visual ERD diagrams. It works across various environments including web browsers, VS Code, JetBrains IDEs, Obsidian, and Google Drive. Users manage their designs through a single .erd.json file, which can be edited locally or remotely. The tool supports complex schema design features like table groups, relationship cardinalities, and naming standards derived from custom dictionaries.
For those using AI-driven development, the @dineug/erd-editor-mcp server enables coding agents like Claude Code or Codex to act as collaborators. The agent can manipulate the canvas directly when the diagram is open in a supported IDE. The system requires Node.js 22.12 or later for the MCP server. It provides extensive import capabilities for SQL DDL, GraphQL SDL, DBML, and AML, while exporting to eight different database types including PostgreSQL, MySQL, and Snowflake, as well as various programming languages and ORMs.
What you can do with it
- 1Visual Schema DesignA developer can visually create tables, columns, and relationships within their IDE.
- 2AI-Driven Schema ModificationAn AI coding agent can automatically update a database diagram based on natural language instructions.
- 3Database Code GenerationUsers can transform their visual diagrams into executable DDL or application code.
- 4Schema Import and ConversionDevelopers can turn existing SQL or GraphQL definitions into visual diagrams.
Written from the project's README. Every use case is checked against a quote from it.
How to install erd-editor MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall erd-editor MCP in Claude Code
$ claude mcp add erd-editor -- npx -y @dineug/erd-editor-mcpInstall erd-editor MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"erd-editor": {
"command": "npx",
"args": [
"-y",
"@dineug/erd-editor-mcp"
]
}
}
}Install erd-editor MCP in VS Code
.vscode/mcp.json
{
"servers": {
"erd-editor": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@dineug/erd-editor-mcp"
]
}
}
}Install erd-editor MCP in VS Code CLI
$ code --add-mcp '{"name":"erd-editor","type":"stdio","command":"npx","args":["-y","@dineug/erd-editor-mcp"]}'Install erd-editor MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"erd-editor": {
"command": "npx",
"args": [
"-y",
"@dineug/erd-editor-mcp"
]
}
}
}Install erd-editor MCP in Codex
$ codex mcp add erd-editor -- npx -y @dineug/erd-editor-mcpInstall erd-editor MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.erd-editor] command = "npx" args = ["-y", "@dineug/erd-editor-mcp"]
Install erd-editor MCP in Gemini CLI
$ gemini mcp add -s user erd-editor npx -- -y @dineug/erd-editor-mcpInstall erd-editor MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"erd-editor": {
"command": "npx",
"args": [
"-y",
"@dineug/erd-editor-mcp"
]
}
}
}Started by HostedMCP on 16 Nov 2026
We ran this command for @dineug/erd-editor-mcp 1.2.0 in an isolated container with no network and no keys. It answered and listed 77 tools.
erd-editor MCP tools 77
Read from the server with tools/listerd_list_documentsRead-onlyLists 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 editor's, every open project's in a JetBrains IDE; otherwise the ERD files under the working directory.
erd_open_documentActionOpens 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 if missing; a name with no extension gets .erd.json.
erd_saveActionSaves 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, with no editor, edits are written at once and this does nothing.
erd_undoActionReverts 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_redoActionApplies again the edit erd_undo last reverted.
erd_readRead-onlyReads 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 scripts. The sql format with tableIds, tableNames or groupNames gives the DDL of just those tables, the way to read a large schema; a read too large for one answer is refused with how to narrow it. For ids and details prefer erd_list and erd_get. Change a document only through the erd_ tools, never by writing its file.
erd_listRead-onlyLists 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 (each relationship once, with one of its tables) and, for a table in a table group or with a logical name, its groupId or logicalName; after the tables come the table groups, the memos, then the rows of the domain, term and word dictionaries, each with its name and what it gives a physical name or column. A small schema fits in one page. On a larger one, nextOffset and note say how to go on: query finds tables by a word, namesOnly lists every table name in a call or a few. Columns, comments, memo text, the tables of a group and every field of a dictionary row come from erd_get; the foreign keys a table holds, from erd_read sql with tableNames.
erd_getRead-onlyGives 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, and words, terms and domains with every field. Ids and names that name nothing live are listed in missing; ids one answer has no room for are listed in notReturned, to ask for again.
erd_list_checksRead-onlyLists what the word, term and domain dictionaries find, as the Checks sheet of the editor's Dictionary tab does, and changes nothing. Errors: a name two rows of one dictionary share, a link to a domain the document does not list, a forbidden word in a logical name or a term's name. Warnings: a word no dictionary lists, a synonym used for a standard word, each in a logical name or a term's name, a physical name other than the one the term of its logical name gives, a column type other than its domain's. Each check names its target (a table, a column with its table, or a word, term or domain row) with its names, the field read, the text found and, where the dictionaries have them, the suggestions to use instead, and counts gives each code's total. The words, terms and domains come first in sheet order, then each table and its columns in document order. With no dictionary row nothing is checked. A long list comes a page at a time: pass nextOffset, or list again from offset 0 after fixing some, since a fixed check leaves the list.
erd_add_tableActionAdds an empty table at a free spot and returns its id in createdIds. Name it with erd_change_table_name.
erd_remove_tableActionRemoves a table with its columns, indexes and every relationship that touches it.
erd_change_table_nameActionRenames a table. The name is then its own: nameDerived goes off, so a later logical name leaves a name that is not empty as it is.
Show all 77 toolsShow fewer tools
erd_change_table_commentActionSets the comment of a table.
erd_set_table_logical_nameActionSets the logical name of a table. While its physical name is empty or derived, the dictionaries derive it as erd_set_column_logical_name does, a term giving no domain to a table. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_change_table_colorActionSets the color of a table.
erd_move_tableActionMoves a table to an absolute canvas position.
erd_move_tablesActionMoves 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.
erd_sort_tablesActionArranges every table on the canvas automatically, as the editor sort command does: the tables of a table group stay together and the group's rect is fitted round them, which tables it holds unchanged.
erd_add_columnActionAdds an empty column to a table and returns its id in createdIds. Set it with the erd_change_column_ and erd_set_column_ tools.
erd_remove_columnsActionRemoves columns from one table, with the relationships and index entries that use them.
erd_change_column_data_typeActionSets the data type of a column, such as INT or VARCHAR(255). With relationship data type sync on, the change spreads along relationships both ways: into the foreign keys that copy the column, a serial type as the integer it stores (as erd_add_relationship copies it), and from a foreign key back to the key it copies, except a serial key, which keeps its type and stops the change there. A column linked to a dictionary domain is unlinked from it when set to another type than the domain's, and so is any column the sync reaches, a foreign key or the key it copies, whose new type differs from its own domain's.
erd_change_column_nameActionRenames a column. The name is then its own: nameDerived goes off, so a later logical name leaves a name that is not empty as it is.
erd_change_column_defaultActionSets the default value of a column.
erd_change_column_commentActionSets the comment of a column.
erd_set_column_logical_nameActionSets the logical name of a column. While its physical name is empty or derived, the dictionaries derive it: a term of that name gives its physical name and links its domain, otherwise the words of the name compose one, their abbreviations joined with underscores. A physical name written by hand stays, and a name another column of the table holds is not given again. The domain a term links gives the column its data type, spread along relationships while relationship data type sync is on. A column the sync reaches whose new type differs from its own domain's is unlinked from that domain. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_set_column_domainActionLinks a column to a dictionary domain, which gives it the domain's data type, spread along relationships while relationship data type sync is on; null or an empty name unlinks it and keeps its type. A column the sync reaches whose new type differs from its own domain's is unlinked from that domain. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_set_column_primary_keyActionSets whether the column is part of the primary key. Setting the value it already has changes nothing.
erd_set_column_uniqueActionSets whether the column is unique. Setting the value it already has changes nothing.
erd_set_column_not_nullActionSets whether the column is NOT NULL. Setting the value it already has changes nothing.
erd_set_column_auto_incrementActionSets whether the column is auto increment. Setting the value it already has changes nothing.
erd_move_columnActionMoves a column within its table to the position of another column.
erd_add_relationshipActionRelates two tables: copies the parent primary key into the child as foreign key columns, creating an unnamed primary key column first if the parent has none (its foreign key column is unnamed too). Each foreign key column is named from its key: a key of one word, only letters and digits with no camelCase break and no switch between cased letters and caseless ones such as Hangul or kana (id, ID, uuid, id2), gets the parent table and an underscore in front (users_id for the key id of users), any other key (member_id, userId, UserID, 회원ID, _id, order-no) or one equal to the table name stays as it is, and a name the child already has is numbered (users_id_2). Each foreign key column copies the data type of its key, but a serial key gives the integer it stores: serial4 integer, smallserial and serial2 smallint, bigserial and serial8 bigint, and a bare serial integer under PostgreSQL, bigint unsigned under MySQL and MariaDB and serial elsewhere, written in capitals when the type of the key is. Each foreign key column also takes the logical name of its key, whatever name it gets, and links the dictionary domain its key links, unless a serial key gives it another type than the domain's. Name the parent table first: an unnamed parent gives the key name alone (id), and a later rename leaves these names as they are. createdIds holds, in order, that new parent key column if one was made, the foreign key columns, then the relationship id last.
erd_link_columnsActionDraws a relationship between columns that already exist, such as a foreign key imported from code. Pairs start and end columns by position.
erd_remove_relationshipActionRemoves a relationship line; its foreign key columns stay in the table.
erd_change_relationship_typeActionChanges the cardinality of a relationship.
erd_change_relationship_on_deleteActionSets the ON DELETE action of a relationship: what deleting a parent row does to its child rows. An ERD Editor extension or plugin released before referential actions ignores this setting, so the user should update it.
erd_change_relationship_on_updateActionSets the ON UPDATE action of a relationship: what changing a parent key does to its child rows. An ERD Editor extension or plugin released before referential actions ignores this setting, so the user should update it.
erd_add_indexActionAdds an empty index to a table and returns its id in createdIds; add columns with erd_add_index_column.
erd_remove_indexActionRemoves an index.
erd_change_index_nameActionRenames an index.
erd_set_index_uniqueActionSets whether an index is unique. Setting the value it already has changes nothing.
erd_add_index_columnActionAdds a column of the index table to the index, returning the new index column id; a column already in the index is left alone.
erd_remove_index_columnActionRemoves one column from an index.
erd_move_index_columnActionMoves a column within an index to the position of another of its columns.
erd_set_index_column_orderActionSets the sort order of one column in an index. Setting the order it already has changes nothing.
erd_add_memoActionAdds an empty memo note at a free spot and returns its id in createdIds.
erd_remove_memoActionRemoves a memo.
erd_change_memo_valueActionReplaces the text of a memo.
erd_change_memo_colorActionSets the color of a memo.
erd_move_memoActionMoves a memo to an absolute canvas position.
erd_resize_memoActionResizes a memo. erd_undo cannot revert it: the editor keeps no undo entry for a single resize.
erd_add_table_groupActionAdds a table group, a named box drawn behind its tables, and returns its id in createdIds. Pass tableIds to wrap those tables, each leaving any group it was in, or a rect (x, y, width and height), which takes in every table in no group whose centre lies inside it, as drawing a group in the editor does. A table is in one group at most. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_remove_table_groupActionRemoves a table group; its tables stay where they are, in no group. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_change_table_group_nameActionRenames a table group. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_change_table_group_colorActionSets the color of a table group, which its box and the headers of its tables take. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_move_table_groupActionMoves a table group so its rect starts at an absolute canvas position, its tables by the same step. Moving a table or a group never changes which tables a group holds. A move under 20 pixels in all makes no undo entry. An ERD Editor extension or plugin released before table groups moves only the tables of the group and drops every group when it saves, so the user should update it.
erd_resize_table_groupActionSets the rect of a table group, its tables staying where they are; the editor draws the box grown to hold each of them. It is refused smaller than 160 by 100 or than the tables with their padding, naming the box the rect must hold. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_set_table_groupActionPuts tables in a table group, each leaving any group it was in, or with groupId null takes them out of their groups. Tables already where they go are left alone. An ERD Editor extension or plugin released before table groups ignores this edit and drops every group when it saves, so the user should update it.
erd_add_wordActionAdds a word to the word dictionary, the standard words a logical name is composed of, and returns its id in createdIds. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_update_wordActionChanges the fields of a word that the call passes and leaves the rest; values it already holds change nothing. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_remove_wordActionRemoves a word from the word dictionary; the names it composed stay as they are. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_add_termActionAdds a term, a logical name with the physical name and the domain it gives, and returns its id in createdIds. Without a physical name the words compose one. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_update_termActionChanges the fields of a term that the call passes and leaves the rest; values it already holds change nothing. The tables and columns named from it keep their names and domains. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_remove_termActionRemoves a term; the tables and columns named from it keep their names and domains. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_add_domainActionAdds a domain, a named data type columns link to, and returns its id in createdIds. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_update_domainActionChanges the fields of a domain that the call passes and leaves the rest; values it already holds change nothing. A new data type reaches every column linking the domain, and along relationships while relationship data type sync is on. A column the sync reaches whose new type differs from its own domain's is unlinked from that domain. A name another row of the same dictionary holds is refused. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_remove_domainActionRemoves a domain; the columns linking it keep their data type and show no domain. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_derive_physical_namesActionDerives physical names again from the logical names, as the editor's Derive Physical Names Again does. Each covered table or column with a logical name goes back under the dictionaries, its nameDerived on, and takes the name they give now, a physical name written by hand included: a term's physical name and, for a column, its domain, else the words' composition. A name with no logical name stays as it is, and so does a column whose new name another column of its table holds or took first, such as a second foreign key to one table or a role name. Changing a word's abbreviation or a term's physical name leaves the names given before as they are, so call this after one; a term's own physical name is never composed again, so update the term first. One erd_undo reverts the call. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_set_database_nameActionSets the database name of the document. erd_undo cannot revert it: the editor keeps no undo entry for this setting.
erd_set_databaseActionSets the database vendor, which picks the data types and the default DDL of erd_read sql. erd_undo cannot revert it: the editor keeps no undo entry for this setting.
erd_set_ddl_scriptActionSets one of the two SQL scripts the document keeps for its Schema SQL: before, written ahead of the tables, such as CREATE EXTENSION or CREATE SCHEMA, or after, written past the generated DDL, such as GRANT or CREATE VIEW. It replaces the whole script, so read the current one first with erd_read format scripts. The text goes as is into the DDL of every database, so write it for the document's database; SQL Server output gets GO after a script that does not end with GO. An empty string removes it. erd_read sql shows it in place. An ERD Editor extension or plugin released before scripts neither shows nor keeps them, so the user should update it.
erd_import_sqlActionReplaces every table, relationship, index, memo and table group of the document with the schema parsed from SQL DDL (CREATE TABLE statements), keeping its settings but the view, which goes to the start of the canvas, and keeping its word, term and domain dictionaries; erd_undo restores what it replaced. With mode append it instead adds the schema's tables, relationships and indexes as new ones in a grid below the diagram, leaving every table and setting already there as it is; a foreign key to a table the text does not declare is dropped.
erd_import_graphqlActionReplaces every table, relationship, index, memo and table group of the document with the schema parsed from a GraphQL SDL, keeping its settings but the view, which goes to the start of the canvas, and keeping its word, term and domain dictionaries; erd_undo restores what it replaced. With mode append it instead adds the schema's tables, relationships and indexes as new ones in a grid below the diagram, leaving every table and setting already there as it is; a foreign key to a table the text does not declare is dropped.
erd_import_dbmlActionReplaces every table, relationship, index, memo and table group of the document with the schema parsed from DBML, keeping its settings but the view, which goes to the start of the canvas, and keeping its word, term and domain dictionaries; erd_undo restores what it replaced. With mode append it instead adds the schema's tables, relationships and indexes as new ones in a grid below the diagram, leaving every table and setting already there as it is; a foreign key to a table the text does not declare is dropped. Either way a TableGroup becomes a table group of the tables it names, with its name and color, its box round them; a table named by two groups stays in the first, and a group naming no declared table is left out. An ERD Editor extension or plugin released before table groups drops every group when it saves, so the user should update it.
erd_import_amlActionReplaces every table, relationship, index, memo and table group of the document with the schema parsed from AML, keeping its settings but the view, which goes to the start of the canvas, and keeping its word, term and domain dictionaries; erd_undo restores what it replaced. With mode append it instead adds the schema's tables, relationships and indexes as new ones in a grid below the diagram, leaving every table and setting already there as it is; a foreign key to a table the text does not declare is dropped.
erd_import_jsonActionReplaces the whole document, its settings included, with an erd-editor JSON document such as another .erd.json file: the settings and locks it holds take the place of this document's, and one without lockSettings turns every lock on and puts the view at the start of the canvas. To keep this document's settings, start from the text erd_read json gives. erd_undo restores the previous document. With mode append it instead adds that document's tables, relationships, indexes, memos and table groups as new ones below the diagram, apart as the file places them, and keeps this document's settings; the tables bring their logical names and derived flags, but no column links a domain and none of the document's words, terms and domains is added. An ERD Editor extension or plugin released before table groups drops every group when it saves, so the user should update it. An ERD Editor extension or plugin released before dictionaries, logical names and domains ignores what this edit writes of them and leaves them out when it saves, so the user should update it.
erd_batchActionRuns several edit tools in order as one edit, all or none: they are tried on a copy first, so a refusal names the operation and leaves the document as it was. One erd_undo reverts the whole batch. Name an operation with as, then pass $name for its first created id, $name.1 for its second or $name.last for its last, where a later operation takes an entity id.
Automated checks
Ran Nov 16, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachabledineug/erd-editor is public and reachablegithub.com/dineug/erd-editor ↗Pass
- Package names this repository as its source@dineug/erd-editor-mcp names dineug/erd-editor as sourcenpmjs.com/package/@dineug/erd-editor-mcp ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-03github.com/dineug/erd-editor ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @dineug/erd-editor-mcpPass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model77 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubERD Editor
Design database schemas visually: in your browser, in your IDE, or by asking your coding agent
Open erd-editor.io in your browser, nothing to install, or get it for VS Code, JetBrains IDEs, Obsidian and Google Drive.
One editor and one .erd.json file wherever you work: on the web, in Google Drive, VS Code,
JetBrains IDEs and Obsidian, inside your own app, and in your coding agent's hands.
Features
- Design — tables, columns, memos and table groups, four relationship cardinalities, ON DELETE and ON UPDATE, alternate keys, Auto Layout
- Naming standards — logical and physical names, physical names and data types derived from word, term and domain dictionaries, which have their own tab with CSV import and export and checks
- Import — SQL DDL, GraphQL SDL, DBML and AML, replacing the diagram or adding to it
- Export — DDL for eight databases, code in 22 languages and ORMs, PNG and SVG
- Navigate — command palette (
Ctrl/Cmd+K), an Explorer tree with find and replace, Graph and Flow views - History — undo and redo, time travel through the session, a diff viewer against another file
- 25 languages and a System, Light or Dark theme with your own gray and accent colors
- Collaboration — live sessions on erd-editor.io, and coding agents that edit beside you
Databases: Databricks, MariaDB, MSSQL, MySQL, Oracle, PostgreSQL, Snowflake, SQLite
Code: TypeScript, GraphQL, C#, Java, JPA, Kotlin, Scala, Go, SQLAlchemy, TypeORM, Sequelize, Drizzle, DBML, AML, Mermaid, PHP, Doctrine, Rust, SeaORM, Swift, Zod, JSON Schema
Every feature step by step: the Editing Guide.
Coding agents
Ask Claude Code, Codex or any MCP client to change the schema, and watch it happen on the canvas.

@dineug/erd-editor-mcp gives the agent one tool per editing operation.
When VS Code, Obsidian or a JetBrains IDE holds the diagram, the agent joins it as one more
collaborator, and its undo reverts only its own edits; with no editor, it edits the file on disk.
An editor with its connection off, or an untrusted workspace or project, lets the agent read but
refuses its edits. It needs Node.js 22.12 or later. Add it with one command, in your project folder:
# Claude Code
claude mcp add --transport stdio erd-editor -- npx -y @dineug/erd-editor-mcp
# Codex
codex mcp add erd-editor -- npx -y @dineug/erd-editor-mcp
Other clients and the tool list: its README.
Where to use it
| Install | ||
|---|---|---|
| Web app | erd-editor.io | Installable PWA that works offline, with real-time collaboration |
| Google Drive | Google Workspace Marketplace | Drive's Open with and New menus, saving back to the same file |
| VS Code | Marketplace | Opens .erd.json files |
| IntelliJ | JetBrains Marketplace | Opens .erd.json files in IntelliJ-based IDEs |
| Obsidian | Community plugins | Opens .erd and .erd.json files in a vault, desktop only |
| Your app | npm install @dineug/erd-editor |
The <erd-editor> custom element and the read-only <erd-viewer>, no framework needed |
| Coding agents | @dineug/erd-editor-mcp |
MCP server for Claude Code, Codex and other clients |
In an IDE, create an empty .erd.json file and open it. In Obsidian, run
ERD Editor: Create new diagram; in Google Drive, choose New → More → ERD Editor.
Real-time collaboration
Every ERD Editor shares its edits as a stream of actions, which keeps several views of one diagram in sync, such as browser tabs or split editors, and lets a coding agent join as one more collaborator.
On erd-editor.io, choose Start session from the collaboration button in the sidebar and share the link: everyone who opens it edits with you. The link is the only key, so share it only with people you would let edit. The session lives in the host's browser and ends when the host closes their last tab, so a guest who wants the diagram exports it first.
Peers connect over WebRTC, with the diagram and every edit encrypted by AES-GCM. The signaling relay never sees plaintext, and the room key lives in the URL fragment, which browsers leave out of every request.
flowchart TB
subgraph clientA["Client A"]
bcA["Broadcast Channel"]
tabA1["Tab (leader)"]
tabA2["Tab"]
swA["Shared Worker"]
idbA[("IndexedDB")]
bcA <--> tabA1
bcA <--> tabA2
tabA1 <--> swA
tabA2 <--> swA
swA <--> idbA
end
subgraph clientB["Client B (guest)"]
tabB1["Tab"]
end
relay["Signaling Relay (nostr / mqtt)"]
tabA1 <-->|"WebRTC (AES-GCM)"| tabB1
tabA1 -. "signaling" .-> relay
tabB1 -. "signaling" .-> relay
Embedding
npm install @dineug/erd-editor
import '@dineug/erd-editor/erd-editor.js';
const editor = document.createElement('erd-editor');
// the editor fills its container, and a custom element is inline by default
Object.assign(editor.style, { display: 'block', width: '100%', height: '100vh' });
document.body.appendChild(editor);
To show a diagram without editing it, import @dineug/erd-editor/erd-viewer.js and place
<erd-viewer src="diagram.erd.json" style="display: block; height: 480px"></erd-viewer>, which
pans, zooms and searches it within the box its style gives it. Importing the package root defines
neither element.
A page that cannot load scripts, such as a wiki or a site builder, can frame the hosted viewer instead:
<iframe src="https://erd-editor.io/embed?src=https%3A%2F%2Fgithub.com%2Fdineug%2Ferd-editor%2Fblob%2Fmain%2Fdata%2Fembed-small.erd.json" width="100%" height="480" style="border: 0" loading="lazy" title="ERD Editor"></iframe>
That line shows this repository's data/embed-small.erd.json. The
builder at erd-editor.io/embed writes it from a file's URL and the
viewer's options. A file or gist on GitHub can be given by the address its page shows, as here; the
hosted viewer fetches it from GitHub's raw host, which caches each file for five minutes and works
for public repositories and public gists only, and of a gist it shows the first file. Any other
server holding the file has to allow erd-editor.io's cross-origin requests (CORS).
Both elements work from any framework or from none. Attributes and the element API:
packages/erd-editor.
Documentation
- Editing Guide — every editor feature
- Element API —
<erd-editor>for your own app;<erd-viewer>is inpackages/erd-editor - MCP — the MCP server and its tools
- Documentation
Packages
A pnpm workspace. @dineug/erd-editor,
@dineug/erd-editor-mcp and
@dineug/erd-editor-yjs are published to npm, the three plugins ship
through their stores, app is erd-editor.io, and the rest are private libraries those builds take
in.
| Folder | npm name | Description |
|---|---|---|
erd-editor |
@dineug/erd-editor |
The editor core: the <erd-editor> custom element, the read-only <erd-viewer> and the headless engine.js and peer.js entries |
erd-editor-yjs |
@dineug/erd-editor-yjs |
The published Yjs binding, which keeps an <erd-editor> or a headless peer store in step through a Y.Doc |
erd-editor-schema |
@dineug/erd-editor-schema |
The v2/v3 document schema, parsing, serializers, queries and LWW operators |
schema-sql-parser |
@dineug/schema-sql-parser |
Permissive DDL parser used for SQL import |
uuid |
@dineug/uuid |
UUIDv7 and the Uuid25 encoding, the ids the editor mints |
r-html |
@dineug/r-html |
The tagged-template rendering framework and store the editor is built on |
vite-plugin-r-html |
@dineug/vite-plugin-r-html |
JSX → tagged templates, plus HMR boundaries |
r-html-konva |
@dineug/r-html-konva |
The Konva host for r-html templates, which the editor's canvas renders through |
grid |
@dineug/grid |
A spreadsheet grid on a Konva canvas, built on r-html-konva, that draws only the cells in view |
app |
@dineug/erd-editor-app |
The React PWA at erd-editor.io, with the Google Drive editor at /gdrive, whose OAuth relay is the Pages Function in functions/ |
vscode-extension |
vuerd-vscode |
The published VS Code extension, with its side of the coding-agent hub |
vscode-webview |
@dineug/erd-editor-vscode-webview |
The bundle inside the VS Code webview |
webview-client |
@dineug/erd-editor-webview-client |
The editor mounted into an IDE webview, host protocol wired, shared by both IDE bundles |
webview-bridge |
@dineug/erd-editor-webview-bridge |
Typed host ↔ webview command protocol |
replication-store-worker |
@dineug/erd-editor-replication-store-worker |
Headless document replica in a Worker, serializing what the IDE webviews and the Obsidian plugin save |
intellij-webview |
@dineug/erd-editor-intellij-webview |
The bundle inside the IntelliJ plugin's editor panel |
intellij-plugin |
@dineug/erd-editor-intellij-plugin |
The published IntelliJ plugin, in Kotlin and Gradle, with its own Kotlin hub for coding agents |
obsidian-plugin |
@dineug/erd-editor-obsidian-plugin |
The Obsidian plugin, released from erd-editor-obsidian-plugin |
agent-hub |
@dineug/erd-editor-agent-hub |
The protocol between an editor window and a coding agent's MCP server: messages, lock files, framing |
agent-hub-host |
@dineug/erd-editor-agent-hub-host |
The editor window's side of that protocol, shared by the VS Code extension and the Obsidian plugin; the IntelliJ plugin ports it to Kotlin |
mcp-server |
@dineug/erd-editor-mcp |
The published MCP server, live in VS Code, Obsidian or a JetBrains IDE, or headless on the file |
Development
You need Node 22.22.1+, 24.11+ or 26+ (.nvmrc pins 22.23.2), pnpm 10.34.3 and Git 2.32+; the
IntelliJ plugin also needs JDK 17+.
pnpm install
pnpm --filter @dineug/erd-editor exec playwright install --with-deps chromium # for pnpm test
pnpm --filter @dineug/erd-editor-app dev # the web app
pnpm check # format and lint
pnpm test # every package's type check and specs
pnpm build
The IntelliJ plugin builds with Gradle from packages/intellij-plugin,
and the e2e suites run apart from pnpm test. AGENTS.md has the rest: which checks a
change runs, coverage, the e2e suites and the commit rules.
Contributing
Issues and pull requests are welcome. Commit messages follow Conventional Commits.
License
MIT © SeungHwan-Lee
erd-editor MCP questions
How do I add erd-editor MCP to Claude Code?
Run claude mcp add erd-editor -- npx -y @dineug/erd-editor-mcp in your terminal. Add --scope user to make it available in every project.
How do I add erd-editor MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does erd-editor MCP provide?
It exposes 77 tools, including erd_list_documents, erd_open_document, erd_save, erd_undo, erd_redo.
How can I use erd-editor with coding agents?
You can ask Claude Code, Codex, or any MCP client to change the schema, and the agent will edit the diagram on the canvas.
What databases can I export DDL for?
The editor supports exporting DDL for Databricks, MariaDB, MSSQL, MySQL, Oracle, PostgreSQL, Snowflake, and SQLite.
Can I import existing schemas?
Yes, you can import SQL DDL, GraphQL SDL, DBML, and AML to replace or add to your existing diagram.
What are the system requirements for the MCP server?
The MCP server requires Node.js version 22.12 or later.