@endiagram/mcp 0.3.3 → 0.3.5

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.
Files changed (3) hide show
  1. package/README.md +11 -9
  2. package/package.json +2 -2
  3. package/tools.json +13 -13
package/README.md CHANGED
@@ -76,15 +76,17 @@ smithery mcp add dushyant30suthar/endiagram
76
76
 
77
77
  ## Tools
78
78
 
79
- | Tool | Description |
80
- |------|-------------|
81
- | `structure` | Topology, bridges, bottlenecks, parallelism, critical path, dominator tree, subsystems |
82
- | `invariant` | Conservation laws, deadlock detection, boundedness, structural complexity |
83
- | `live` | Liveness analysis can resources drain permanently? Can queues overflow? |
84
- | `reachable` | Path tracing between any two points distance, intermediaries, defense coverage |
85
- | `equivalent` | Compare two systems or simulate a change what breaks, what shifts |
86
- | `compose` | Extract or merge subsystems interface boundaries, shared resources |
87
- | `render` | SVG diagram of the system |
79
+ Six questions about any system, plus a render tool. Every tool takes `source` (EN code or `.en`/`.txt` file path).
80
+
81
+ | Tool | What it answers | Levers |
82
+ |------|-----------------|--------|
83
+ | `structure` | What is this system? Shape, stages, bridges, cycles, critical path, dominator tree, min-cuts, subsystems, actors, locations. | `detect_findings=true` flags risks (unguarded-sink, single-cut-path, multi-cut-path); `node=X` returns per-node centrality (betweenness, closeness, eigenvector). |
84
+ | `invariant` | What's always true? Conservation laws, T-invariants (sustainable cycles), depletable sets, deficiency, reversibility. | `rules` (one per line) checks custom claims. Four supported shapes: `no bridge that is also hub` · `every path from X to Y passes through at least one of [A,B,C]` (precedence) · `no node with centrality above N` · `removing any single node disconnects at most N others`. |
85
+ | `live` | Can it deadlock? Can entities overflow? Siphons, traps, unbounded cycles, structural liveness and boundedness. | — |
86
+ | `reachable` | Can X reach Y? Path, distance, boundary crossings. `from`/`to` accept entity or action names. | `defense_nodes=a,b,c` checks whether guards cover every path. |
87
+ | `equivalent` | Are two systems the same, or what changes if I change this one? | Compare mode (`source_a`+`source_b`): edit distance + spectral cospectrality. Evolve mode (`source`+`patch`): plain EN adds; `- name` removes; same-name replaces. |
88
+ | `compose` | How do parts combine (merge) or how does a part stand alone (extract)? | Merge: `source_a`+`source_b`+`links` (`a.entity=b.entity` per line). Extract: `source`+`subsystem` (names come from `structure.subsystems`). |
89
+ | `render` | SVG or PNG diagram. Only call when the user asks to visualize. | Themes: `Blueprint`, `Swiss`, `Bauhaus`, `Brutalist` (each ± `isDark`) or seeded `Nord`, `Catppuccin`. `structure_layers` bitmask (1=subsystems, 2=pipelines, 4=cycles, 8=forks, 16=joins, 32=hubs, 64=deadlock, 128=overflow). `color=#RRGGBB` for a custom palette. |
88
90
 
89
91
  ## EN Syntax
90
92
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@endiagram/mcp",
3
- "version": "0.3.3",
4
- "description": "MCP server for EN Diagram — deterministic structural analysis backed by named theorems",
3
+ "version": "0.3.5",
4
+ "description": "MCP server for EN Diagram — six questions about any system (structure, invariants, liveness, reachability, equivalence, composition) answered with graph theory. Plus a render tool. Pure math, no AI inside the computation.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
package/tools.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
- "instructions": "EN Diagram — structural verification for concurrent systems. Pure math, no AI.\n\n## Syntax\nOne statement per line:\n actor do: action needs: input1, input2 yields: output1, output2 at: context\n\n- All five parts required.\n- Names span words; whitespace preserved. Quote only if name contains `,`, `:`, or `#`.\n- Shared names = connections: one action's `yields:` matching another's `needs:` wires them automatically. String equality is the link.\n- Multi-actor: `a, b do: action needs: X yields: Y` = one joint action. Identical statements merge.\n- `#` starts a comment.\n\n## Tools (six questions)\n1. structure — what is this system?\n2. invariant — what's always true?\n3. live — can it deadlock or overflow?\n4. reachable — can X reach Y?\n5. equivalent — are two systems the same?\n6. compose — how do parts combine?\n\n## How to use them\nEvery tool output contains node names, values, and structural properties that can be fed directly into other tools. Read the output. Find the surprising node, the unexpected value, the structural anomaly. Then pick the tool that investigates THAT specific finding.\n\nDo not stop at one tool call. The first call reveals the structure — the real insight comes from the second, third, fourth call that digs into what the first one found.\n\nSpeak in the user's domain, not in graph theory. Only call render when the user explicitly asks to visualize.",
2
+ "instructions": "EN Diagram — structural verification for concurrent systems. Pure math, no AI.\n\n## Syntax\nOne statement per line:\n actor do: action needs: input1, input2 yields: output1, output2 at: context\n\n- All five parts required.\n- Names span words; whitespace preserved. Quote only if name contains `,`, `:`, or `#`.\n- Shared names = connections: one action's `yields:` matching another's `needs:` wires them automatically. String equality is the link.\n- Multi-actor: `a, b do: action needs: X yields: Y` = one joint action. Identical statements merge.\n- `#` starts a comment.\n\n## Tools (six questions + levers)\n1. structure — what is this system? detect_findings=true flags unguarded-sink, single-cut-path, multi-cut-path. node=X returns per-node centrality.\n2. invariant — what's always true? rules (one per line) check custom claims; 4 shapes: `no bridge that is also hub` | `every path from X to Y passes through at least one of [A,B,C]` (precedence) | `no node with centrality above N` | `removing any single node disconnects at most N others`.\n3. live — can it deadlock or overflow?\n4. reachable — can X reach Y? defense_nodes=a,b,c checks guard coverage.\n5. equivalent — are two systems the same? compare: source_a+source_b. evolve: source+patch (plain EN adds, `- name` removes, same-name replaces).\n6. compose — how do parts combine? merge: source_a+source_b+links (`a.entity=b.entity` per line). extract: source+subsystem (names from structure.subsystems).\n\n## How to use them\nEvery tool output contains node names, values, and structural properties that can be fed directly into other tools. Read the output. Find the surprising node, the unexpected value, the structural anomaly. Then pick the tool that investigates THAT specific finding.\n\nDo not stop at one tool call. The first call reveals the structure — the real insight comes from the second, third, fourth call that digs into what the first one found.\n\nSpeak in the user's domain, not in graph theory. Only call render when the user explicitly asks to visualize.",
3
3
  "tools": [
4
4
  {
5
5
  "name": "structure",
6
- "description": "What is this system? Complete structural overview: shape (topology), stages with roles, bridge nodes, cycles, parallelism, critical path, dominator tree, min-cuts, subsystems, interface nodes. Includes actors (who does what, workload entropy) and locations (where work happens, boundary crossings). Optional: pass node for per-node centrality, detect_findings for structural pattern detection. See the server instructions for EN language syntax (spaces in names, # comments, shared actions).",
6
+ "description": "What is this system? Returns shape (Pipeline, Fork-Join, DAG, Star, Cycle, Tree, Complete, etc.), stages with roles, bridge nodes, cycles, parallelism, critical path, dominator tree, min-cuts, subsystems, interface nodes, actors (who does what, workload entropy), locations (where work happens, boundary crossings). Levers: node=X returns per-node centrality (betweenness, closeness, eigenvector) for a specific node. detect_findings=true flags named structural risks unguarded-sink (sinks reachable via only pipeline actions, no JOIN/HUB gating), single-cut-path (source-sink pairs with only one vertex-disjoint path), multi-cut-path (paths with redundant defense, min-cut > 1). See server instructions for EN language syntax.",
7
7
  "parameters": [
8
8
  {"name": "source", "type": "string", "description": "EN source code, or path to .en/.txt file", "required": true},
9
- {"name": "node", "type": "string", "description": "Node name for centrality query", "required": false},
10
- {"name": "detect_findings", "type": "string", "description": "Set to 'true' to detect structural findings", "required": false}
9
+ {"name": "node", "type": "string", "description": "Node name. When provided, returns per-node centrality (betweenness, closeness, eigenvector) for this specific node instead of the overview.", "required": false},
10
+ {"name": "detect_findings", "type": "string", "description": "Set to 'true' to flag named structural findings. Possible values: unguarded-sink, single-cut-path, multi-cut-path.", "required": false}
11
11
  ]
12
12
  },
13
13
  {
14
14
  "name": "invariant",
15
- "description": "What's always true? conservationLaws are weighted entity sums constant across all executions. sustainableCycles are action sequences that return the system to its starting state (T-invariants). depletableSets are entity groups where simultaneous depletion is irreversible. behavioral.deficiency 0 means structure fully determines dynamics. behavioral.isReversible and behavioral.hasUniqueEquilibrium describe convergence properties. See the server instructions for EN language syntax.",
15
+ "description": "What's always true — automatic findings and on-demand checks. Automatic outputs: conservationLaws (weighted entity sums constant across executions), sustainableCycles (T-invariants action sequences returning to start state), depletableSets (entity groups whose simultaneous depletion is irreversible), behavioral.deficiency (0 means structure fully determines dynamics), behavioral.isReversible, behavioral.hasUniqueEquilibrium. On-demand via `rules`: encode domain-specific claims and verify them against the graph — this is how to check things the topology alone can't see (precedence, coverage, centrality bounds, resilience). See the rules parameter for supported sentence shapes.",
16
16
  "parameters": [
17
17
  {"name": "source", "type": "string", "description": "EN source code, or path to .en/.txt file", "required": true},
18
- {"name": "rules", "type": "string", "description": "Structural rules to check, one per line", "required": false}
18
+ {"name": "rules", "type": "string", "description": "Custom structural rules, one per line. Four supported sentence shapes (regex-matched): (1) `no bridge that is also hub` — flags nodes that are both a bridge and a hub. (2) `every path from X to Y passes through at least one of [A, B, C]` — encodes precedence/coverage; use to check `A must happen before Y produces Z` by rewriting as `every path from Z's input to Z passes through [A]`. (3) `no node with centrality above 0.5` — flags over-central nodes (replace 0.5 with any threshold). (4) `removing any single node disconnects at most N others` — connectivity robustness check. Unrecognized rules return satisfied:false with an explanation listing these shapes.", "required": false}
19
19
  ]
20
20
  },
21
21
  {
@@ -27,7 +27,7 @@
27
27
  },
28
28
  {
29
29
  "name": "reachable",
30
- "description": "Can X reach Y? Follows directed data flow first; falls back to undirected. Path shows each step with actor and location. locationCrossings counts boundary transitions. defense_nodes checks if guards cover all paths. coverage.fullCoverage false means unguarded routes exist. See the server instructions for EN language syntax.",
30
+ "description": "Can X reach Y? Follows directed data flow first; falls back to undirected. `from` and `to` accept entity names or action names (resolved against the program). Path shows each step with actor and location. locationCrossings counts boundary transitions. defense_nodes checks if guards cover all paths; coverage.fullCoverage=false means unguarded routes exist. See the server instructions for EN language syntax.",
31
31
  "parameters": [
32
32
  {"name": "source", "type": "string", "description": "EN source code", "required": true},
33
33
  {"name": "from", "type": "string", "description": "Starting node name", "required": true},
@@ -37,23 +37,23 @@
37
37
  },
38
38
  {
39
39
  "name": "equivalent",
40
- "description": "Are two systems the same? Compare mode (source_a + source_b): shows structural differences, edit distance, and spectral equivalence isCospectral true means identical structure despite different names. Evolve mode (source + patch): dry-run a change, shows diff plus new/lost bridge nodes. Prefix action name with - in patch to remove it. See the server instructions for EN language syntax.",
40
+ "description": "Are two systems the same, or what changes if I change this one? Compare mode (source_a + source_b): structural differences, edit distance, spectral equivalence. isCospectral=true means identical graph structure up to relabeling — topologically the same despite different names, actors, or locations. Evolve mode (source + patch): dry-run a change, shows diff plus new/lost bridge nodes. Patch has three directive types — plain EN statement adds an action; a line starting with `-` (and not containing `do:`) removes the named action; a statement whose action name matches an existing one replaces the original. See the server instructions for EN language syntax.",
41
41
  "parameters": [
42
42
  {"name": "source_a", "type": "string", "description": "EN source code or path to .en/.txt file for the first system", "required": false},
43
43
  {"name": "source_b", "type": "string", "description": "EN source code or path to .en/.txt file for the second system", "required": false},
44
44
  {"name": "source", "type": "string", "description": "EN source code for evolve mode", "required": false},
45
- {"name": "patch", "type": "string", "description": "EN patch for evolve mode", "required": false}
45
+ {"name": "patch", "type": "string", "description": "EN patch for evolve mode. Three directive types: plain EN statement (`actor do: X needs: Y yields: Z at: W`) adds action X; a line starting with `-` (and not containing `do:`) removes the named action; a new statement with an existing action name replaces the original. Multiple directives allowed, one per line.", "required": false}
46
46
  ]
47
47
  },
48
48
  {
49
49
  "name": "compose",
50
- "description": "How do parts combine? Merge mode (source_a + source_b + links): merge two systems by linking shared entities. Extract mode (source + subsystem): extract a subsystem as standalone EN with boundary inputs/outputs, actors, and locations. See the server instructions for EN language syntax.",
50
+ "description": "How do parts combine, or how does a part stand alone? Merge mode (source_a + source_b + links): declare which entities in A are the same as entities in B; the combined graph is wired via string-equality of shared names. Extract mode (source + subsystem): pull a named subsystem out as standalone EN with boundary inputs/outputs, actors, and locations. Valid subsystem names come from structure's `subsystems` field — call structure on the source first to discover them. See the server instructions for EN language syntax.",
51
51
  "parameters": [
52
52
  {"name": "source_a", "type": "string", "description": "EN source code or path to .en/.txt file for the first system", "required": false},
53
53
  {"name": "source_b", "type": "string", "description": "EN source code or path to .en/.txt file for the second system", "required": false},
54
- {"name": "links", "type": "string", "description": "Entity links e.g. 'a.node1=b.node2'", "required": false},
54
+ {"name": "links", "type": "string", "description": "Entity identifications, one per line. Format: `a.<entity name>=b.<entity name>` (A's entity is the same as B's entity). `#` starts a comment. Example: `a.user session=b.authenticated session`.", "required": false},
55
55
  {"name": "source", "type": "string", "description": "EN source code for extract mode", "required": false},
56
- {"name": "subsystem", "type": "string", "description": "Subsystem name for extract mode", "required": false}
56
+ {"name": "subsystem", "type": "string", "description": "Subsystem name to extract. Valid names come from structure's `subsystems` field — call structure on the source first to discover them.", "required": false}
57
57
  ]
58
58
  },
59
59
  {
@@ -61,7 +61,7 @@
61
61
  "description": "SVG or PNG diagram. Only call when user explicitly asks to visualize. The rendered image is delivered to the user, not injected into the model's context. See the server instructions for EN language syntax.",
62
62
  "parameters": [
63
63
  {"name": "source", "type": "string", "description": "EN source code, or path to .en/.txt file", "required": true},
64
- {"name": "theme", "type": "string", "description": "Color theme: named preset (Blueprint, Swiss, etc.) or dark/light", "required": false},
64
+ {"name": "theme", "type": "string", "description": "Color theme. Named presets (curated, each with light + dark variants; pair with isDark): Blueprint (architectural drafting paper), Swiss (International Typographic — black/white with red accent), Bauhaus (primary-color geometric), Brutalist (high-contrast stark). Seed-derived (auto-generated palettes from themes.json): Nord, Catppuccin, etc. Or pass 'dark'/'light' for the default theme in that mode. Overridden by `color` if provided.", "required": false},
65
65
  {"name": "isDark", "type": "string", "description": "true or false. Selects the dark or light variant of a named preset. If omitted, defaults to dark unless theme=light.", "required": false},
66
66
  {"name": "type", "type": "string", "description": "Output format: png (default) or svg. PNG is rasterized server-side via Batik.", "required": false},
67
67
  {"name": "quality", "type": "string", "description": "Output quality: small, mid, or max", "required": false},