
ERD Editor MCP Server: Setup for Claude Code, Codex and Other Apps
Lets Claude Code, Codex and other assistants design your database schema in ERD Editor, live in your editor or straight on disk.
ERD Editor is a diagram tool for VS Code, JetBrains IDEs, Obsidian and the browser. This is its own server, so your assistant can add tables and columns, link them, import SQL and read the schema back as SQL. If an editor has the diagram open, changes appear on the canvas. If not, they are written to the file.
It runs on your computer with no account. Ask the assistant to edit through the tools and not to rewrite the file itself.
Good for
- Developers who design schemas and want an assistant to draw them
- Teams who keep ERD files in their repo and want them updated with code
- VS Code, JetBrains or Obsidian users who already use ERD Editor
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install erd-editor MCP
Claude Code
- 1
Copy this prompt.
Add the erd-editor MCP server to Claude Code. Run this command: claude mcp add --transport stdio erd-editor -- npx -y @dineug/erd-editor-mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js 22.12+, Node.js.
Read-only mode: There is no read-only mode. Keep the diagram file in version control.
Start the server in your project folder, because it resolves relative diagram paths against its working directory. Keep ERD Editor and the server updated together: if their protocols differ, the server refuses to connect and says which to update. The README shows commands for Claude Code and Codex; other client configs here are adapted from the package name and are generated. The claude mcp add command is copied from the package README; the .mcp.json block is adapted from it and generated.
From the project README. Source.
Tools
Lists the diagrams the agent can reach
Shows which ERD documents are open in a connected editor or found on disk.
Try: “Which ERD diagrams are open?”
Files ·
erd_list_documentsOpens a diagram, or creates a new one
Opens a document by path. With create set, it makes a missing file and adds .erd.json to a name with no extension.
Try: “Create a new diagram called shop.”
Write ·
erd_open_documentLists tables, groups, memos and dictionary rows
Pages through the diagram's tables by ID, 100 at a time, then groups, memos and dictionary rows, and can find tables by name or comment.
Try: “Find tables with 'order' in the name.”
Read ·
erd_listReads tables or other items by ID or name
Returns the full details of the tables or entities you name, and lists any it had no room for.
Try: “Show the users table.”
Read ·
erd_getReads the whole diagram as SQL, JSON or a snapshot
Returns the document as a snapshot, SQL for one of eight databases, JSON or its scripts, or the DDL of just the tables you name. Reads stop at 40,000 characters.
Try: “Show the PostgreSQL DDL for the orders table.”
Read ·
erd_readLists naming problems the dictionaries find
Reports forbidden words, unknown words, synonyms, duplicate names and type mismatches, with what to use instead.
Try: “Check my column names against the dictionary.”
Read ·
erd_list_checksSaves the open diagram
Saves the diagram when the connected editor, such as VS Code, keeps edits unsaved until saved.
Try: “Save the diagram.”
Write ·
erd_saveUndoes the agent's last edit
Reverts the agent's most recent edit, or a whole batch at once, and leaves your own edits alone.
Try: “Undo that last change.”
Write ·
erd_undoRedoes an undone edit
Re-applies an edit that was just undone.
Try: “Redo it.”
Write ·
erd_redoAdds a table
Adds a new table to the diagram.
Try: “Add a table named customers.”
Write ·
erd_add_tableRemoves a table
Removes a table together with its relationships and indexes.
Try: “Remove the old_logs table.”
Delete ·
erd_remove_tableRenames a table
Changes a table's physical name.
Try: “Rename users to accounts.”
Write ·
erd_change_table_nameEdits a table's comment
Sets the comment text on a table.
Try: “Add a comment to orders saying it holds paid orders.”
Write ·
erd_change_table_commentSets a table's logical name
Sets the descriptive name, and derives the physical name from the word dictionary unless you set one by hand.
Try: “Give the orders table the logical name 'Customer order'.”
Write ·
erd_set_table_logical_nameChanges a table's color
Sets the color of a table on the canvas.
Try: “Make the payments table red.”
Write ·
erd_change_table_colorMoves one table on the canvas
Places a table at new coordinates.
Try: “Move customers next to orders.”
Write ·
erd_move_tableMoves several tables at once
Moves a group of tables in one step.
Try: “Shift the billing tables to the right.”
Write ·
erd_move_tablesSorts the tables
Arranges the tables on the canvas automatically.
Try: “Tidy up the layout.”
Write ·
erd_sort_tablesAdds a column to a table
Adds a new column to a table with the settings you give.
Try: “Add an email column to users.”
Write ·
erd_add_columnRemoves columns
Removes one or more columns from a table.
Try: “Drop the legacy_id column from users.”
Delete ·
erd_remove_columnsRenames a column
Changes a column's physical name.
Try: “Rename usr_nm to username.”
Write ·
erd_change_column_nameChanges a column's data type
Sets the data type of a column, such as varchar(255) or bigint.
Try: “Make price a decimal(10,2).”
Write ·
erd_change_column_data_typeSets a column's default value
Sets the default value of a column.
Try: “Default status to 'new'.”
Write ·
erd_change_column_defaultEdits a column's comment
Sets the comment on a column.
Try: “Comment that total is in cents.”
Write ·
erd_change_column_commentSets a column's logical name
Sets the descriptive name and derives the physical name and domain from the dictionaries, unless you set one by hand.
Try: “Give email the logical name 'Email address'.”
Write ·
erd_set_column_logical_nameLinks a column to a domain
Applies a dictionary domain to a column.
Try: “Use the Email domain for the email column.”
Write ·
erd_set_column_domainMarks a column as primary key
Turns the primary key flag on or off for a column.
Try: “Make id the primary key.”
Write ·
erd_set_column_primary_keyMarks a column as unique
Turns the unique flag on or off for a column.
Try: “Make email unique.”
Write ·
erd_set_column_uniqueMarks a column as not null
Turns the not null flag on or off for a column.
Try: “Make name required.”
Write ·
erd_set_column_not_nullMarks a column as auto increment
Turns auto increment on or off for a column.
Try: “Auto-increment the id column.”
Write ·
erd_set_column_auto_incrementMoves a column within a table
Changes the order of a column in its table.
Try: “Put created_at last.”
Write ·
erd_move_columnAdds a relationship between tables
Creates a foreign-key style link from one table to another.
Try: “Link orders to customers.”
Write ·
erd_add_relationshipLinks two columns in a relationship
Connects a specific column on one side to a column on the other side.
Try: “Link orders.customer_id to customers.id.”
Write ·
erd_link_columnsRemoves a relationship
Deletes a relationship between two tables.
Try: “Remove the link between logs and users.”
Delete ·
erd_remove_relationshipChanges a relationship's type
Switches a relationship between kinds such as one-to-one and one-to-many.
Try: “Make that link one-to-one.”
Write ·
erd_change_relationship_typeSets what a delete does to related rows
Sets the ON DELETE action of a relationship, such as cascade.
Try: “Set ON DELETE CASCADE on orders to customers.”
Write ·
erd_change_relationship_on_deleteSets what an update does to related rows
Sets the ON UPDATE action of a relationship.
Try: “Set ON UPDATE RESTRICT on that link.”
Write ·
erd_change_relationship_on_updateAdds an index
Adds an index to a table.
Try: “Add an index on orders.created_at.”
Write ·
erd_add_indexRemoves an index
Deletes an index from a table.
Try: “Remove the old name index.”
Delete ·
erd_remove_indexRenames an index
Changes an index's name.
Try: “Rename idx1 to idx_orders_date.”
Write ·
erd_change_index_nameMakes an index unique or not
Turns the unique setting of an index on or off.
Try: “Make that index unique.”
Write ·
erd_set_index_uniqueAdds a column to an index
Adds another column to an existing index.
Try: “Add status to that index.”
Write ·
erd_add_index_columnRemoves a column from an index
Takes a column out of an index.
Try: “Take status out of that index.”
Delete ·
erd_remove_index_columnReorders columns in an index
Changes the position of a column inside an index.
Try: “Put created_at first in the index.”
Write ·
erd_move_index_columnSets ascending or descending for an index column
Sets the sort order of one column in an index.
Try: “Sort created_at descending in the index.”
Write ·
erd_set_index_column_orderAdds a sticky note
Adds a memo to the canvas.
Try: “Add a note explaining the billing tables.”
Write ·
erd_add_memoRemoves a sticky note
Deletes a memo from the canvas.
Try: “Remove the TODO note.”
Delete ·
erd_remove_memoEdits a sticky note
Changes the text of a memo.
Try: “Update the note to say v2.”
Write ·
erd_change_memo_valueRecolors a sticky note
Changes a memo's color.
Try: “Make the note yellow.”
Write ·
erd_change_memo_colorMoves a sticky note
Places a memo at new coordinates.
Try: “Move the note beside payments.”
Write ·
erd_move_memoResizes a sticky note
Changes a memo's width and height.
Try: “Make the note wider.”
Write ·
erd_resize_memoAdds a table group
Adds a labeled box that can hold tables.
Try: “Add a group called Billing.”
Write ·
erd_add_table_groupRemoves a table group
Deletes a group box.
Try: “Remove the Billing group.”
Delete ·
erd_remove_table_groupRenames a table group
Changes a group's name.
Try: “Rename Billing to Payments.”
Write ·
erd_change_table_group_nameRecolors a table group
Changes a group's color.
Try: “Make the group blue.”
Write ·
erd_change_table_group_colorMoves a table group
Places a group at new coordinates.
Try: “Move the group down.”
Write ·
erd_move_table_groupResizes a table group
Changes a group's width and height.
Try: “Enlarge the group.”
Write ·
erd_resize_table_groupPuts tables into a group
Assigns tables to a table group.
Try: “Put orders and payments in the Billing group.”
Write ·
erd_set_table_groupAdds a dictionary word
Adds a word to the naming dictionary.
Try: “Add the word 'customer' with the abbreviation 'cust'.”
Write ·
erd_add_wordEdits a dictionary word
Changes an existing dictionary word.
Try: “Change the abbreviation for 'customer'.”
Write ·
erd_update_wordRemoves a dictionary word
Deletes a word from the naming dictionary.
Try: “Remove the word 'temp'.”
Delete ·
erd_remove_wordAdds a dictionary term
Adds a term to the dictionary.
Try: “Add the term 'Email address'.”
Write ·
erd_add_termEdits a dictionary term
Changes a term in the dictionary.
Try: “Fix the type of the Email term.”
Write ·
erd_update_termRemoves a dictionary term
Deletes a term from the dictionary.
Try: “Remove the unused term.”
Delete ·
erd_remove_termAdds a domain
Adds a reusable data type definition to the dictionary.
Try: “Add a domain for money values.”
Write ·
erd_add_domainEdits a domain
Changes a domain's type or settings.
Try: “Make the money domain decimal(12,2).”
Write ·
erd_update_domainRemoves a domain
Deletes a domain from the dictionary.
Try: “Remove the unused domain.”
Delete ·
erd_remove_domainRe-derives physical names from the dictionaries
Recomputes physical names for a column, a table or the whole document after a word or term changed.
Try: “Re-derive all physical names.”
Write ·
erd_derive_physical_namesSets the target database
Chooses which database the diagram's SQL is written for.
Try: “Switch the diagram to MySQL.”
Write ·
erd_set_databaseSets the database name
Changes the name of the database in the diagram.
Try: “Name the database shop.”
Write ·
erd_set_database_nameEdits the schema SQL scripts
Sets the scripts that go before or after the generated DDL.
Try: “Add a CREATE EXTENSION line at the top.”
Write ·
erd_set_ddl_scriptImports SQL into the diagram
Loads a SQL dump and builds tables from it. It replaces the diagram unless mode is append.
Try: “Import this schema.sql into the diagram.”
Write ·
erd_import_sqlImports a GraphQL schema
Builds tables from a GraphQL schema. It replaces the diagram unless mode is append.
Try: “Import this GraphQL schema.”
Write ·
erd_import_graphqlImports DBML
Builds tables from DBML. It replaces the diagram unless mode is append.
Try: “Import this DBML file.”
Write ·
erd_import_dbmlImports AML
Builds tables from AML text. It replaces the diagram unless mode is append.
Try: “Import this AML.”
Write ·
erd_import_amlImports a diagram from JSON
Loads a full diagram from JSON, replacing the current one unless mode is append.
Try: “Load this exported JSON.”
Write ·
erd_import_jsonRuns up to 100 edits as one step
Applies up to 100 edits in order, all or none, and one undo reverts the batch. Later steps can use IDs created earlier.
Try: “Create an orders table with five columns in one go.”
Write ·
erd_batch
Read from the source code
Permissions
high risk · 4 things to watch
High risk
The assistant can add, change and remove tables, columns and relationships in your diagram, and imports can replace the whole diagram. Keep the diagram file in version control and review changes before you save.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can remove tables and columns from your diagram file
Tools such as erd_remove_table, erd_remove_columns and the import tools delete or replace parts of the diagram. erd_undo reverts the agent's own edits, so keep the file in git. npmjs.com
The imports replace the whole diagram by default
The SQL, GraphQL, DBML, AML and JSON imports replace the current diagram unless you ask for append mode. Say 'append' in your prompt if you want to keep what is there. npmjs.com
Without an editor it writes straight to the file
When no editor holds the diagram, edits are written to the .erd.json file on disk. Open the diagram in your editor to see changes live. npmjs.com
Edits in a closed JetBrains IDE can be overwritten
The README says a JetBrains IDE does not reload an open diagram, so close it there before the agent edits the file. Obsidian prefers the agent's edit over an unsaved one. npmjs.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Turning on read-only | No read-only mode is documented. The read tools (list, get, read, list_checks) only read, but the edit tools are always on. |
|---|---|
| Sign-in and keys | No credentials. The server looks for running editors under ~/.erd-editor/ide/. |
Questions
Is it official?
Yes. It is the ERD Editor project's own server, published from the same repository as the editor.
Is it free?
Yes. The server is MIT licensed and needs no account or API key.
What do I need to run it?
Node.js 22.12 or later. npx downloads the server the first time your assistant starts it, and you start it in your project folder because relative paths resolve there.
Does it work without VS Code or JetBrains open?
Yes. With no editor holding the diagram, it edits the file on disk instead. With an editor open, changes appear live.
Can it edit a database directly?
The README describes diagram editing, SQL import and SQL output. It does not mention connecting to a live database.
Can I undo what the agent did?
Yes, for its own edits through erd_undo, and one undo reverts a whole batch. In VS Code the change stays unsaved until you or Auto Save save it.
Which clients does it work in?
The README shows setup for Claude Code and Codex and says any MCP client can run it as a stdio server.
What databases can it write SQL for?
The README says reads can return SQL for any of eight databases.
Information
updated Nov 2, 2026
- Publisher
- Official
- Package
@dineug/erd-editor-mcp- Registry
- npm
- Transport
- stdio
- Auth
- None
- Version
- 1.1.1
- License
- MIT
- Last commit
- Oct 30, 2026
- Open issues
- 2
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 3Hide
- @dineug/erd-editor-mcp README · npmjs.com
- npm package metadata · registry.npmjs.org
- ERD Editor repository · github.com