@eraserlabs/eraser-mcp 0.1.0 → 0.2.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.
- package/README.md +22 -13
- package/dist/tools.d.ts +9 -6
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +18 -30
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Eraser MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Model Context Protocol (MCP) server for generating diagrams with [Eraser](https://eraser.io).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @eraserlabs/eraser-mcp
|
|
@@ -48,19 +48,28 @@ Add to your Claude Desktop config:
|
|
|
48
48
|
|
|
49
49
|
## Environment Variables
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
| Variable | Required | Description |
|
|
52
|
+
|----------|----------|-------------|
|
|
53
|
+
| `ERASER_API_TOKEN` | Yes | Your Eraser API token |
|
|
54
|
+
| `ERASER_API_URL` | No | Custom API URL (default: `https://app.eraser.io/api/mcp`) |
|
|
55
|
+
| `ERASER_OUTPUT_DIR` | No | Directory to save rendered diagrams (default: `.eraser/scratchpad`) |
|
|
54
56
|
|
|
55
57
|
## Available Tools
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
| Tool | Description |
|
|
60
|
+
|------|-------------|
|
|
61
|
+
| `renderSequenceDiagram` | Render sequence diagrams |
|
|
62
|
+
| `renderEntityRelationshipDiagram` | Render ERD diagrams |
|
|
63
|
+
| `renderCloudArchitectureDiagram` | Render cloud architecture diagrams |
|
|
64
|
+
| `renderFlowchart` | Render flowcharts |
|
|
65
|
+
| `renderBpmnDiagram` | Render BPMN diagrams |
|
|
66
|
+
| `renderPrompt` | Generate diagrams from natural language using AI |
|
|
67
|
+
| `renderElements` | Render multiple diagram elements |
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
- [Eraser API Documentation](https://docs.eraser.io)
|
|
72
|
+
- [Get an API Token](https://docs.eraser.io/reference/api-token)
|
|
64
73
|
|
|
65
74
|
## License
|
|
66
75
|
|
package/dist/tools.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ declare const diagramElementSchema: z.ZodObject<{
|
|
|
40
40
|
}>;
|
|
41
41
|
declare const renderPromptSchema: z.ZodObject<{
|
|
42
42
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
|
|
43
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
44
44
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
45
45
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
46
46
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -74,7 +74,7 @@ declare const renderPromptSchema: z.ZodObject<{
|
|
|
74
74
|
}>>;
|
|
75
75
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
76
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
|
|
77
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
78
78
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
79
79
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
80
80
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -108,7 +108,7 @@ declare const renderPromptSchema: z.ZodObject<{
|
|
|
108
108
|
}>>;
|
|
109
109
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
110
110
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
111
|
-
|
|
111
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
112
112
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
113
113
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
114
114
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -143,7 +143,7 @@ declare const renderPromptSchema: z.ZodObject<{
|
|
|
143
143
|
}, z.ZodTypeAny, "passthrough">>;
|
|
144
144
|
declare const renderElementsSchema: z.ZodObject<{
|
|
145
145
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
146
|
-
|
|
146
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
147
147
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
148
148
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
149
149
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -183,7 +183,7 @@ declare const renderElementsSchema: z.ZodObject<{
|
|
|
183
183
|
skipCache: z.ZodOptional<z.ZodBoolean>;
|
|
184
184
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
185
185
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
|
|
186
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
187
187
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
188
188
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
189
189
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -223,7 +223,7 @@ declare const renderElementsSchema: z.ZodObject<{
|
|
|
223
223
|
skipCache: z.ZodOptional<z.ZodBoolean>;
|
|
224
224
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
225
225
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
226
|
-
|
|
226
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
227
227
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
228
228
|
theme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
|
|
229
229
|
format: z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>;
|
|
@@ -269,8 +269,10 @@ declare const singleDiagramSchema: z.ZodObject<{
|
|
|
269
269
|
styleMode: z.ZodOptional<z.ZodEnum<["plain", "shadow", "watercolor"]>>;
|
|
270
270
|
typeface: z.ZodOptional<z.ZodEnum<["rough", "clean", "mono"]>>;
|
|
271
271
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
272
|
+
imageQuality: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
272
273
|
}, "strip", z.ZodTypeAny, {
|
|
273
274
|
code: string;
|
|
275
|
+
imageQuality?: 3 | 1 | 2 | undefined;
|
|
274
276
|
background?: boolean | undefined;
|
|
275
277
|
theme?: "light" | "dark" | undefined;
|
|
276
278
|
typeface?: "rough" | "clean" | "mono" | undefined;
|
|
@@ -278,6 +280,7 @@ declare const singleDiagramSchema: z.ZodObject<{
|
|
|
278
280
|
styleMode?: "plain" | "shadow" | "watercolor" | undefined;
|
|
279
281
|
}, {
|
|
280
282
|
code: string;
|
|
283
|
+
imageQuality?: 3 | 1 | 2 | undefined;
|
|
281
284
|
background?: boolean | undefined;
|
|
282
285
|
theme?: "light" | "dark" | undefined;
|
|
283
286
|
typeface?: "rough" | "clean" | "mono" | undefined;
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAA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6C9D,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,WAAW,CAEhE;AAED,eAAO,MAAM,UAAU,yCAAqD,CAAC;AAG7E,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAM3D,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,OAAO,kBAAkB,CAEzF"}
|
package/dist/tools.js
CHANGED
|
@@ -32,7 +32,7 @@ const diagramElementSchema = zod_1.z.object({
|
|
|
32
32
|
const renderOptionsSchema = zod_1.z
|
|
33
33
|
.object({
|
|
34
34
|
padding: zod_1.z.number().optional(),
|
|
35
|
-
|
|
35
|
+
imageQuality: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3)]).optional(),
|
|
36
36
|
background: zod_1.z.boolean().optional(),
|
|
37
37
|
theme: zod_1.z.enum(['light', 'dark']).optional(),
|
|
38
38
|
format: zod_1.z.enum(['png', 'jpeg']).optional(),
|
|
@@ -90,6 +90,7 @@ const singleDiagramSchema = zod_1.z.object({
|
|
|
90
90
|
styleMode: zod_1.z.enum(exports.styleModeSettings).optional(),
|
|
91
91
|
typeface: zod_1.z.enum(exports.typefaceSettings).optional(),
|
|
92
92
|
background: zod_1.z.boolean().optional(),
|
|
93
|
+
imageQuality: zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2), zod_1.z.literal(3)]).optional(),
|
|
93
94
|
});
|
|
94
95
|
const renderPromptJsonSchema = {
|
|
95
96
|
type: 'object',
|
|
@@ -121,7 +122,7 @@ const renderPromptJsonSchema = {
|
|
|
121
122
|
},
|
|
122
123
|
},
|
|
123
124
|
padding: { type: 'number' },
|
|
124
|
-
|
|
125
|
+
imageQuality: { type: 'number', enum: [1, 2, 3] },
|
|
125
126
|
background: { type: 'boolean' },
|
|
126
127
|
theme: { type: 'string', enum: ['light', 'dark'] },
|
|
127
128
|
format: { type: 'string', enum: ['png', 'jpeg'] },
|
|
@@ -158,7 +159,7 @@ const renderElementsJsonSchema = {
|
|
|
158
159
|
returnElements: { type: 'boolean' },
|
|
159
160
|
skipCache: { type: 'boolean' },
|
|
160
161
|
padding: { type: 'number' },
|
|
161
|
-
|
|
162
|
+
imageQuality: { type: 'number', enum: [1, 2, 3] },
|
|
162
163
|
background: { type: 'boolean' },
|
|
163
164
|
theme: { type: 'string', enum: ['light', 'dark'] },
|
|
164
165
|
format: { type: 'string', enum: ['png', 'jpeg'] },
|
|
@@ -178,6 +179,7 @@ const singleDiagramJsonSchema = {
|
|
|
178
179
|
styleMode: { type: 'string', enum: [...exports.styleModeSettings] },
|
|
179
180
|
typeface: { type: 'string', enum: [...exports.typefaceSettings] },
|
|
180
181
|
background: { type: 'boolean', description: 'Whether to include a solid background' },
|
|
182
|
+
imageQuality: { type: 'number', enum: [1, 2, 3] },
|
|
181
183
|
},
|
|
182
184
|
};
|
|
183
185
|
// Diagram type descriptions with syntax examples
|
|
@@ -186,38 +188,23 @@ const SEQUENCE_DIAGRAM_DESCRIPTION = `Render a sequence diagram. Use Eraser's se
|
|
|
186
188
|
Example syntax:
|
|
187
189
|
\`\`\`
|
|
188
190
|
title Authentication Flow
|
|
191
|
+
autoNumber on
|
|
189
192
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
Server [icon: server]
|
|
194
|
-
Database [icon: database]
|
|
193
|
+
Client [icon: monitor, color: gray]
|
|
194
|
+
Server [icon: server, color: blue]
|
|
195
|
+
Service [icon: tool, color: green]
|
|
195
196
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Server > Database: Query user
|
|
200
|
-
Database > Server: User data
|
|
201
|
-
Server > Browser: JWT token
|
|
202
|
-
Browser > User: Login success
|
|
197
|
+
Client > Server: Data request
|
|
198
|
+
activate Server
|
|
199
|
+
Server <> Service: Service request
|
|
203
200
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
Server > Browser: 200 OK
|
|
207
|
-
}
|
|
208
|
-
else [label: "Invalid"] {
|
|
209
|
-
Server > Browser: 401 Unauthorized
|
|
201
|
+
loop [label: until success, color: green] {
|
|
202
|
+
Service > Service: Check availability
|
|
210
203
|
}
|
|
211
204
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
Server > Database: Query
|
|
205
|
+
Server - Service: Data processing
|
|
206
|
+
Server --> Client: Data response
|
|
215
207
|
deactivate Server
|
|
216
|
-
|
|
217
|
-
// Loops
|
|
218
|
-
loop [label: "Retry 3 times"] {
|
|
219
|
-
Browser > Server: Request
|
|
220
|
-
}
|
|
221
208
|
\`\`\``;
|
|
222
209
|
const ERD_DESCRIPTION = `Render an entity-relationship diagram. Use Eraser's ERD syntax.
|
|
223
210
|
|
|
@@ -296,11 +283,12 @@ API Service > RDS
|
|
|
296
283
|
API Service > ElastiCache
|
|
297
284
|
Worker Service > S3
|
|
298
285
|
\`\`\``;
|
|
299
|
-
const FLOWCHART_DESCRIPTION = `Render a flowchart diagram. Use Eraser's flowchart syntax.
|
|
286
|
+
const FLOWCHART_DESCRIPTION = `Render a flowchart diagram. Use Eraser's flowchart syntax. Prefer horizontal layout (direction right) unless the user wants a vertical diagram.
|
|
300
287
|
|
|
301
288
|
Example syntax:
|
|
302
289
|
\`\`\`
|
|
303
290
|
title User Registration Flow
|
|
291
|
+
direction right
|
|
304
292
|
|
|
305
293
|
// Nodes with shapes and icons
|
|
306
294
|
Start [shape: oval, icon: play]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eraserlabs/eraser-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for generating diagrams with Eraser.io",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/eraserlabs/
|
|
27
|
+
"url": "https://github.com/eraserlabs/eraser-io.git",
|
|
28
28
|
"directory": "packages/eraser-mcp"
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|