@modudraft/mcp 0.17.0 → 0.18.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
@@ -69,8 +69,45 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
69
69
  | `MODUDRAFT_API_URL` | No | Override API base URL (default: `https://api.modudraft.com`) |
70
70
  | `MODUDRAFT_PROJECT_ROOTS` | No | Your source-code folder(s): the repo or git worktree the file tools (`scan_project`, `read_file`, `import_file`, `export_to_file`, ...) may read from and write to. Separate several with `:` (`;` on Windows); `~` is allowed. Used when your MCP client doesn't share its workspace folders. Your home directory or `/` is never accepted, so point it at the repo itself. |
71
71
  | `MODUDRAFT_AUTO_TIDY_MS` | No | Quiet period, in milliseconds, before the architecture tab is auto-tidied after nodes or edges are added or removed (default `8000`; `0` turns auto-tidy off). See [Auto-tidy](#auto-tidy) |
72
+ | `MODUDRAFT_TOOLSETS` | No | Which tool groups to list: unset or `all` lists every tool (the default), `core` lists only the core tools, `"sequences,api"` lists core plus those groups. See [Toolsets](#toolsets) |
72
73
 
73
74
 
75
+ ## Toolsets
76
+
77
+ Every MCP tool is listed by default. If that is too much context for your client, set `MODUDRAFT_TOOLSETS` to list fewer: `core` lists a much smaller set, and the core group covers diagram management, nodes and edges, rendering, discovery, org context and `search_diagrams`. The core tools are: `list_diagrams`, `create_diagram`, `get_diagram`, `rename_diagram`, `delete_diagram`, `clear_diagram`, `layout_diagram`, `get_share_link`, `add_node`, `get_node`, `update_node`, `delete_node`, `add_edge`, `update_edge`, `delete_edge`, `add_boundary`, `add_note`, `render_diagram_text`, `list_archetypes`, `list_tools`, `list_protocols`, `get_node_schema`, `get_org_context`, `refresh_org_context`, `search_diagrams`.
78
+
79
+ | Toolset | Purpose | Tools |
80
+ |---|---|---|
81
+ | `modeling` | Bulk create and node metadata | `apply_architecture`, `bulk_add_nodes`, `bulk_add_edges`, `set_node_metadata`, `suggest_metadata` |
82
+ | `sequences` | Sequence diagrams: sequences, lanes, messages, fragments | `list_sequences`, `add_sequence`, `update_sequence`, `delete_sequence`, `add_sequence_participant`, `add_sequence_message`, `bulk_add_sequence_messages`, `update_sequence_message`, `delete_sequence_message`, `get_sequence`, `clear_sequence`, `add_sequence_fragment`, `update_sequence_fragment`, `delete_sequence_fragment` |
83
+ | `database` | DB tables and ER export | `add_db_table`, `update_db_table`, `delete_db_table`, `export_er_diagram` |
84
+ | `api` | API endpoints, contracts, OpenAPI export | `add_api_endpoint`, `bulk_add_api_endpoints`, `update_api_endpoint`, `delete_api_endpoint`, `export_openapi` |
85
+ | `infra` | Cloud resources and network devices | `add_cloud_resource`, `update_cloud_resource`, `delete_cloud_resource`, `add_network_device`, `update_network_device`, `delete_network_device` |
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
+ | `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
+ | `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` |
90
+ | `analysis` | Validate, diff, cross-diagram suggestions, clone | `validate_diagram`, `diff_diagram`, `find_shared_services`, `suggest_connections`, `clone_diagram`, `suggest_architecture` |
91
+ | `project` | Watch a repo for drift, generate sequences from the API | `watch_project`, `check_project_drift`, `unwatch_project`, `generate_sequence_from_api` |
92
+ | `history` | Local snapshots and the edit log | `snapshot_diagram`, `list_snapshots`, `restore_snapshot`, `delete_snapshot`, `get_edit_log` |
93
+
94
+ - `MODUDRAFT_TOOLSETS="core"` lists the core tools only; `"sequences,api"` lists core plus those groups; `"all"` (or unset) lists everything.
95
+ - A value made only of unknown names keeps the default (everything) and prints a warning on stderr.
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
+ - Calling any tool by name always works, even when it isn't listed: the server loads its group and runs it.
98
+
99
+ ### Upgrading to 0.18.0
100
+
101
+ - New `load_toolset` tool and the `MODUDRAFT_TOOLSETS` environment variable (see [Toolsets](#toolsets)). Nothing was removed or renamed, and the default is unchanged: every tool is listed.
102
+ - New MCP resources and prompts (see [Resources and prompts](#resources-and-prompts)).
103
+
104
+ ### Resources and prompts
105
+
106
+ Besides tools, the server offers MCP resources and prompts, for clients that support them.
107
+
108
+ - **Resources:** each diagram is readable as plain-text line art at `modudraft://diagram/<id>` (the architecture tab, the same output as `render_diagram_text`). `resources/list` returns your 50 most recently edited diagrams; any diagram id you can reach can be read by URI.
109
+ - **Prompts:** `map_repo` (optional `path`) scans a repository and imports what it finds; `check_drift` (`diagram_id`) checks a diagram against the project code; `review_diagram` (`diagram_id`) validates a diagram and lists its issues. Each is one message that names the toolset to load.
110
+
74
111
  ### Upgrading to 0.17.0
75
112
 
76
113
  - More importers now report a `warnings` list for what they skipped or could not map (most formats already did; dbml, schema-rb, typeorm, sqlalchemy, dbt, cloudformation and asyncapi return none). `import_file` refuses a SQL file that only has `ALTER TABLE` statements (no `CREATE TABLE`) with a reason.
@@ -95,6 +132,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
95
132
  ## Tools
96
133
 
97
134
  ### Diagram management
135
+ *(toolset: `core`)*
136
+
98
137
  | Tool | Description |
99
138
  |---|---|
100
139
  | `list_diagrams` | List your diagrams from every workspace you belong to |
@@ -106,6 +145,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
106
145
  | `get_share_link` | Get or create a share link. If a link exists with a different permission it is returned as is; pass `replace: true` to rotate it (the old link stops working) |
107
146
 
108
147
  ### Architecture nodes & edges
148
+ *(toolset: `core`)*
149
+
109
150
  | Tool | Description |
110
151
  |---|---|
111
152
  | `add_node` | Add a component (compute, database, queue, gateway, etc.). `tool` takes a catalog key or a common name and is resolved to the catalog key (see [Tool names](#tool-names)). Optional `runs_on` links the node to a Cloud-tab resource (its id or name; a bad value is refused with the valid names) |
@@ -118,6 +159,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
118
159
  | `add_note` | Add a sticky note annotation |
119
160
 
120
161
  ### Node metadata
162
+ *(toolset: `modeling`, except `get_node_schema`, which is in `core`)*
163
+
121
164
  | Tool | Description |
122
165
  |---|---|
123
166
  | `set_node_metadata` | Set a configuration property on a node (host, port, framework, region, etc.) |
@@ -125,6 +168,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
125
168
  | `get_node_schema` | Get expected metadata fields for an archetype |
126
169
 
127
170
  ### Sequence diagram
171
+ *(toolset: `sequences`)*
172
+
128
173
  A diagram can hold many named sequences. Each has its own lanes (architecture nodes, in order), messages and fragments. Message and fragment tools take `sequence_id`, which may be left out only when the diagram has exactly one sequence.
129
174
 
130
175
  | Tool | Description |
@@ -145,6 +190,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
145
190
  | `delete_sequence_fragment` | Remove a fragment |
146
191
 
147
192
  ### DB schema (ER diagram)
193
+ *(toolset: `database`)*
194
+
148
195
  | Tool | Description |
149
196
  |---|---|
150
197
  | `add_db_table` | Add a database table with columns; rejects duplicate table names (case-insensitive) |
@@ -153,6 +200,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
153
200
  | `export_er_diagram` | Export schema as SQL DDL |
154
201
 
155
202
  ### API schema (OpenAPI)
203
+ *(toolset: `api`)*
204
+
156
205
  | Tool | Description |
157
206
  |---|---|
158
207
  | `add_api_endpoint` | Add an http (including HEAD and OPTIONS), graphql, grpc, websocket or event endpoint; rejects duplicate endpoints. Its request and response shapes go in `contract`: per-protocol slots holding JSON Schema (as an object or YAML), where fields are required unless marked `optional: true`. Omit `contract` to start from an empty one |
@@ -164,6 +213,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
164
213
  The old `request_body`, `request_format`, `body`, `body_format` and top-level `responses` arguments were removed; they now return an error naming their replacement in `contract`.
165
214
 
166
215
  ### Notes
216
+ *(toolset: `views`)*
217
+
167
218
  | Tool | Description |
168
219
  |---|---|
169
220
  | `get_notes` | Return the diagram's Markdown notes |
@@ -172,6 +223,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
172
223
  | `replace_in_notes` | Literal find-and-replace inside the notes (must match exactly once unless `replace_all`), so one checkbox or sentence can change without resending everything |
173
224
 
174
225
  ### Cloud diagram
226
+ *(toolset: `infra`)*
227
+
175
228
  | Tool | Description |
176
229
  |---|---|
177
230
  | `add_cloud_resource` | Add a cloud resource (cluster, VPC, service, database, queue, etc.) |
@@ -179,6 +232,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
179
232
  | `delete_cloud_resource` | Remove a cloud resource. Nodes that ran on it (or a child) keep existing; only their `runs_on` link is cleared |
180
233
 
181
234
  ### Network diagram
235
+ *(toolset: `infra`)*
236
+
182
237
  | Tool | Description |
183
238
  |---|---|
184
239
  | `add_network_device` | Add a network device (router, switch, firewall, etc.) |
@@ -186,6 +241,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
186
241
  | `delete_network_device` | Remove a network device |
187
242
 
188
243
  ### Data flow diagram
244
+ *(toolset: `data_flows`)*
245
+
189
246
  | Tool | Description |
190
247
  |---|---|
191
248
  | `add_data_flow_stage` | Add a pipeline stage (source, transform, sink, etc.). Optional `node_id` links it to an Architecture-tab node (its id or label; a bad value is refused with the valid names) |
@@ -194,6 +251,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
194
251
  | `reorder_data_flow_stages` | Set the order of all stages in a data flow diagram |
195
252
 
196
253
  ### File import
254
+ *(toolset: `import`)*
255
+
197
256
  | Tool | Description |
198
257
  |---|---|
199
258
  | `scan_project` | Scan a directory and list all importable files (docker-compose, K8s, Terraform, SQL, Prisma, OpenAPI, etc.) |
@@ -208,6 +267,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
208
267
  - **Context (no diagram change):** `.env` files (sensitive values always redacted), `package.json`, `go.mod`, `requirements.txt`, `Gemfile`, `pom.xml`, `Cargo.toml`
209
268
 
210
269
  ### Export
270
+ *(toolset: `export`, except `render_diagram_text`, which is in `core`)*
271
+
211
272
  | Tool | Description |
212
273
  |---|---|
213
274
  | `export_mermaid` | Export as Mermaid flowchart or ER diagram (paste into GitHub Markdown) |
@@ -219,12 +280,16 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
219
280
  | `export_to_file` | Write any export format directly to a local file |
220
281
 
221
282
  ### Validation & diff
283
+ *(toolset: `analysis`)*
284
+
222
285
  | Tool | Description |
223
286
  |---|---|
224
287
  | `validate_diagram` | Check a diagram for issues: dangling edges, orphaned nodes, FK integrity, missing PKs, duplicate routes, etc. |
225
288
  | `diff_diagram` | Compare two diagrams and return a structured list of what changed (added/removed/modified) |
226
289
 
227
290
  ### Cross-diagram intelligence
291
+ *(toolset: `analysis`)*
292
+
228
293
  | Tool | Description |
229
294
  |---|---|
230
295
  | `find_shared_services` | Find nodes that appear in multiple diagrams - useful for shared infrastructure audits |
@@ -233,6 +298,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
233
298
  | `clone_diagram` | Deep-copy a diagram as a starting template |
234
299
 
235
300
  ### Discovery (static, no API call)
301
+ *(toolset: `core`)*
302
+
236
303
  | Tool | Description |
237
304
  |---|---|
238
305
  | `list_archetypes` | All component archetypes with metadata field schemas |
@@ -240,6 +307,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
240
307
  | `list_protocols` | Valid edge protocol values |
241
308
 
242
309
  ### Org context
310
+ *(toolset: `core`)*
311
+
243
312
  | Tool | Description |
244
313
  |---|---|
245
314
  | `get_org_context` | Get cached org context - existing tools, protocols, naming patterns |