ERD Editor MCP
MCP server for the ERD Editor: an agent adds tables, relations and indexes and the edits show up live on the canvas in VS Code, Obsidian and JetBrains
- 1,736 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- Starts a local process through npx and reads and writes `.erd.json` diagram files in the working folder
- Connects to running editors through the `~/.erd-editor/ide/` directory and changes open documents
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/erd-editorDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Starts a local process through npx and reads and writes `.erd.json` diagram files in the working folder
- Connects to running editors through the `~/.erd-editor/ide/` directory and changes open documents
This is third-party code. Review the repository files before installing.
What it does
ERD Editor draws a database schema as an ER diagram in the browser, VS Code, JetBrains IDEs or Obsidian. The repository also holds the package `@dineug/erd-editor-mcp`, which gives Claude Code, Codex and other MCP clients a set of `erd_*` tools for editing such a diagram. The agent adds a table, renames a column, relates two tables, defines an index, sets a primary key or drops a memo on the canvas. When the document is already open in an editor, the agent joins it as one more collaborator and the change appears on the canvas at once. Its undo reverts only its own edits. With no editor around, the same tools write straight to the `.erd.json` file. A schema can be loaded from SQL, DBML, GraphQL, AML or JSON with the `erd_import_*` tools and read back as a snapshot, JSON or SQL for any of eight databases. Large schemas get a paged `erd_list` with a hundred tables per page and DDL for only the tables you name. `erd_batch` runs up to a hundred edits in order as a single one: all or none.
Who it is for. For developers and analysts who design a database schema together with an AI agent and want to see an ER diagram, not only SQL files.
Good fit when
- You need to sketch a database schema from a task description and see it as a diagram in VS Code right away
- You have an SQL dump and want it turned into an ER diagram with `erd_import_sql`
- A schema in DBML or GraphQL has to be imported and printed as DDL for PostgreSQL, MySQL or another of the eight databases
- The agent has to change a schema in bulk: rename columns, add indexes and relations in one `erd_batch` call
- The diagram lives in the repository as an `.erd.json` file and the agent edits it with no editor running
Not a fit when
- You need access to a live database, queries and migrations: the server edits only the diagram file
- You need free-form flowcharts and architecture sketches: Mermaid and draw.io fit that better
- The machine has no Node.js 22.12 or newer
- The diagram is open in a JetBrains IDE installed as a Flatpak: the agent edits the file on disk there and your next edit overwrites it
Example request
Create a web shop schema in docs/shop.erd.json: customers, orders, products and order items with relations, then show the DDL for PostgreSQLMCP
- Transport
- stdio
- Authentication
- not required
Limitations
- Node.js 22.12 or newer is required; `npx` downloads the server on first start.
- Keep the editor and the server updated together: when they speak different hub protocol versions the server refuses to connect and names the side to update.
- If an editor holds the document but its agent connection is off, or the workspace is untrusted, the edit is refused so that the editor's next save does not overwrite it. Reads still come from disk.
- In VS Code a live edit stays unsaved until you, Auto Save or `erd_save` save the file.
- A single read returns at most 40,000 characters; read a large schema by tables.
- Obsidian from Flathub and a JetBrains IDE in a Flatpak run no hub, so the agent edits the file on disk.
How to disable. Remove the server from the client configuration: run `claude mcp remove erd-editor` for Claude Code, or delete the `[mcp_servers.erd-editor]` block from Codex's `config.toml`. The editor side is turned off with the Coding agents setting in Obsidian and JetBrains or `dineug.erd-editor.agentHub.enabled` in VS Code.
FAQ
How do I install ERD Editor in Claude Code?
Run `claude mcp add --transport stdio erd-editor -- npx -y @dineug/erd-editor-mcp` in the project folder. The server starts through `npx` on first use and needs Node.js 22.12 or newer.
How do I connect ERD Editor to Codex?
Run `codex mcp add erd-editor -- npx -y @dineug/erd-editor-mcp`. The setting is shared by the CLI, the app and the IDE extension. You can instead add an `[mcp_servers.erd-editor]` block with `command = "npx"` to `~/.codex/config.toml`.
Does an editor have to be open for the agent to change the schema?
No. If the document is open in VS Code, Obsidian or a JetBrains IDE, the edit appears on the canvas at once. With no editor the server writes to the diagram file. If an editor holds the document but its agent connection is off, the server refuses.
Which formats can a schema be imported from?
The tools `erd_import_sql`, `erd_import_graphql`, `erd_import_dbml`, `erd_import_aml` and `erd_import_json` load a schema. By default an import replaces the diagram, and with `mode: "append"` it adds tables to it.
How do I print the schema as SQL for a given database?
`erd_read` returns the document as `sql` for any of eight databases. For a large schema you can ask for the DDL of just the tables or table groups you need; an answer is capped at 40,000 characters.
Discussion
No questions or reviews yet.
Related
MCP serversA desktop SQL workspace with a built-in MCP server: the agent reads the schema and runs queries in the same client you already use
A lightweight database workspace with an MCP server: the agent reads the schema, runs queries and explores data in PostgreSQL, MySQL and more
MCP server and CLI to drive real Microsoft Excel: Power Query, DAX, VBA, PivotTables and charts
A CLI and MCP server that extracts structured knowledge from documents: graphs, hypergraphs, and fact search with sources
MCP server and CLI that turns paper text or data into academic figures, diagrams and plots
MCP server that connects Claude Code and Codex to an open R or Python session in RStudio and Positron, where your data lives
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| ERD Editor (this entry) | yes | not required | 1,736 | |
| MCP Mermaid | no | not required | 646 | renders Mermaid diagrams from text and does not keep a database schema as an editable ER model |
| drawio-skill | no | 10,419 | draws free-form diagrams in draw.io, with no DDL import or typed table columns | |
| MCP Toolbox for Databases | yes | not required | 16,749 | connects an agent to live databases and queries, while ERD Editor edits only the diagram file |
README in short
The repository's main README describes the ERD Editor itself and its VS Code, JetBrains and Obsidian extensions. The separate README of the `@dineug/erd-editor-mcp` package covers connecting to Claude Code and Codex, the live and headless modes, how documents are read, and a table of tools by group: session, tables, columns, relationships, indexes, memos, table groups, settings, import and batch edits.