@modudraft/mcp 0.4.3 → 0.5.1

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 +63 -7
  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
@@ -24311,7 +24311,9 @@ var apiEndpointSchema = external_exports.object({
24311
24311
  var dataFlowSchema = external_exports.object({
24312
24312
  id: external_exports.string().min(1),
24313
24313
  name: external_exports.string().default("Untitled flow"),
24314
- order: external_exports.number().int().min(0)
24314
+ order: external_exports.number().int().min(0),
24315
+ sourceToTransformNote: external_exports.string().optional(),
24316
+ transformToSinkNote: external_exports.string().optional()
24315
24317
  });
24316
24318
  var dataFlowStageSchema = external_exports.object({
24317
24319
  id: external_exports.string().min(1),
@@ -24319,6 +24321,7 @@ var dataFlowStageSchema = external_exports.object({
24319
24321
  type: external_exports.enum(["source", "transform", "sink"]),
24320
24322
  tool: external_exports.string().default(""),
24321
24323
  label: external_exports.string().default(""),
24324
+ description: external_exports.string().optional(),
24322
24325
  order: external_exports.number().int().min(0)
24323
24326
  });
24324
24327
 
@@ -25830,21 +25833,69 @@ var ALL_TOOLS = [
25830
25833
  return { ok: true, id: updated.id };
25831
25834
  }
25832
25835
  },
25833
- // ── Data Flow stages ─────────────────────────────────────────────────────
25836
+ // ── Data Flow flows + stages ──────────────────────────────────────────────
25837
+ {
25838
+ name: "list_data_flows",
25839
+ description: "List all named data flows in the Data Flow tab of a diagram.",
25840
+ inputSchema: {
25841
+ type: "object",
25842
+ properties: {
25843
+ diagram_id: { type: "string" }
25844
+ },
25845
+ required: ["diagram_id"]
25846
+ },
25847
+ async handler(args) {
25848
+ const { data } = await fetchDiagram(diagramId(args));
25849
+ const tab = data.diagrams.find((d) => d.type === "data-flow");
25850
+ return tab?.dataFlows ?? [];
25851
+ }
25852
+ },
25853
+ {
25854
+ name: "add_data_flow",
25855
+ description: "Create a new named data flow in the Data Flow tab. Returns the flow id to use when adding stages.",
25856
+ inputSchema: {
25857
+ type: "object",
25858
+ properties: {
25859
+ diagram_id: { type: "string" },
25860
+ name: { type: "string", description: 'Name for the flow (e.g. "Ingestion pipeline", "ETL")' },
25861
+ source_to_transform_note: { type: "string", description: "Optional note shown on the arrow between source and transform columns" },
25862
+ transform_to_sink_note: { type: "string", description: "Optional note shown on the arrow between transform and sink columns" }
25863
+ },
25864
+ required: ["diagram_id", "name"]
25865
+ },
25866
+ async handler(args) {
25867
+ const id = diagramId(args);
25868
+ let flow;
25869
+ await mutateTypedTab(id, "data-flow", (entry) => {
25870
+ const order = (entry.dataFlows ?? []).length;
25871
+ flow = {
25872
+ id: genId(),
25873
+ name: str(args.name, "Untitled flow"),
25874
+ order,
25875
+ ...str(args.source_to_transform_note) ? { sourceToTransformNote: str(args.source_to_transform_note) } : {},
25876
+ ...str(args.transform_to_sink_note) ? { transformToSinkNote: str(args.transform_to_sink_note) } : {}
25877
+ };
25878
+ entry.dataFlows = [...entry.dataFlows ?? [], flow];
25879
+ });
25880
+ return flow;
25881
+ }
25882
+ },
25834
25883
  {
25835
25884
  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.",
25885
+ 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
25886
  inputSchema: {
25838
25887
  type: "object",
25839
25888
  properties: {
25840
25889
  diagram_id: { type: "string" },
25890
+ flow_id: { type: "string", description: "ID of the data flow this stage belongs to (from add_data_flow or list_data_flows)" },
25841
25891
  type: {
25842
25892
  type: "string",
25843
25893
  enum: ["source", "transform", "sink"],
25844
25894
  description: "Stage role: source (ingestion), transform (processing), sink (output/storage)"
25845
25895
  },
25846
25896
  label: { type: "string", description: 'Display label (e.g. "Raw Events", "Filter PII", "DW Load")' },
25847
- tool: { type: "string", description: 'Technology slug (e.g. "kafka", "postgresql", "spark", "dbt", "redis", "s3")' }
25897
+ tool: { type: "string", description: 'Technology slug (e.g. "kafka", "postgresql", "spark", "dbt", "redis", "s3")' },
25898
+ description: { type: "string", description: "Optional explanation of what this stage does, shown on the canvas card" }
25848
25899
  },
25849
25900
  required: ["diagram_id", "type", "label"]
25850
25901
  },
@@ -25852,12 +25903,15 @@ var ALL_TOOLS = [
25852
25903
  const id = diagramId(args);
25853
25904
  let stage;
25854
25905
  await mutateTypedTab(id, "data-flow", (entry) => {
25855
- const order = (entry.dataFlowStages ?? []).length;
25906
+ const flowId = str(args.flow_id) || void 0;
25907
+ const order = (entry.dataFlowStages ?? []).filter((s) => s.flowId === flowId).length;
25856
25908
  stage = {
25857
25909
  id: genId(),
25910
+ ...flowId ? { flowId } : {},
25858
25911
  type: str(args.type, "source"),
25859
25912
  label: str(args.label),
25860
25913
  tool: str(args.tool),
25914
+ ...str(args.description) ? { description: str(args.description) } : {},
25861
25915
  order
25862
25916
  };
25863
25917
  entry.dataFlowStages = [...entry.dataFlowStages ?? [], stage];
@@ -25888,7 +25942,7 @@ var ALL_TOOLS = [
25888
25942
  },
25889
25943
  {
25890
25944
  name: "update_data_flow_stage",
25891
- description: "Update an existing data flow stage's type, tool, and/or label.",
25945
+ description: "Update an existing data flow stage's type, tool, label, and/or description.",
25892
25946
  inputSchema: {
25893
25947
  type: "object",
25894
25948
  properties: {
@@ -25896,7 +25950,8 @@ var ALL_TOOLS = [
25896
25950
  stage_id: { type: "string", description: "ID of the stage to update" },
25897
25951
  type: { type: "string", enum: ["source", "transform", "sink"], description: "New stage role (optional)" },
25898
25952
  tool: { type: "string", description: "New technology slug (optional)" },
25899
- label: { type: "string", description: "New display label (optional)" }
25953
+ label: { type: "string", description: "New display label (optional)" },
25954
+ description: { type: "string", description: "Explanation of what this stage does (optional; pass empty string to clear)" }
25900
25955
  },
25901
25956
  required: ["diagram_id", "stage_id"]
25902
25957
  },
@@ -25910,6 +25965,7 @@ var ALL_TOOLS = [
25910
25965
  if (typeof args.type === "string") stage.type = args.type;
25911
25966
  if (typeof args.tool === "string") stage.tool = args.tool;
25912
25967
  if (typeof args.label === "string") stage.label = args.label;
25968
+ if (typeof args.description === "string") stage.description = args.description || void 0;
25913
25969
  updated = stage;
25914
25970
  });
25915
25971
  return { ok: true, id: updated.id };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modudraft/mcp",
3
- "version": "0.4.3",
3
+ "version": "0.5.1",
4
4
  "description": "MCP server for Modudraft — create and edit system-design diagrams via AI (cloud edition)",
5
5
  "type": "module",
6
6
  "bin": {