@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.
- package/LICENSE +4 -0
- package/README.md +17 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +87 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/convert.d.ts +59 -0
- package/dist/tools/convert.d.ts.map +1 -0
- package/dist/tools/convert.js +152 -0
- package/dist/tools/convert.js.map +1 -0
- package/dist/tools/explain.d.ts +36 -0
- package/dist/tools/explain.d.ts.map +1 -0
- package/dist/tools/explain.js +393 -0
- package/dist/tools/explain.js.map +1 -0
- package/dist/tools/generate.d.ts +38 -0
- package/dist/tools/generate.d.ts.map +1 -0
- package/dist/tools/generate.js +242 -0
- package/dist/tools/generate.js.map +1 -0
- package/dist/tools/layout.d.ts +97 -0
- package/dist/tools/layout.d.ts.map +1 -0
- package/dist/tools/layout.js +142 -0
- package/dist/tools/layout.js.map +1 -0
- package/dist/tools/render.d.ts +58 -0
- package/dist/tools/render.d.ts.map +1 -0
- package/dist/tools/render.js +150 -0
- package/dist/tools/render.js.map +1 -0
- package/dist/tools/validate.d.ts +27 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +55 -0
- package/dist/tools/validate.js.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @coral-viz/mcp-server 0.2.3
|
|
2
|
+
|
|
3
|
+
General-purpose Coral diagram tools over MCP stdio:
|
|
4
|
+
|
|
5
|
+
- `coral_generate` — heuristic description-to-diagram generation
|
|
6
|
+
- `coral_validate` — shared Coral parser and GraphIR validation
|
|
7
|
+
- `coral_convert` — Coral/Mermaid/DOT/PlantUML import with structured loss diagnostics and strict mode
|
|
8
|
+
- `coral_layout` — recursive ELK geometry with absolute nested-node output
|
|
9
|
+
- `coral_render` — deterministic SVG or standalone HTML; supplied complete positions are preserved
|
|
10
|
+
- `coral_explain` — graph summary
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm run build -w @coral-viz/mcp-server
|
|
14
|
+
node packages/mcp-server/dist/index.js
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The server reports 0.2.3. Codebase analysis is not provided; Schooner owns that workflow.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Coral MCP Server
|
|
4
|
+
*
|
|
5
|
+
* Provides tools for diagram generation, validation, and conversion
|
|
6
|
+
* via the Model Context Protocol.
|
|
7
|
+
*/
|
|
8
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
11
|
+
import { generateTool, handleGenerate } from "./tools/generate.js";
|
|
12
|
+
import { validateTool, handleValidate } from "./tools/validate.js";
|
|
13
|
+
import { convertTool, handleConvert } from "./tools/convert.js";
|
|
14
|
+
import { explainTool, handleExplain } from "./tools/explain.js";
|
|
15
|
+
import { layoutTool, handleLayout } from "./tools/layout.js";
|
|
16
|
+
import { renderTool, handleRender } from "./tools/render.js";
|
|
17
|
+
const server = new Server({
|
|
18
|
+
name: "coral-mcp-server",
|
|
19
|
+
version: "0.2.3",
|
|
20
|
+
}, {
|
|
21
|
+
capabilities: {
|
|
22
|
+
tools: {},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
// List available tools
|
|
26
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
27
|
+
return {
|
|
28
|
+
tools: [
|
|
29
|
+
generateTool,
|
|
30
|
+
validateTool,
|
|
31
|
+
convertTool,
|
|
32
|
+
layoutTool,
|
|
33
|
+
renderTool,
|
|
34
|
+
explainTool,
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
// Handle tool calls
|
|
39
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
40
|
+
const { name, arguments: args } = request.params;
|
|
41
|
+
try {
|
|
42
|
+
switch (name) {
|
|
43
|
+
case "coral_generate":
|
|
44
|
+
return await handleGenerate(args);
|
|
45
|
+
case "coral_validate":
|
|
46
|
+
return await handleValidate(args);
|
|
47
|
+
case "coral_convert":
|
|
48
|
+
return await handleConvert(args);
|
|
49
|
+
case "coral_explain":
|
|
50
|
+
return await handleExplain(args);
|
|
51
|
+
case "coral_layout":
|
|
52
|
+
return await handleLayout(args);
|
|
53
|
+
case "coral_render":
|
|
54
|
+
return await handleRender(args);
|
|
55
|
+
default:
|
|
56
|
+
return {
|
|
57
|
+
content: [
|
|
58
|
+
{
|
|
59
|
+
type: "text",
|
|
60
|
+
text: `Unknown tool: ${name}`,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
isError: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
return {
|
|
70
|
+
content: [
|
|
71
|
+
{
|
|
72
|
+
type: "text",
|
|
73
|
+
text: `Error: ${message}`,
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
isError: true,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
// Start the server
|
|
81
|
+
async function main() {
|
|
82
|
+
const transport = new StdioServerTransport();
|
|
83
|
+
await server.connect(transport);
|
|
84
|
+
console.error("Coral MCP Server running on stdio");
|
|
85
|
+
}
|
|
86
|
+
main().catch(console.error);
|
|
87
|
+
//# sourceM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C,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* coral_convert tool
|
|
3
|
+
*
|
|
4
|
+
* Convert between diagram formats (Mermaid, DOT, PlantUML, Coral).
|
|
5
|
+
*/
|
|
6
|
+
import { type Diagnostic } from "@coral-viz/language";
|
|
7
|
+
export declare const convertTool: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object";
|
|
12
|
+
properties: {
|
|
13
|
+
content: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
from: {
|
|
18
|
+
type: string;
|
|
19
|
+
enum: string[];
|
|
20
|
+
description: string;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
to: {
|
|
24
|
+
type: string;
|
|
25
|
+
enum: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
strict: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
required: string[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Detect the source format.
|
|
40
|
+
*
|
|
41
|
+
* One implementation, shared with the rest of the server, rather than the
|
|
42
|
+
* private copy this tool used to keep.
|
|
43
|
+
*/
|
|
44
|
+
export declare function detectFormat(source: string): "mermaid" | "dot" | "plantuml" | "coral";
|
|
45
|
+
export declare function handleConvert(args: unknown): Promise<{
|
|
46
|
+
content: {
|
|
47
|
+
type: string;
|
|
48
|
+
text: string;
|
|
49
|
+
}[];
|
|
50
|
+
structuredContent: {
|
|
51
|
+
from: "mermaid" | "dot" | "plantuml" | "coral";
|
|
52
|
+
to: "json" | "coral";
|
|
53
|
+
nodeCount: number;
|
|
54
|
+
edgeCount: number;
|
|
55
|
+
diagnostics: Diagnostic[];
|
|
56
|
+
};
|
|
57
|
+
isError: boolean;
|
|
58
|
+
}>;
|
|
59
|
+
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/tools/convert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAOL,KAAK,UAAU,EAEhB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCvB,CAAC;AAUF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,OAAO,CAUrF;AA4BD,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO;;;;;;;;;;;;;GAsEhD"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* coral_convert tool
|
|
3
|
+
*
|
|
4
|
+
* Convert between diagram formats (Mermaid, DOT, PlantUML, Coral).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { parse, parseMermaid, parseDot, parsePlantUml, printWithDiagnostics, } from "@coral-viz/language";
|
|
8
|
+
export const convertTool = {
|
|
9
|
+
name: "coral_convert",
|
|
10
|
+
description: "Convert diagrams between formats. Supports Mermaid, Graphviz DOT, PlantUML to Coral, and Coral to other formats.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
content: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "The diagram content to convert",
|
|
17
|
+
},
|
|
18
|
+
from: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: ["mermaid", "dot", "plantuml", "coral", "auto"],
|
|
21
|
+
description: "Source format (use 'auto' to detect)",
|
|
22
|
+
default: "auto",
|
|
23
|
+
},
|
|
24
|
+
to: {
|
|
25
|
+
type: "string",
|
|
26
|
+
enum: ["coral", "json"],
|
|
27
|
+
description: "Target format",
|
|
28
|
+
default: "coral",
|
|
29
|
+
},
|
|
30
|
+
strict: {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
description: "Fail the conversion when anything is lost, rather than reporting it and continuing",
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: ["content"],
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const ConvertArgsSchema = z.object({
|
|
40
|
+
content: z.string(),
|
|
41
|
+
from: z.enum(["mermaid", "dot", "plantuml", "coral", "auto"]).default("auto"),
|
|
42
|
+
to: z.enum(["coral", "json"]).default("coral"),
|
|
43
|
+
strict: z.boolean().default(false),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Detect the source format.
|
|
47
|
+
*
|
|
48
|
+
* One implementation, shared with the rest of the server, rather than the
|
|
49
|
+
* private copy this tool used to keep.
|
|
50
|
+
*/
|
|
51
|
+
export function detectFormat(source) {
|
|
52
|
+
const trimmed = source.trim();
|
|
53
|
+
if (/^@start/i.test(trimmed))
|
|
54
|
+
return "plantuml";
|
|
55
|
+
// Mermaid is checked first: `graph TD` also matches a naive DOT pattern.
|
|
56
|
+
if (/^(flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|timeline|block-beta|packet-beta|kanban|architecture-beta)\b/i.test(trimmed)) {
|
|
57
|
+
return "mermaid";
|
|
58
|
+
}
|
|
59
|
+
if (/^graph\s+(TB|TD|BT|RL|LR)\b/i.test(trimmed))
|
|
60
|
+
return "mermaid";
|
|
61
|
+
if (/^(strict\s+)?(di)?graph\b[^{]*\{/i.test(trimmed))
|
|
62
|
+
return "dot";
|
|
63
|
+
return "coral";
|
|
64
|
+
}
|
|
65
|
+
function parseAs(format, content) {
|
|
66
|
+
switch (format) {
|
|
67
|
+
case "mermaid":
|
|
68
|
+
return parseMermaid(content);
|
|
69
|
+
case "dot":
|
|
70
|
+
return parseDot(content);
|
|
71
|
+
case "plantuml":
|
|
72
|
+
return parsePlantUml(content);
|
|
73
|
+
default:
|
|
74
|
+
return parse(content);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/** Human-readable notes, so a lossy conversion says what it lost. */
|
|
78
|
+
function formatNotes(result) {
|
|
79
|
+
const notes = result.diagnostics.filter((d) => d.severity !== "error");
|
|
80
|
+
if (notes.length === 0)
|
|
81
|
+
return "";
|
|
82
|
+
const lines = notes.map((d) => {
|
|
83
|
+
const where = d.position ? ` line ${d.position.line}:` : "";
|
|
84
|
+
const source = d.source ? ` \`${d.source}\`` : "";
|
|
85
|
+
return `- ${d.severity} [${d.code}]${where}${source}\n ${d.message}`;
|
|
86
|
+
});
|
|
87
|
+
return `\n\n## Conversion notes\n${lines.join("\n")}`;
|
|
88
|
+
}
|
|
89
|
+
export async function handleConvert(args) {
|
|
90
|
+
const { content, from, to, strict } = ConvertArgsSchema.parse(args);
|
|
91
|
+
const sourceFormat = from === "auto" ? detectFormat(content) : from;
|
|
92
|
+
const result = parseAs(sourceFormat, content);
|
|
93
|
+
if (!result.graph || result.graph.nodes.length === 0 || !result.success) {
|
|
94
|
+
const why = result.errors[0]?.message ?? "no nodes were produced";
|
|
95
|
+
return {
|
|
96
|
+
content: [
|
|
97
|
+
{
|
|
98
|
+
type: "text",
|
|
99
|
+
text: `Could not convert from ${sourceFormat}: ${why}` + formatNotes(result),
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
structuredContent: {
|
|
103
|
+
from: sourceFormat,
|
|
104
|
+
to,
|
|
105
|
+
nodeCount: result.graph?.nodes.length ?? 0,
|
|
106
|
+
edgeCount: result.graph?.edges.length ?? 0,
|
|
107
|
+
diagnostics: result.diagnostics,
|
|
108
|
+
},
|
|
109
|
+
isError: true,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const graph = result.graph;
|
|
113
|
+
const printed = to === "coral" ? printWithDiagnostics(graph) : undefined;
|
|
114
|
+
const diagnostics = [...result.diagnostics, ...(printed?.diagnostics ?? [])];
|
|
115
|
+
const combined = { diagnostics };
|
|
116
|
+
const lossy = diagnostics.some((d) => d.severity !== "error");
|
|
117
|
+
if (strict && lossy) {
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: "text",
|
|
122
|
+
text: `Refusing a lossy conversion from ${sourceFormat} in strict mode.` +
|
|
123
|
+
formatNotes(combined),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
structuredContent: {
|
|
127
|
+
from: sourceFormat,
|
|
128
|
+
to,
|
|
129
|
+
nodeCount: graph.nodes.length,
|
|
130
|
+
edgeCount: graph.edges.length,
|
|
131
|
+
diagnostics,
|
|
132
|
+
},
|
|
133
|
+
isError: true,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const output = to === "json" ? JSON.stringify(graph, null, 2) : printed.text;
|
|
137
|
+
const summary = `Converted from ${sourceFormat} to ${to}: ` +
|
|
138
|
+
`${graph.nodes.length} nodes, ${graph.edges.length} edges` +
|
|
139
|
+
(lossy ? `, ${diagnostics.filter((d) => d.severity !== "error").length} notes` : "");
|
|
140
|
+
return {
|
|
141
|
+
content: [{ type: "text", text: `${summary}\n\n${output}${formatNotes(combined)}` }],
|
|
142
|
+
structuredContent: {
|
|
143
|
+
from: sourceFormat,
|
|
144
|
+
to,
|
|
145
|
+
nodeCount: graph.nodes.length,
|
|
146
|
+
edgeCount: graph.edges.length,
|
|
147
|
+
diagnostics,
|
|
148
|
+
},
|
|
149
|
+
isError: !result.success,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=convert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../src/tools/convert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,oBAAoB,GAIrB,MA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W,KAAK,CAAC,KAAK,CAAC,MAAM,QAAQ;QAC1D,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvF,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,OAAO,MAAM,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACpF,iBAAiB,EAAE;YACjB,IAAI,EAAE,YAAY;YAClB,EAAE;YACF,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YAC7B,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;YAC7B,WAAW;SACZ;QACD,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* coral_explain tool
|
|
3
|
+
*
|
|
4
|
+
* Generate natural language explanations of diagrams.
|
|
5
|
+
*/
|
|
6
|
+
export declare const explainTool: {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
content: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
level: {
|
|
17
|
+
type: string;
|
|
18
|
+
enum: string[];
|
|
19
|
+
description: string;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
focus: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function handleExplain(args: unknown): Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
36
|
+
//# sourceMappingURL=explain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.d.ts","sourceRoot":"","sources":["../../src/tools/explain.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;CAwBvB,CAAC;AAqZF,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO;;;;;GA2ChD"}
|