@modudraft/mcp 0.4.3 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +31 -0
  2. package/dist/index.js +44 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -104,6 +104,9 @@ Copy the key — you'll only see it once.
104
104
  | `add_sequence_participant` | Register a named participant |
105
105
  | `clear_sequence` | Remove all sequence messages |
106
106
  | `auto_sequence` | Derive sequence messages from the architecture edges |
107
+ | `add_sequence_fragment` | Wrap messages in a loop / alt / opt / par fragment |
108
+ | `update_sequence_fragment` | Change a fragment's kind, condition, or message list |
109
+ | `delete_sequence_fragment` | Remove a fragment |
107
110
 
108
111
  ### DB schema (ER diagram)
109
112
  | Tool | Description |
@@ -121,6 +124,28 @@ Copy the key — you'll only see it once.
121
124
  | `delete_api_endpoint` | Remove an endpoint |
122
125
  | `export_openapi` | Export schema as OpenAPI 3.0 JSON |
123
126
 
127
+ ### Cloud diagram
128
+ | Tool | Description |
129
+ |---|---|
130
+ | `add_cloud_resource` | Add a cloud resource (cluster, VPC, service, etc.) |
131
+ | `update_cloud_resource` | Rename or change the type of a cloud resource |
132
+ | `delete_cloud_resource` | Remove a cloud resource |
133
+
134
+ ### Network diagram
135
+ | Tool | Description |
136
+ |---|---|
137
+ | `add_network_device` | Add a network device (router, switch, firewall, etc.) |
138
+ | `update_network_device` | Rename or change the type of a network device |
139
+ | `delete_network_device` | Remove a network device |
140
+
141
+ ### Data flow diagram
142
+ | Tool | Description |
143
+ |---|---|
144
+ | `add_data_flow_stage` | Add a pipeline stage (source, transform, sink, etc.) |
145
+ | `update_data_flow_stage` | Rename or change the type of a data flow stage |
146
+ | `delete_data_flow_stage` | Remove a data flow stage |
147
+ | `reorder_data_flow_stages` | Set the order of all stages in a data flow diagram |
148
+
124
149
  ### Discovery (static, no API call)
125
150
  | Tool | Description |
126
151
  |---|---|
@@ -140,6 +165,12 @@ Copy the key — you'll only see it once.
140
165
 
141
166
  > "What metadata is missing from the diagram nodes? Fill in the hosts and ports based on our .env file."
142
167
 
168
+ > "Add a data flow diagram showing how events move from our Kafka topics through a Flink transform into the data warehouse."
169
+
170
+ > "Draw the network topology — edge router, core switch, two firewalls, and the DMZ segment."
171
+
172
+ > "Wrap the retry loop in the checkout sequence in an alt fragment with condition 'payment fails'."
173
+
143
174
  ---
144
175
 
145
176
  ## How it works
package/dist/index.js CHANGED
@@ -25830,14 +25830,53 @@ var ALL_TOOLS = [
25830
25830
  return { ok: true, id: updated.id };
25831
25831
  }
25832
25832
  },
25833
- // ── Data Flow stages ─────────────────────────────────────────────────────
25833
+ // ── Data Flow flows + stages ──────────────────────────────────────────────
25834
+ {
25835
+ name: "list_data_flows",
25836
+ description: "List all named data flows in the Data Flow tab of a diagram.",
25837
+ inputSchema: {
25838
+ type: "object",
25839
+ properties: {
25840
+ diagram_id: { type: "string" }
25841
+ },
25842
+ required: ["diagram_id"]
25843
+ },
25844
+ async handler(args) {
25845
+ const { data } = await fetchDiagram(diagramId(args));
25846
+ const tab = data.diagrams.find((d) => d.type === "data-flow");
25847
+ return tab?.dataFlows ?? [];
25848
+ }
25849
+ },
25850
+ {
25851
+ name: "add_data_flow",
25852
+ description: "Create a new named data flow in the Data Flow tab. Returns the flow id to use when adding stages.",
25853
+ inputSchema: {
25854
+ type: "object",
25855
+ properties: {
25856
+ diagram_id: { type: "string" },
25857
+ name: { type: "string", description: 'Name for the flow (e.g. "Ingestion pipeline", "ETL")' }
25858
+ },
25859
+ required: ["diagram_id", "name"]
25860
+ },
25861
+ async handler(args) {
25862
+ const id = diagramId(args);
25863
+ let flow;
25864
+ await mutateTypedTab(id, "data-flow", (entry) => {
25865
+ const order = (entry.dataFlows ?? []).length;
25866
+ flow = { id: genId(), name: str(args.name, "Untitled flow"), order };
25867
+ entry.dataFlows = [...entry.dataFlows ?? [], flow];
25868
+ });
25869
+ return flow;
25870
+ }
25871
+ },
25834
25872
  {
25835
25873
  name: "add_data_flow_stage",
25836
- description: "Add a stage to the Data Flow tab. Stages have a role (source \u2192 transform \u2192 sink) and an optional tool. Stages are ordered by insertion; use reorder_data_flow_stages to rearrange.",
25874
+ description: "Add a stage to a data flow. Stages have a role (source \u2192 transform \u2192 sink) and an optional tool. Pass flow_id to add to a specific flow (use list_data_flows or add_data_flow to get one). Stages are ordered by insertion; use reorder_data_flow_stages to rearrange.",
25837
25875
  inputSchema: {
25838
25876
  type: "object",
25839
25877
  properties: {
25840
25878
  diagram_id: { type: "string" },
25879
+ flow_id: { type: "string", description: "ID of the data flow this stage belongs to (from add_data_flow or list_data_flows)" },
25841
25880
  type: {
25842
25881
  type: "string",
25843
25882
  enum: ["source", "transform", "sink"],
@@ -25852,9 +25891,11 @@ var ALL_TOOLS = [
25852
25891
  const id = diagramId(args);
25853
25892
  let stage;
25854
25893
  await mutateTypedTab(id, "data-flow", (entry) => {
25855
- const order = (entry.dataFlowStages ?? []).length;
25894
+ const flowId = str(args.flow_id) || void 0;
25895
+ const order = (entry.dataFlowStages ?? []).filter((s) => s.flowId === flowId).length;
25856
25896
  stage = {
25857
25897
  id: genId(),
25898
+ ...flowId ? { flowId } : {},
25858
25899
  type: str(args.type, "source"),
25859
25900
  label: str(args.label),
25860
25901
  tool: str(args.tool),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modudraft/mcp",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "description": "MCP server for Modudraft — create and edit system-design diagrams via AI (cloud edition)",
5
5
  "type": "module",
6
6
  "bin": {