@modudraft/mcp 0.22.0 → 0.23.0

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
@@ -86,7 +86,7 @@ Every MCP tool is listed by default. If that is too much context for your client
86
86
  | `data_flows` | Data-flow pipelines and stages | `list_data_flows`, `add_data_flow`, `add_data_flow_stage`, `update_data_flow_stage`, `delete_data_flow_stage`, `reorder_data_flow_stages` |
87
87
  | `views` | Show and hide tabs, the Notes tab | `get_enabled_tabs`, `enable_tab`, `disable_tab`, `get_notes`, `set_notes`, `append_to_notes`, `replace_in_notes` |
88
88
  | `import` | Read and scan the repo, import files, apply env values | `read_file`, `scan_project`, `import_file`, `import_directory`, `apply_env_to_nodes` |
89
- | `export` | Mermaid, PlantUML, draw.io, Terraform, K8s, write files, generate docs and runbooks | `export_mermaid`, `export_plantuml`, `export_drawio`, `export_terraform`, `export_k8s_yaml`, `export_to_file`, `generate_docs`, `generate_runbook` |
89
+ | `export` | Mermaid, PlantUML, draw.io, Terraform, K8s, Structurizr, write files, generate docs and runbooks | `export_mermaid`, `export_plantuml`, `export_drawio`, `export_terraform`, `export_k8s_yaml`, `export_to_file`, `export_structurizr`, `generate_docs`, `generate_runbook` |
90
90
  | `analysis` | Validate, diff, cross-diagram suggestions, clone | `validate_diagram`, `diff_diagram`, `find_shared_services`, `suggest_connections`, `clone_diagram`, `suggest_architecture` |
91
91
  | `project` | Watch a repo for drift, sync a diagram with the repo, generate sequences from the API | `watch_project`, `check_project_drift`, `unwatch_project`, `sync_project`, `generate_sequence_from_api` |
92
92
  | `history` | Server version history (snapshots) and the edit log | `snapshot_diagram`, `list_snapshots`, `restore_snapshot`, `get_edit_log` |
@@ -96,6 +96,15 @@ Every MCP tool is listed by default. If that is too much context for your client
96
96
  - `load_toolset(name)` adds a group at runtime and sends a tools-changed notification. If your client doesn't refresh tools after `load_toolset`, set `MODUDRAFT_TOOLSETS` instead.
97
97
  - Calling any tool by name always works, even when it isn't listed: the server loads its group and runs it.
98
98
 
99
+ ### Upgrading to 0.23.0
100
+
101
+ - New tool `export_structurizr` (export toolset) writes a diagram back out as a Structurizr workspace: `format: "dsl"` or `"json"`, with an optional `path` under your project folders and `overwrite`. It returns `{ format, summary, text }`, or `{ format, path, summary }` when it wrote a file. `export_structurizr` can write `.dsl` files; the other file-writing tools cannot. No other tool changed.
102
+
103
+ ### Upgrading to 0.22.1
104
+
105
+ - `write_config` now adds the `$schema` line to `modudraft.json`, so editors validate and autocomplete the file.
106
+ - A diagram that was imported on the web is only adopted by a Structurizr re-import when the workspace matches (the same entry file and most element names). Otherwise the web-imported items are left as they are, the workspace is imported beside them in the same diagram, and a warning says so.
107
+
99
108
  ### Upgrading to 0.22.0
100
109
 
101
110
  - Adds Structurizr import: `import_file` and `import_directory` read a `workspace.dsl` (with its `!include`d files) or a Structurizr `workspace.json`, and re-importing updates the diagram in place. `sync_project`, `watch_project` and the `modudraft-mcp check` command also compare a `workspace.dsl` source. Nothing is removed.
@@ -108,6 +117,7 @@ Every MCP tool is listed by default. If that is too much context for your client
108
117
  - `get_diagram` returns a `levels` field (for example `Top: 2 items; Orders: 1`). `render_diagram_text` and the exports show the top level unless you pass `level`; items outside the level appear marked as outside, with arrows to them shown as implied.
109
118
  - `validate_diagram` reports broken levels as errors and C4 rule breaks as warnings.
110
119
  - Diagrams without levels behave as before. Deploy the web app and API first: a level written by this version needs a web app that reads file format 2.11.0.
120
+ - More on levels and the C4 look: https://modudraft.com/docs/c4
111
121
 
112
122
  ### Upgrading to 0.20.0
113
123
 
@@ -304,6 +314,7 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
304
314
  | `export_terraform` | Generate Terraform resource stubs from the cloud tab |
305
315
  | `export_k8s_yaml` | Generate Kubernetes YAML manifests from the cloud tab |
306
316
  | `export_to_file` | Write any export format directly to a local file (`level` picks the architecture level for mermaid, plantuml and drawio) |
317
+ | `export_structurizr` | Export a diagram as a Structurizr workspace: `format` `dsl` (model, views and styles; no positions) or `json` (adds layouts and the Notes tab). Returns `summary` (what was exported, left out or changed) and the `text`, or writes it to `path` under your project folders (`overwrite: true` replaces an existing file) |
307
318
 
308
319
  ### Validation & diff
309
320
  *(toolset: `analysis`)*
@@ -424,9 +435,11 @@ Items from other files are never touched. Existing items without import history
424
435
  - The workspace's documentation and ADRs go into one marked block of the notes per workspace, replaced on re-import. Changes to docs, ADRs or dynamic views only are not reported as drift by `sync_project` or the CI check (applying a sync still updates the notes block and the sequences).
425
436
  - A colour the workspace sets wins on re-import; a colour you set by hand on an item the workspace gives no colour stays, and is not drift.
426
437
  - A diagram made by importing the workspace on the web is picked up by the first `import_file` of the same workspace: its items are matched, not added a second time.
427
- - Only the files the workspace uses (`!include`, `!docs` and `!adrs` targets, and the `.json` files beside it, checked for a layout) are read from its folder, up to 50 MB in all; `node_modules` and `.git` are skipped. A Structurizr `workspace.json` may be up to 20 MB (other files: 2 MB).
438
+ - Only the files the workspace uses (`!include`, `!docs` and `!adrs` targets, and the `.json` files beside it, checked for a layout) are read from its folder, up to 50 MB in all; `node_modules` and `.git` are skipped. A Structurizr `workspace.json` may be up to 20 MB; other entry files are limited to 2 MB, and the files a workspace includes count toward the 50 MB total.
428
439
  - `watch_project` / `check_project_drift` track the workspace file itself (`workspace.dsl`), not the files it includes. After editing an included file, run `sync_project` (or the CI check), which reads the whole workspace, to see the change.
429
440
 
441
+ More on importing a workspace: https://modudraft.com/docs/migrations/structurizr
442
+
430
443
  ## Project drift
431
444
 
432
445
  `check_project_drift` only reports; it no longer consumes the drift. Drift stays reported until you pass `acknowledge: true`. Re-importing a modified file with `import_file` also clears it for that file; a new file stays reported as added until you acknowledge. A truncated scan (too many files) is flagged in the result.
@@ -437,7 +450,7 @@ Items from other files are never touched. Existing items without import history
437
450
 
438
451
  **CI drift check.** The same engine powers `npx @modudraft/mcp check` and the `modudraft/drift-check` GitHub Action, which compare docker-compose, Kubernetes, Terraform, OpenAPI, Prisma, SQL and more with a diagram on every pull request (exit `0` in sync, `1` drift with `--on-drift fail`, `2` error). A file that fails to parse is reported and removes nothing. Supported files, `modudraft.json`, flags, keys and example workflows: https://modudraft.com/docs/ci
439
452
 
440
- **`sync_project`** inputs: `diagram_id`, `dir`, `files`, `dry_run` (default `true`), `remove_missing`, `write_config`. With `dry_run: false` it writes once through the normal save path, so the change is recorded in version history (it may merge with an earlier version from the same key within 10 minutes). Applying is refused when the sources came only from a scan. `write_config: true` writes `modudraft.json` (also during a preview), keeps existing entries, writes `{ path, node }` when a node was used, and skips files that errored. With no diagram id and no config the tool answers: "Pass diagram_id, or add modudraft.json (sync_project with write_config: true)".
453
+ **`sync_project`** inputs: `diagram_id`, `dir`, `files`, `dry_run` (default `true`), `remove_missing`, `write_config`. With `dry_run: false` it writes once through the normal save path, so the change is recorded in version history (it may merge with an earlier version from the same key within 10 minutes). Applying is refused when the sources came only from a scan. `write_config: true` writes `modudraft.json` (also during a preview), keeps existing entries, writes `{ path, node }` when a node was used, and skips files that errored. It also adds `"$schema": "https://modudraft.com/schema/modudraft.json"` as the first key (kept if already present), which gives autocomplete and validation in VS Code and JetBrains. With no diagram id and no config the tool answers: "Pass diagram_id, or add modudraft.json (sync_project with write_config: true)".
441
454
 
442
455
  ## Workspaces and local files
443
456