@dineug/erd-editor-mcp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # @dineug/erd-editor-mcp
2
2
 
3
3
  > An MCP server that lets a coding agent edit [erd-editor](https://github.com/dineug/erd-editor)
4
- > diagrams, live in VS Code or straight on disk
4
+ > diagrams, live in VS Code, Obsidian or a JetBrains IDE, or straight on disk
5
5
 
6
6
  Claude Code, Codex and any other client of the [Model Context Protocol](https://modelcontextprotocol.io)
7
7
  get one tool per editing operation on an `.erd.json` document: add a table, rename a column,
8
8
  relate two tables, import a DDL dump, read the schema back as SQL. When the document is open in
9
9
  the [ERD Editor VS Code extension](https://marketplace.visualstudio.com/items?itemName=dineug.vuerd-vscode),
10
+ the [ERD Editor Obsidian plugin](https://community.obsidian.md/plugins/erd-editor) or the
11
+ [ERD Editor plugin](https://plugins.jetbrains.com/plugin/23594-erd-editor) for IntelliJ-based IDEs,
10
12
  the agent joins the editor as a collaborator: every call shows up on the canvas as it happens, with
11
13
  the agent's focus on the cell it is editing. With no editor around, the same tools edit the file
12
14
  itself.
@@ -39,25 +41,45 @@ args = ["-y", "@dineug/erd-editor-mcp"]
39
41
  Run `npx -y @dineug/erd-editor-mcp` as a stdio server. It resolves relative document paths
40
42
  against its working directory, so start it in your project.
41
43
 
44
+ On Windows it refuses a document name with a colon, such as `orders:v2.erd`, a device name such
45
+ as `NUL.erd` or `CON.erd`, or a name ending in a dot or a space, and leaves such files out when it
46
+ lists documents from disk: Windows would store another file than the one named. Use `-` in place
47
+ of `:`.
48
+
42
49
  ## Live and headless
43
50
 
44
- For every edit the server looks for a VS Code window that holds the document, through the lock
45
- files the extension keeps in `~/.erd-editor/ide/`:
51
+ For every edit the server looks for an editor that holds the document, a VS Code window with the
52
+ ERD Editor extension, an Obsidian vault window with the ERD Editor plugin or an IntelliJ-based IDE
53
+ with the ERD Editor plugin, which keeps one lock for all its open projects, through the lock files
54
+ each keeps in `~/.erd-editor/ide/`:
46
55
 
47
56
  | What it finds | What an edit does |
48
57
  | --- | --- |
49
- | A window whose workspace contains the document, or that has it open | **Live.** Opens the document in the ERD editor if needed, joins the editing session and applies the change there. Edits appear at once and stay unsaved until the agent calls `erd_save` (or you save). The agent's `erd_undo` reverts only its own edits. |
50
- | No window | **Headless.** Loads the file, applies the change and replaces the file atomically. `erd_save` has nothing to do. |
51
- | A window with its hub off | **Refused.** Reads still work, from disk. Writing the file under an open editor would be overwritten by its next save, so the server does not. |
52
-
53
- The live hub runs in trusted workspaces and is on by default. Turn it off with the VS Code setting
54
- `dineug.erd-editor.agentHub.enabled`; the window then still guards its documents from headless
55
- writes. The extension activates in workspaces that contain `.erd`, `.erd.json`, `.vuerd` or
56
- `.vuerd.json` files.
57
-
58
- The server never falls back to the file on its own while a window holds a document: if the
59
- connection drops it reconnects, and only when that window has exited does it edit the file and say
60
- so in the result.
58
+ | A window whose workspace or vault contains the document, an IDE with a project that contains it, or an editor that has it open | **Live.** Opens the document in the ERD editor if needed, joins the editing session and applies the change there. Edits appear at once. VS Code keeps them unsaved until the agent calls `erd_save` (or you save); Obsidian saves them about two seconds later and a JetBrains IDE a fraction of a second after editing stops, as each saves your own edits, and `erd_save` writes them at once. The agent's `erd_undo` reverts only its own edits. |
59
+ | No editor | **Headless.** Loads the file, applies the change and replaces the file atomically. `erd_save` has nothing to do. A read-only file, such as a Perforce or TFVC file not checked out, is refused with `readonly` until you make it writable. On Windows, a file with permissions of its own, unlike its folder's, is written in place so that it keeps them, and a file another program holds open is tried again for up to two seconds. |
60
+ | An editor with its hub off | **Refused.** Reads still work, from disk. Writing the file under an open editor would be overwritten by its next save, so the server does not. |
61
+ | On Windows, an editor that holds the document under another path to the same file: the agent named it through a network share or a mapped drive of this computer, such as `\\localhost\C$\…`, and the editor opened it by its drive path, or the other way round | **Refused**, reads included; the result names the path the editor holds the document by, to call again with. |
62
+ | An editor Windows keeps the agent out of: one started as administrator while the agent was not, or any editor when the agent runs in a sandbox | **Refused**, reads included, with a result that says why. Run the editor and the agent with the same rights, for example by starting the editor again without administrator rights. With Windows 11's Administrator protection on, an editor started as administrator runs as a separate account whose lock files the agent never sees, so the edit goes headless under that editor: start it without administrator rights there. |
63
+
64
+ In VS Code the live hub runs in trusted workspaces and is on by default. Turn it off with the
65
+ setting `dineug.erd-editor.agentHub.enabled`; the window then still guards its documents from
66
+ headless writes. The extension activates in workspaces that contain `.erd`, `.erd.json`, `.vuerd`
67
+ or `.vuerd.json` files.
68
+
69
+ In Obsidian the live hub runs in every vault window while the ERD Editor plugin is enabled, and is
70
+ on by default. Turn it off with the plugin's coding-agent setting; the vault window then still
71
+ guards its files from headless writes.
72
+
73
+ In a JetBrains IDE the live hub runs while the ERD Editor plugin is enabled, one for the whole IDE
74
+ and every project open in it, and is on by default. Turn it off with Coding agents under
75
+ Settings | Tools | ERD Editor; the IDE then still guards the files of its projects from headless
76
+ writes. Trust is per project: an agent reads the ERD files of a project the IDE does not trust but
77
+ cannot change them. On Windows it listens on a named pipe, as the VS Code and Obsidian hubs do.
78
+
79
+ The server never falls back to the file on its own while an editor holds a document: if the
80
+ connection drops it reconnects, and only when that editor has exited, or has closed the document
81
+ and stopped serving it, as Obsidian does when the plugin is disabled and a JetBrains IDE does when
82
+ a project closes or the plugin is disabled, does it edit the file and say so in the result.
61
83
 
62
84
  ## Documents
63
85
 
@@ -110,6 +132,17 @@ argument they do not declare, or one of the wrong type, with a JSON-RPC invalid
110
132
  (-32602) before touching the document, so a misspelled argument is never silently dropped. The
111
133
  other session tools ignore arguments they do not know.
112
134
 
135
+ ## Documentation
136
+
137
+ - [Introduction](https://docs.erd-editor.io/docs/mcp/introduction) — what an agent can and cannot
138
+ do, how it works, requirements
139
+ - [Install](https://docs.erd-editor.io/docs/mcp/installation) — Claude Code, Codex and any other
140
+ client, setting up VS Code, updating
141
+ - [Live and Headless](https://docs.erd-editor.io/docs/mcp/live-and-headless) — where an edit
142
+ lands, saving, undo, a window that goes away, conflicts on disk
143
+ - [Tools](https://docs.erd-editor.io/docs/mcp/tools) — every tool with its arguments, paging a
144
+ large schema, `erd_batch`, results and refusals
145
+
113
146
  ## License
114
147
 
115
148
  [MIT](https://github.com/dineug/erd-editor/blob/main/LICENSE)