@modudraft/mcp 0.12.2 → 0.12.4

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/LICENSE ADDED
@@ -0,0 +1,67 @@
1
+ Modudraft MCP Server - Proprietary Software License
2
+
3
+ Copyright (c) 2026 Modudraft. All rights reserved.
4
+
5
+ This license applies to the @modudraft/mcp package (the "Software"). By installing
6
+ or running the Software you agree to these terms. If you do not agree, do not
7
+ install or use it.
8
+
9
+ 1. Grant of use
10
+
11
+ Subject to these terms, Modudraft grants you a limited, non-exclusive,
12
+ non-transferable, revocable license to install and run the Software, in the
13
+ form Modudraft distributes it, solely to connect your own AI tools to the
14
+ Modudraft service under a valid Modudraft account.
15
+
16
+ 2. Restrictions
17
+
18
+ Except as expressly permitted in section 1 or by law that cannot be waived,
19
+ you may not, and may not allow anyone else to:
20
+
21
+ (a) copy, modify, translate, or create derivative works of the Software;
22
+ (b) redistribute, publish, sublicense, sell, rent, lease, host, or otherwise
23
+ make the Software available to third parties;
24
+ (c) reverse engineer, decompile, disassemble, deobfuscate, or otherwise
25
+ attempt to derive the source code or underlying algorithms of the
26
+ Software;
27
+ (d) remove or alter any copyright or proprietary notice; or
28
+ (e) use the Software to circumvent the limits, authentication, or access
29
+ controls of the Modudraft service, or in violation of the Modudraft
30
+ Terms of Service.
31
+
32
+ 3. Ownership
33
+
34
+ The Software is licensed, not sold. Modudraft and its licensors retain all
35
+ right, title, and interest in the Software, including all intellectual
36
+ property rights. No rights are granted other than those expressly stated
37
+ here. Third-party components included in the Software remain under their own
38
+ licenses.
39
+
40
+ 4. Your content
41
+
42
+ These terms do not give Modudraft any rights in the diagrams and other
43
+ content you create or access with the Software. Your rights and ours in that
44
+ content, and your use of the Modudraft service, are governed by the Terms of
45
+ Service at https://modudraft.com/terms. If these terms and the Terms of
46
+ Service conflict on the use of the service, the Terms of Service prevail.
47
+
48
+ 5. Termination
49
+
50
+ This license ends automatically if you breach it. When it ends you must stop
51
+ using the Software and delete all copies. Modudraft may also end it on
52
+ notice, for example if you no longer have a Modudraft account.
53
+
54
+ 6. Disclaimer of warranty
55
+
56
+ THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
57
+ KIND, EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY,
58
+ FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
59
+
60
+ 7. Limitation of liability
61
+
62
+ TO THE MAXIMUM EXTENT PERMITTED BY LAW, MODUDRAFT WILL NOT BE LIABLE FOR ANY
63
+ INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR FOR ANY
64
+ LOSS OF DATA, PROFITS, OR REVENUE, ARISING OUT OF OR RELATED TO THE SOFTWARE,
65
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
66
+
67
+ For licensing questions or to report a security issue: security@modudraft.com
package/README.md CHANGED
@@ -177,6 +177,7 @@ Copy the key - you'll only see it once.
177
177
  | Tool | Description |
178
178
  |---|---|
179
179
  | `export_mermaid` | Export as Mermaid flowchart or ER diagram (paste into GitHub Markdown) |
180
+ | `render_diagram_text` | Draw the architecture, sequence, DB schema (ER), cloud, network or data-flow tab as plain-text line art, the whole tab or a part of it (see [Viewing diagrams as text](#viewing-diagrams-as-text)) |
180
181
  | `export_plantuml` | Export as PlantUML component diagram |
181
182
  | `export_drawio` | Export as draw.io / diagrams.net XML |
182
183
  | `export_terraform` | Generate Terraform resource stubs from the cloud tab |
@@ -261,7 +262,9 @@ The `get_diagram` response includes a `hints` array listing nodes with empty met
261
262
 
262
263
  ## License
263
264
 
264
- MIT © [Modudraft](https://modudraft.com)
265
+ Proprietary software. Copyright © 2026 [Modudraft](https://modudraft.com). All rights reserved.
266
+
267
+ You may install and run this package to connect your own AI tools to the Modudraft service under a valid Modudraft account. Copying, modifying, redistributing, and reverse-engineering it are not permitted. The full terms are in the `LICENSE` file included in this package, and use of the service is governed by the [Terms of Service](https://modudraft.com/terms). Questions: security@modudraft.com.
265
268
 
266
269
  ## Auto-tidy
267
270
 
@@ -287,3 +290,164 @@ A node's `tool` is a catalog key (`better-auth`, `postgresql`, `google-oauth`),
287
290
  - `suggest_architecture` also recognises these names when it looks for an auth component in a description, and the nodes it proposes now carry real catalog archetypes (`client`, `gateway`, `auth`, `notification`, `search`, `database`, `cache`, `queue`, `storage`, `observability`, `compute`).
288
291
  - Aliases are part of the catalog itself (an `aliases` list on each tool in `@modudraft/core`), so the editor's palette search finds a tool by them too: typing `entra`, `next auth` or `sign in with google` finds Azure AD, Auth.js and Google OAuth.
289
292
  - Importing a dependency manifest (`import_file` on `package.json`, `requirements.txt`, `Gemfile`, `go.mod`, `composer.json`, `pom.xml`) now also reports an `auth` list of the authentication libraries it finds, under their catalog names (`Better Auth`, `Auth.js`, `Clerk`, `Keycloak`, `Microsoft OAuth`...), ready to pass straight to `add_node`. Bare `@supabase/supabase-js` and `firebase` are not counted as auth.
293
+
294
+ ## Viewing diagrams as text
295
+
296
+ `render_diagram_text` draws a tab as plain-text line art, so any agent or terminal can *see* a diagram without a Mermaid or PlantUML renderer. Print the returned `text` inside a code fence. It is read-only.
297
+
298
+ It draws the **full** tab or a **part** of it. `diagram_type` is `architecture` (default), `sequence`, `er` (the DB schema), `cloud`, `network` or `data_flow`.
299
+
300
+ | Selector | Applies to | Example | Shows |
301
+ |---|---|---|---|
302
+ | `focus` + `hops` + `direction` | architecture | `focus: "Auth", hops: 2, direction: "out"` | that node and everything within N edges (`out` = downstream, `in` = callers, `both` = default) |
303
+ | `nodes` | architecture | `nodes: ["Auth", "Postgres DB"]` | exactly those nodes and the edges between them |
304
+ | `boundary` | architecture | `boundary: "VPC"` | the nodes inside that boundary |
305
+ | `archetype` | architecture | `archetype: "database"` | only nodes of that archetype |
306
+ | `from_message` / `to_message` | sequence | `from_message: 13, to_message: 15` | messages 13 to 15 (0-based, inclusive) |
307
+ | `participants` | sequence | `participants: ["Web App", "API Server"]` | only messages between them |
308
+ | `focus` + `hops` + `direction` | er | `focus: "orders", hops: 1` | that table and the tables related to it (`out` = the tables it references, `in` = the tables that reference it) |
309
+ | `tables` / `name_prefix` / `schema` | er | `tables: ["users", "orders"]`, `name_prefix: "order"`, `schema: "audit"` | exactly those tables / tables whose name starts with it / tables of one schema |
310
+ | `detail` | er | `detail: "keys"` | `full` (default, every column), `keys` (only PK / FK / unique columns) or `names` (just the table names) |
311
+ | `root` | cloud, network | `root: "main-vpc"` | that resource and everything inside it |
312
+ | `depth` | cloud, network | `depth: 1` | this many levels below the root(s); `0` = only the roots. Boxes with hidden children show `(+N)` |
313
+ | `type` | cloud, network | `type: "ec2"` | resources of that type plus the chain of ancestors above them, marked as context |
314
+ | `config` / `style` | cloud, network | `config: "all"`, `style: "tree"` | how much config to show (`none`, `summary` = first 3 entries, `all`); `nested` boxes, an indented `tree`, or `auto` (nested, falling back to a tree when too wide or deeper than 4 levels) |
315
+ | `flow` / `descriptions` | data_flow | `flow: "Orders pipeline"`, `descriptions: true` | one flow / each stage's description under its name |
316
+
317
+ Selectors combine (each narrows the view). Nodes, boundaries, participants, tables, resources and flows are given by id or exact name, case-insensitive; an unknown or ambiguous one is an error that lists the choices. A partial view says what it leaves out: a box that still has hidden neighbours shows `(+N)` and they are listed below the diagram, and omitted messages are counted.
318
+
319
+ Options: `layout` (`LR` or `TB`, architecture and er), `max_width` (default 120; the renderer switches layout, moves edge labels to a numbered legend, or falls back to a tree, to fit), and `charset` (`unicode` or `ascii` for terminals and agents that cannot show box-drawing characters). The result also carries structured `shown`, `hidden` and `warnings`.
320
+
321
+ `focus: "Auth", hops: 2, direction: "out"`:
322
+
323
+ ```
324
+ ┌─────────────────┐
325
+ ┌►│ Microsoft OAuth │
326
+ │ │ external │
327
+ │ └─────────────────┘
328
+ │
329
+ │
330
+ ┌───────────┐ OAuth 2.0 │ ┌──────────────┐
331
+ │ Auth │─────────────┘ ┌►│ GitHub OAuth │
332
+ │ auth (+1) │── OAuth 2.0 ──┘ │ external │
333
+ │ │───────────────┐ └──────────────┘
334
+ └───────────┘ OAuth 2.0 │
335
+ │
336
+ │ ┌──────────────┐
337
+ └►│ Google OAuth │
338
+ │ external │
339
+ └──────────────┘
340
+
341
+ Partial view: 4 of 12 nodes, 3 of 11 edges shown (focus "Auth", 2 hops out).
342
+ Hidden neighbours:
343
+ Auth: <- API Server
344
+ ```
345
+
346
+ `diagram_type: "sequence", from_message: 13, to_message: 15, participants: ["Web App", "API Server"]`:
347
+
348
+ ```
349
+ Web App API
350
+ │ │
351
+ │ │ ... 13 earlier messages omitted
352
+ │ │ ┏ loop: on each edit (autosave)
353
+ │──────►│ ┃ 13 PATCH /api/diagrams/:id/ops {seq, ops}
354
+ │◄┄┄┄┄┄┄│ ┃ 15 200 { ok, seq }
355
+ │ │ ┗
356
+ │ │ ... 15 later messages omitted
357
+ │ │ ... 1 message with other participants hidden
358
+
359
+ Columns: API = API Server
360
+ ```
361
+
362
+ The ER view draws each table as a box of columns (`PK`, `FK`, `UK`; `?` marks a nullable column) and each relation as a line from the table that holds the foreign key, labelled with the column and `N:1`, `1:1` or `N:M`. Relations come from foreign-key columns and from stored relations, merged. Tables with no relations are packed into a grid. `diagram_type: "er", focus: "orders"`:
363
+
364
+ ```
365
+ ┌─────────────────────────┐
366
+ │ order_items │
367
+ │ (+1) │
368
+ │ PK id uuid │
369
+ │ FK order_id uuid │
370
+ │ FK,UK product_id uuid │
371
+ │ quantity integer │
372
+ └─────────────────────────┘
373
+ │
374
+ │ order_id N:1
375
+ ┌┘
376
+ ▼
377
+ ┌──────────────────────────────┐
378
+ │ orders │
379
+ │ PK id uuid │
380
+ │ FK user_id uuid │
381
+ │ FK billing_address_id uuid │
382
+ │ FK shipping_address_id uuid │
383
+ │ total numeric(10, 2) │
384
+ └──────────────────────────────┘
385
+ │ │ │
386
+ │ │ user_id N:1 │
387
+ [1] │ [2] │ ┌──┘
388
+ ┌────┘ ┌────┘ ▼
389
+ ▼ ▼ ┌────────────────┐
390
+ ┌────────────────┐ │ users │
391
+ │ addresses │ │ (+2) │
392
+ │ PK id uuid │ │ PK id uuid │
393
+ │ line1 text │ │ UK email text │
394
+ │ city text │ │ name? text │
395
+ └────────────────┘ └────────────────┘
396
+
397
+ Legend:
398
+ [1] orders -> addresses: billing_address_id N:1
399
+ [2] orders -> addresses: shipping_address_id N:1
400
+ Partial view: 4 of 10 tables, 4 of 9 relations shown (focus "orders", 1 hop).
401
+ Hidden neighbours:
402
+ users: <- profiles, <- audit.events
403
+ order_items: -> products
404
+ ```
405
+
406
+ Cloud and network are containment hierarchies (a VPC contains subnets), not graphs, so they are drawn as boxes nested inside their parent, or as an indented tree. `diagram_type: "cloud", style: "tree", config: "none"`:
407
+
408
+ ```
409
+ prod-account (aws-account)
410
+ · account_id: 123456789012
411
+ · region: eu-west-1
412
+ ├── main-vpc (vpc)
413
+ │ · cidr: 10.0.0.0/16
414
+ │ ├── public-a (subnet)
415
+ │ │ · cidr: 10.0.1.0/24
416
+ │ │ · az: eu-west-1a
417
+ │ │ ├── web-alb (load-balancer)
418
+ │ │ │ · scheme: internet-facing
419
+ │ │ ├── web-1 (ec2)
420
+ │ │ │ · instance_type: t3.small
421
+ │ │ │ · ami: ami-0abc
422
+ │ │ │ · key_pair: prod
423
+ │ │ │ · +1 more
424
+ │ │ └── web-2 (ec2)
425
+ │ │ · instance_type: t3.small
426
+ │ └── private-a (subnet)
427
+ │ · cidr: 10.0.2.0/24
428
+ │ └── orders-db (rds)
429
+ │ · engine: postgres
430
+ │ · size: db.t3.medium
431
+ └── assets (s3-bucket)
432
+ ```
433
+
434
+ A data flow is drawn as one lane per flow, sources to transforms to sinks: **all sources feed all transforms, and all transforms feed all sinks** (a column with several stages joins the next through a shared bus). The flow's notes sit on the arrows, or in a numbered legend when they are long. `diagram_type: "data_flow", flow: "Orders pipeline", descriptions: true`:
435
+
436
+ ```
437
+ Flow: Orders pipeline
438
+ Sources Transforms Sinks
439
+ ┌────────────────────────────────┐ ┌────────────────────────────┐ ┌──────────────────────┐
440
+ │ Orders API │ raw events │ Deduplicate │ [1] │ Warehouse │
441
+ │ source · postgresql │ ┌──────►│ transform · spark │───┬──►│ sink · snowflake │
442
+ │ Orders written by the checkout │──────┤ │ Drop repeated events by id │ │ └──────────────────────┘
443
+ │ service │ │ └────────────────────────────┘ │
444
+ └────────────────────────────────┘ │ │ ┌──────────────────────┐
445
+ │ │ │ Search index │
446
+ ┌────────────────────────────────┐ │ └──►│ sink · elasticsearch │
447
+ │ Web events │ │ └──────────────────────┘
448
+ │ source · kafka │──────┘
449
+ └────────────────────────────────┘
450
+
451
+ Legend:
452
+ [1] Orders pipeline: transforms -> sinks: cleaned, deduplicated rows ready for analytics and search
453
+ ```