@coral-viz/mcp-server 0.2.3

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.
@@ -0,0 +1,393 @@
1
+ /**
2
+ * coral_explain tool
3
+ *
4
+ * Generate natural language explanations of diagrams.
5
+ */
6
+ import { z } from "zod";
7
+ export const explainTool = {
8
+ name: "coral_explain",
9
+ description: "Generate a natural language explanation of a Coral diagram or Graph-IR JSON.",
10
+ inputSchema: {
11
+ type: "object",
12
+ properties: {
13
+ content: {
14
+ type: "string",
15
+ description: "The Coral DSL or Graph-IR JSON to explain",
16
+ },
17
+ level: {
18
+ type: "string",
19
+ enum: ["brief", "standard", "detailed"],
20
+ description: "Level of detail: brief (1 paragraph), standard (sections), detailed (comprehensive)",
21
+ default: "standard",
22
+ },
23
+ focus: {
24
+ type: "string",
25
+ description: "Optional node ID to focus the explanation on",
26
+ },
27
+ },
28
+ required: ["content"],
29
+ },
30
+ };
31
+ const ExplainArgsSchema = z.object({
32
+ content: z.string(),
33
+ level: z.enum(["brief", "standard", "detailed"]).default("standard"),
34
+ focus: z.string().optional(),
35
+ });
36
+ /**
37
+ * Parse Coral DSL or JSON to extract nodes and edges
38
+ */
39
+ function parseDiagram(content) {
40
+ const trimmed = content.trim();
41
+ // Check if JSON
42
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
43
+ try {
44
+ const data = JSON.parse(content);
45
+ return {
46
+ nodes: (data.nodes || []).map((n) => ({
47
+ id: n.id,
48
+ type: n.type || "service",
49
+ label: n.label || n.id,
50
+ description: n.metadata?.description,
51
+ })),
52
+ edges: (data.edges || []).map((e) => ({
53
+ source: e.source,
54
+ target: e.target,
55
+ relation: e.relation,
56
+ label: e.label,
57
+ })),
58
+ };
59
+ }
60
+ catch {
61
+ return { nodes: [], edges: [] };
62
+ }
63
+ }
64
+ // Parse Coral DSL
65
+ const nodes = [];
66
+ const edges = [];
67
+ const lines = content.split("\n");
68
+ for (const line of lines) {
69
+ const trimmed = line.trim();
70
+ // Skip comments
71
+ if (trimmed.startsWith("//") || trimmed === "") {
72
+ continue;
73
+ }
74
+ // Node declaration
75
+ const nodeMatch = trimmed.match(/^(service|database|external_api|actor|group|module)\s+"([^"]+)"/);
76
+ if (nodeMatch) {
77
+ const [, type, label] = nodeMatch;
78
+ const id = label
79
+ .toLowerCase()
80
+ .replace(/[^a-z0-9\s]/g, "")
81
+ .replace(/\s+/g, "_");
82
+ nodes.push({ id, type, label });
83
+ }
84
+ // Edge declaration
85
+ const edgeMatch = trimmed.match(/^(\w+)\s*->\s*(\w+)(?:\s*\[([^\]]+)\])?/);
86
+ if (edgeMatch) {
87
+ const [, source, target, attrs] = edgeMatch;
88
+ let relation;
89
+ let label;
90
+ if (attrs) {
91
+ // Parse relation type or label
92
+ const relationMatch = attrs.match(/^(\w+)/);
93
+ if (relationMatch) {
94
+ relation = relationMatch[1];
95
+ }
96
+ const labelMatch = attrs.match(/label\s*=\s*"([^"]+)"/);
97
+ if (labelMatch) {
98
+ label = labelMatch[1];
99
+ }
100
+ }
101
+ edges.push({ source, target, relation, label });
102
+ }
103
+ }
104
+ return { nodes, edges };
105
+ }
106
+ /**
107
+ * Detect architectural patterns
108
+ */
109
+ function detectPatterns(data) {
110
+ const patterns = [];
111
+ // Count node types
112
+ const typeCounts = new Map();
113
+ for (const node of data.nodes) {
114
+ typeCounts.set(node.type, (typeCounts.get(node.type) || 0) + 1);
115
+ }
116
+ // Check for API Gateway pattern
117
+ const gateway = data.nodes.find((n) => n.label.toLowerCase().includes("gateway") ||
118
+ n.label.toLowerCase().includes("api"));
119
+ if (gateway) {
120
+ const outgoing = data.edges.filter((e) => e.source === gateway.id);
121
+ if (outgoing.length >= 2) {
122
+ patterns.push("API Gateway Pattern");
123
+ }
124
+ }
125
+ // Check for microservices
126
+ const services = data.nodes.filter((n) => n.type === "service");
127
+ if (services.length >= 3) {
128
+ patterns.push("Microservices Architecture");
129
+ }
130
+ // Check for event-driven
131
+ const hasEvents = data.edges.some((e) => e.relation === "event");
132
+ const hasQueue = data.nodes.some((n) => n.label.toLowerCase().includes("queue") ||
133
+ n.label.toLowerCase().includes("kafka") ||
134
+ n.label.toLowerCase().includes("rabbitmq"));
135
+ if (hasEvents || hasQueue) {
136
+ patterns.push("Event-Driven Architecture");
137
+ }
138
+ // Check for 3-tier
139
+ const hasFrontend = data.nodes.some((n) => n.label.toLowerCase().includes("frontend") ||
140
+ n.label.toLowerCase().includes("web") ||
141
+ n.label.toLowerCase().includes("ui"));
142
+ const hasBackend = data.nodes.some((n) => n.label.toLowerCase().includes("backend") ||
143
+ n.label.toLowerCase().includes("api") ||
144
+ n.label.toLowerCase().includes("server"));
145
+ const hasDatabase = data.nodes.some((n) => n.type === "database");
146
+ if (hasFrontend && hasBackend && hasDatabase) {
147
+ patterns.push("3-Tier Architecture");
148
+ }
149
+ return patterns;
150
+ }
151
+ /**
152
+ * Analyze node connectivity
153
+ */
154
+ function analyzeConnectivity(data) {
155
+ const connectivity = new Map();
156
+ for (const node of data.nodes) {
157
+ connectivity.set(node.id, { incoming: 0, outgoing: 0 });
158
+ }
159
+ for (const edge of data.edges) {
160
+ const source = connectivity.get(edge.source);
161
+ const target = connectivity.get(edge.target);
162
+ if (source)
163
+ source.outgoing++;
164
+ if (target)
165
+ target.incoming++;
166
+ }
167
+ return connectivity;
168
+ }
169
+ /**
170
+ * Generate brief explanation
171
+ */
172
+ function generateBrief(data) {
173
+ const patterns = detectPatterns(data);
174
+ const typeCounts = new Map();
175
+ for (const node of data.nodes) {
176
+ typeCounts.set(node.type, (typeCounts.get(node.type) || 0) + 1);
177
+ }
178
+ const typeDesc = [];
179
+ if (typeCounts.get("service")) {
180
+ typeDesc.push(`${typeCounts.get("service")} services`);
181
+ }
182
+ if (typeCounts.get("database")) {
183
+ typeDesc.push(`${typeCounts.get("database")} databases`);
184
+ }
185
+ if (typeCounts.get("external_api")) {
186
+ typeDesc.push(`${typeCounts.get("external_api")} external APIs`);
187
+ }
188
+ let explanation = `This diagram shows `;
189
+ if (patterns.length > 0) {
190
+ explanation += `a ${patterns[0].toLowerCase()} with `;
191
+ }
192
+ explanation += `${data.nodes.length} components`;
193
+ if (typeDesc.length > 0) {
194
+ explanation += ` (${typeDesc.join(", ")})`;
195
+ }
196
+ explanation += `. `;
197
+ // Describe main flow
198
+ if (data.edges.length > 0) {
199
+ const connectivity = analyzeConnectivity(data);
200
+ const entryPoints = data.nodes.filter((n) => {
201
+ const conn = connectivity.get(n.id);
202
+ return conn && conn.incoming === 0 && conn.outgoing > 0;
203
+ });
204
+ if (entryPoints.length > 0) {
205
+ explanation += `The system receives requests through ${entryPoints.map((n) => n.label).join(", ")}. `;
206
+ }
207
+ }
208
+ return explanation;
209
+ }
210
+ /**
211
+ * Generate standard explanation
212
+ */
213
+ function generateStandard(data) {
214
+ const lines = [];
215
+ const patterns = detectPatterns(data);
216
+ lines.push("# Architecture Overview");
217
+ lines.push("");
218
+ // Summary
219
+ lines.push(generateBrief(data));
220
+ lines.push("");
221
+ // Patterns
222
+ if (patterns.length > 0) {
223
+ lines.push(`**Detected Patterns**: ${patterns.join(", ")}`);
224
+ lines.push("");
225
+ }
226
+ // Components by type
227
+ lines.push("## Components");
228
+ lines.push("");
229
+ const byType = new Map();
230
+ for (const node of data.nodes) {
231
+ const existing = byType.get(node.type) || [];
232
+ existing.push(node);
233
+ byType.set(node.type, existing);
234
+ }
235
+ for (const [type, nodes] of byType) {
236
+ const typeName = type.replace("_", " ").charAt(0).toUpperCase() + type.slice(1).replace("_", " ");
237
+ lines.push(`### ${typeName}s (${nodes.length})`);
238
+ for (const node of nodes) {
239
+ lines.push(`- **${node.label}**${node.description ? `: ${node.description}` : ""}`);
240
+ }
241
+ lines.push("");
242
+ }
243
+ // Connections
244
+ if (data.edges.length > 0) {
245
+ lines.push("## Connections");
246
+ lines.push("");
247
+ const connectivity = analyzeConnectivity(data);
248
+ for (const node of data.nodes) {
249
+ const outgoing = data.edges.filter((e) => e.source === node.id);
250
+ if (outgoing.length > 0) {
251
+ lines.push(`### ${node.label}`);
252
+ for (const edge of outgoing) {
253
+ const target = data.nodes.find((n) => n.id === edge.target);
254
+ const targetLabel = target?.label || edge.target;
255
+ const relation = edge.relation || "connects to";
256
+ lines.push(`- ${relation.replace("_", " ")} → ${targetLabel}`);
257
+ }
258
+ lines.push("");
259
+ }
260
+ }
261
+ }
262
+ // Observations
263
+ lines.push("## Observations");
264
+ lines.push("");
265
+ const connectivity = analyzeConnectivity(data);
266
+ // Find bottlenecks
267
+ for (const node of data.nodes) {
268
+ const conn = connectivity.get(node.id);
269
+ if (conn && conn.incoming >= 3) {
270
+ lines.push(`- **${node.label}** has high incoming traffic (${conn.incoming} connections) - potential bottleneck`);
271
+ }
272
+ }
273
+ // Find orphans
274
+ for (const node of data.nodes) {
275
+ const conn = connectivity.get(node.id);
276
+ if (conn && conn.incoming === 0 && conn.outgoing === 0) {
277
+ lines.push(`- **${node.label}** is disconnected from the rest of the system`);
278
+ }
279
+ }
280
+ // Shared databases
281
+ const databases = data.nodes.filter((n) => n.type === "database");
282
+ for (const db of databases) {
283
+ const incoming = data.edges.filter((e) => e.target === db.id);
284
+ if (incoming.length >= 2) {
285
+ lines.push(`- **${db.label}** is shared by ${incoming.length} services (consider if coupling is intentional)`);
286
+ }
287
+ }
288
+ return lines.join("\n");
289
+ }
290
+ /**
291
+ * Generate focused explanation
292
+ */
293
+ function generateFocused(data, nodeId) {
294
+ const node = data.nodes.find((n) => n.id === nodeId);
295
+ if (!node) {
296
+ return `Node '${nodeId}' not found in diagram.`;
297
+ }
298
+ const lines = [];
299
+ lines.push(`# ${node.label} Analysis`);
300
+ lines.push("");
301
+ lines.push("## Role");
302
+ lines.push(`${node.type.charAt(0).toUpperCase() + node.type.slice(1).replace("_", " ")} component.`);
303
+ if (node.description) {
304
+ lines.push(node.description);
305
+ }
306
+ lines.push("");
307
+ // Incoming connections
308
+ const incoming = data.edges.filter((e) => e.target === nodeId);
309
+ lines.push("## Incoming Connections");
310
+ if (incoming.length === 0) {
311
+ lines.push("No incoming connections (entry point or isolated node)");
312
+ }
313
+ else {
314
+ for (const edge of incoming) {
315
+ const source = data.nodes.find((n) => n.id === edge.source);
316
+ const sourceLabel = source?.label || edge.source;
317
+ const relation = edge.relation || "connects from";
318
+ lines.push(`- ${sourceLabel} (${relation.replace("_", " ")})`);
319
+ }
320
+ }
321
+ lines.push("");
322
+ // Outgoing connections
323
+ const outgoing = data.edges.filter((e) => e.source === nodeId);
324
+ lines.push("## Outgoing Connections");
325
+ if (outgoing.length === 0) {
326
+ lines.push("No outgoing connections (terminal node or isolated node)");
327
+ }
328
+ else {
329
+ for (const edge of outgoing) {
330
+ const target = data.nodes.find((n) => n.id === edge.target);
331
+ const targetLabel = target?.label || edge.target;
332
+ const relation = edge.relation || "connects to";
333
+ lines.push(`- ${targetLabel} (${relation.replace("_", " ")})`);
334
+ }
335
+ }
336
+ lines.push("");
337
+ // Observations
338
+ lines.push("## Observations");
339
+ if (incoming.length >= 3) {
340
+ lines.push(`- High incoming traffic (${incoming.length} connections) - may be a bottleneck`);
341
+ }
342
+ if (outgoing.length >= 3) {
343
+ lines.push(`- High coupling (${outgoing.length} outgoing connections)`);
344
+ }
345
+ if (incoming.length === 0 && outgoing.length > 0) {
346
+ lines.push("- This appears to be an entry point to the system");
347
+ }
348
+ if (outgoing.length === 0 && incoming.length > 0) {
349
+ lines.push("- This appears to be a terminal node (data sink or output)");
350
+ }
351
+ return lines.join("\n");
352
+ }
353
+ export async function handleExplain(args) {
354
+ const parsed = ExplainArgsSchema.parse(args);
355
+ const { content, level, focus } = parsed;
356
+ const data = parseDiagram(content);
357
+ if (data.nodes.length === 0) {
358
+ return {
359
+ content: [
360
+ {
361
+ type: "text",
362
+ text: "Could not parse any nodes from the diagram. Please ensure it's valid Coral DSL or Graph-IR JSON.",
363
+ },
364
+ ],
365
+ };
366
+ }
367
+ let explanation;
368
+ if (focus) {
369
+ explanation = generateFocused(data, focus);
370
+ }
371
+ else {
372
+ switch (level) {
373
+ case "brief":
374
+ explanation = generateBrief(data);
375
+ break;
376
+ case "detailed":
377
+ // For now, detailed is same as standard with more sections
378
+ explanation = generateStandard(data);
379
+ break;
380
+ default:
381
+ explanation = generateStandard(data);
382
+ }
383
+ }
384
+ return {
385
+ content: [
386
+ {
387
+ type: "text",
388
+ text: explanation,
389
+ },
390
+ ],
391
+ };
392
+ }
393
+ //# sourceMappingURL=explain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explain.js","sourceRoot":"","sources":["../../src/tools/explain.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,8EAA8E;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;aACzD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC;gBACvC,WAAW,EAAE,qFAAqF;gBAClG,OAAO,EAAE,UAAU;aACpB;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8CAA8C;aAC5D;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACpE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAqBH;;GAEG;A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AAI,WAAmB,CAAC;IAExB,IAAI,KAAK,EAAE,CAAC;QACV,WAAW,GAAG,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,OAAO;gBACV,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;gBAClC,MAAM;YACR,KAAK,UAAU;gBACb,2DAA2D;gBAC3D,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBACrC,MAAM;YACR;gBACE,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,WAAW;aAClB;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * coral_generate tool
3
+ *
4
+ * Generate Coral DSL or Graph-IR from natural language descriptions.
5
+ */
6
+ export declare const generateTool: {
7
+ name: string;
8
+ description: string;
9
+ inputSchema: {
10
+ type: "object";
11
+ properties: {
12
+ description: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ format: {
17
+ type: string;
18
+ enum: string[];
19
+ description: string;
20
+ default: string;
21
+ };
22
+ style: {
23
+ type: string;
24
+ enum: string[];
25
+ description: string;
26
+ default: string;
27
+ };
28
+ };
29
+ required: string[];
30
+ };
31
+ };
32
+ export declare function handleGenerate(args: unknown): Promise<{
33
+ content: {
34
+ type: string;
35
+ text: string;
36
+ }[];
37
+ }>;
38
+ //# sourceMappingURL=generate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/tools/generate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxB,CAAC;AAmOF,wBAAsB,cAAc,CAAC,IAAI,EAAE,OAAO;;;;;GA0BjD"}