@modudraft/mcp 0.16.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 +77 -0
- package/dist/index.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -69,8 +69,53 @@ 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
|
+
|
|
111
|
+
### Upgrading to 0.17.0
|
|
112
|
+
|
|
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.
|
|
114
|
+
- `export_terraform` and `export_k8s_yaml` (and `export_to_file` for those formats) return `warnings` (in the response only; nothing is written into the exported file). Terraform names, values and comments are escaped, and unmappable resource types become commented-out blocks. The Kubernetes YAML no longer carries `# TODO` comments.
|
|
115
|
+
- The SQL export is now quoted. Mermaid output (flowchart, ER, sequence) differs in places: edge labels are escaped, boundaries become subgraphs, and the Mermaid importer handles `&`, dotted and thick links, `:::cls`, quoted labels and subgraphs.
|
|
116
|
+
- The Postman and Insomnia importers now keep `HEAD` and `OPTIONS` requests too, without a request body (`TRACE` and other methods are still skipped with a warning).
|
|
117
|
+
- Table-level `PRIMARY KEY` makes its columns non-nullable on SQL import.
|
|
118
|
+
|
|
74
119
|
### Upgrading to 0.16.0
|
|
75
120
|
|
|
76
121
|
- `HEAD` and `OPTIONS` are supported HTTP methods for API endpoints and OpenAPI imports (`TRACE` is still skipped with a warning). The Postman and Insomnia importers still keep only GET, POST, PUT, PATCH and DELETE.
|
|
@@ -87,6 +132,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
|
|
|
87
132
|
## Tools
|
|
88
133
|
|
|
89
134
|
### Diagram management
|
|
135
|
+
*(toolset: `core`)*
|
|
136
|
+
|
|
90
137
|
| Tool | Description |
|
|
91
138
|
|---|---|
|
|
92
139
|
| `list_diagrams` | List your diagrams from every workspace you belong to |
|
|
@@ -98,6 +145,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
|
|
|
98
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) |
|
|
99
146
|
|
|
100
147
|
### Architecture nodes & edges
|
|
148
|
+
*(toolset: `core`)*
|
|
149
|
+
|
|
101
150
|
| Tool | Description |
|
|
102
151
|
|---|---|
|
|
103
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) |
|
|
@@ -110,6 +159,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
|
|
|
110
159
|
| `add_note` | Add a sticky note annotation |
|
|
111
160
|
|
|
112
161
|
### Node metadata
|
|
162
|
+
*(toolset: `modeling`, except `get_node_schema`, which is in `core`)*
|
|
163
|
+
|
|
113
164
|
| Tool | Description |
|
|
114
165
|
|---|---|
|
|
115
166
|
| `set_node_metadata` | Set a configuration property on a node (host, port, framework, region, etc.) |
|
|
@@ -117,6 +168,8 @@ Without it, all diagram tools work as usual. The file tools fall back to your cl
|
|
|
117
168
|
| `get_node_schema` | Get expected metadata fields for an archetype |
|
|
118
169
|
|
|
119
170
|
### Sequence diagram
|
|
171
|
+
*(toolset: `sequences`)*
|
|
172
|
+
|
|
120
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.
|
|
121
174
|
|
|
122
175
|
| Tool | Description |
|
|
@@ -137,6 +190,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
|
|
|
137
190
|
| `delete_sequence_fragment` | Remove a fragment |
|
|
138
191
|
|
|
139
192
|
### DB schema (ER diagram)
|
|
193
|
+
*(toolset: `database`)*
|
|
194
|
+
|
|
140
195
|
| Tool | Description |
|
|
141
196
|
|---|---|
|
|
142
197
|
| `add_db_table` | Add a database table with columns; rejects duplicate table names (case-insensitive) |
|
|
@@ -145,6 +200,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
|
|
|
145
200
|
| `export_er_diagram` | Export schema as SQL DDL |
|
|
146
201
|
|
|
147
202
|
### API schema (OpenAPI)
|
|
203
|
+
*(toolset: `api`)*
|
|
204
|
+
|
|
148
205
|
| Tool | Description |
|
|
149
206
|
|---|---|
|
|
150
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 |
|
|
@@ -156,6 +213,8 @@ A diagram can hold many named sequences. Each has its own lanes (architecture no
|
|
|
156
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`.
|
|
157
214
|
|
|
158
215
|
### Notes
|
|
216
|
+
*(toolset: `views`)*
|
|
217
|
+
|
|
159
218
|
| Tool | Description |
|
|
160
219
|
|---|---|
|
|
161
220
|
| `get_notes` | Return the diagram's Markdown notes |
|
|
@@ -164,6 +223,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
164
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 |
|
|
165
224
|
|
|
166
225
|
### Cloud diagram
|
|
226
|
+
*(toolset: `infra`)*
|
|
227
|
+
|
|
167
228
|
| Tool | Description |
|
|
168
229
|
|---|---|
|
|
169
230
|
| `add_cloud_resource` | Add a cloud resource (cluster, VPC, service, database, queue, etc.) |
|
|
@@ -171,6 +232,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
171
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 |
|
|
172
233
|
|
|
173
234
|
### Network diagram
|
|
235
|
+
*(toolset: `infra`)*
|
|
236
|
+
|
|
174
237
|
| Tool | Description |
|
|
175
238
|
|---|---|
|
|
176
239
|
| `add_network_device` | Add a network device (router, switch, firewall, etc.) |
|
|
@@ -178,6 +241,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
178
241
|
| `delete_network_device` | Remove a network device |
|
|
179
242
|
|
|
180
243
|
### Data flow diagram
|
|
244
|
+
*(toolset: `data_flows`)*
|
|
245
|
+
|
|
181
246
|
| Tool | Description |
|
|
182
247
|
|---|---|
|
|
183
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) |
|
|
@@ -186,6 +251,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
186
251
|
| `reorder_data_flow_stages` | Set the order of all stages in a data flow diagram |
|
|
187
252
|
|
|
188
253
|
### File import
|
|
254
|
+
*(toolset: `import`)*
|
|
255
|
+
|
|
189
256
|
| Tool | Description |
|
|
190
257
|
|---|---|
|
|
191
258
|
| `scan_project` | Scan a directory and list all importable files (docker-compose, K8s, Terraform, SQL, Prisma, OpenAPI, etc.) |
|
|
@@ -200,6 +267,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
200
267
|
- **Context (no diagram change):** `.env` files (sensitive values always redacted), `package.json`, `go.mod`, `requirements.txt`, `Gemfile`, `pom.xml`, `Cargo.toml`
|
|
201
268
|
|
|
202
269
|
### Export
|
|
270
|
+
*(toolset: `export`, except `render_diagram_text`, which is in `core`)*
|
|
271
|
+
|
|
203
272
|
| Tool | Description |
|
|
204
273
|
|---|---|
|
|
205
274
|
| `export_mermaid` | Export as Mermaid flowchart or ER diagram (paste into GitHub Markdown) |
|
|
@@ -211,12 +280,16 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
211
280
|
| `export_to_file` | Write any export format directly to a local file |
|
|
212
281
|
|
|
213
282
|
### Validation & diff
|
|
283
|
+
*(toolset: `analysis`)*
|
|
284
|
+
|
|
214
285
|
| Tool | Description |
|
|
215
286
|
|---|---|
|
|
216
287
|
| `validate_diagram` | Check a diagram for issues: dangling edges, orphaned nodes, FK integrity, missing PKs, duplicate routes, etc. |
|
|
217
288
|
| `diff_diagram` | Compare two diagrams and return a structured list of what changed (added/removed/modified) |
|
|
218
289
|
|
|
219
290
|
### Cross-diagram intelligence
|
|
291
|
+
*(toolset: `analysis`)*
|
|
292
|
+
|
|
220
293
|
| Tool | Description |
|
|
221
294
|
|---|---|
|
|
222
295
|
| `find_shared_services` | Find nodes that appear in multiple diagrams - useful for shared infrastructure audits |
|
|
@@ -225,6 +298,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
225
298
|
| `clone_diagram` | Deep-copy a diagram as a starting template |
|
|
226
299
|
|
|
227
300
|
### Discovery (static, no API call)
|
|
301
|
+
*(toolset: `core`)*
|
|
302
|
+
|
|
228
303
|
| Tool | Description |
|
|
229
304
|
|---|---|
|
|
230
305
|
| `list_archetypes` | All component archetypes with metadata field schemas |
|
|
@@ -232,6 +307,8 @@ The old `request_body`, `request_format`, `body`, `body_format` and top-level `r
|
|
|
232
307
|
| `list_protocols` | Valid edge protocol values |
|
|
233
308
|
|
|
234
309
|
### Org context
|
|
310
|
+
*(toolset: `core`)*
|
|
311
|
+
|
|
235
312
|
| Tool | Description |
|
|
236
313
|
|---|---|
|
|
237
314
|
| `get_org_context` | Get cached org context - existing tools, protocols, naming patterns |
|