@mailjet/mailjet-mcp-server 1.0.2
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/.github/workflows/run-tests.yml +36 -0
- package/CHANGELOG.md +40 -0
- package/CODEOWNERS +1 -0
- package/LICENSE +191 -0
- package/README.md +93 -0
- package/package.json +39 -0
- package/src/mailjet-mcp.js +656 -0
- package/src/mailjet-openapi-schema.js +63 -0
- package/src/openapi-mailjet.yaml +15364 -0
- package/tests/mailjet-mcp.test.js +249 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
z.config(z.locales.en());
|
|
4
|
+
|
|
5
|
+
const methodParams = z.object({
|
|
6
|
+
name: z.string(),
|
|
7
|
+
in: z.string(),
|
|
8
|
+
required: z.boolean().optional(),
|
|
9
|
+
schema: z.object({ type: z.string() }),
|
|
10
|
+
$ref: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
const reqBodyContent = z.record(
|
|
13
|
+
z.string(),
|
|
14
|
+
z.object({
|
|
15
|
+
schema: z.object({}).catchall(z.any()).optional(),
|
|
16
|
+
examples: z.object({}).catchall(z.any()).optional(),
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
const requestMethod = z
|
|
20
|
+
.object({
|
|
21
|
+
description: z.string(),
|
|
22
|
+
parameters: z.array(methodParams).optional(),
|
|
23
|
+
operationId: z.string().optional(),
|
|
24
|
+
requestBody: z.object({ content: reqBodyContent }).optional(),
|
|
25
|
+
responses: z.object({}).catchall(z.any()),
|
|
26
|
+
summary: z.string().optional(),
|
|
27
|
+
tags: z.array(z.string()).optional(),
|
|
28
|
+
})
|
|
29
|
+
.catchall(z.any())
|
|
30
|
+
.optional();
|
|
31
|
+
|
|
32
|
+
export const MailjetApiSchema = z.object({
|
|
33
|
+
openapi: z.string(),
|
|
34
|
+
info: z.object({
|
|
35
|
+
title: z.string(),
|
|
36
|
+
description: z.string(),
|
|
37
|
+
version: z.string(),
|
|
38
|
+
contact: z.object({}).optional(),
|
|
39
|
+
}),
|
|
40
|
+
servers: z.array(
|
|
41
|
+
z.object({
|
|
42
|
+
url: z.string(),
|
|
43
|
+
}),
|
|
44
|
+
),
|
|
45
|
+
paths: z.record(
|
|
46
|
+
// Accurate types are more trouble than they're worth right now
|
|
47
|
+
// z.templateLiteral([z.enum(["/v3/REST", "/v4/sms", "/v3/send", "/v3.1/send"]), z.string()]),
|
|
48
|
+
z.string(),
|
|
49
|
+
z.object({
|
|
50
|
+
get: requestMethod,
|
|
51
|
+
post: requestMethod,
|
|
52
|
+
put: requestMethod,
|
|
53
|
+
delete: requestMethod,
|
|
54
|
+
parameters: z.array(methodParams).optional(),
|
|
55
|
+
}),
|
|
56
|
+
),
|
|
57
|
+
tags: z.array(
|
|
58
|
+
z.object({
|
|
59
|
+
name: z.string(),
|
|
60
|
+
description: z.string().optional(),
|
|
61
|
+
}),
|
|
62
|
+
),
|
|
63
|
+
});
|