@teamnetwork-nz/smtp-mcp-server 1.4.1 → 1.4.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/dist/config.js CHANGED
@@ -5,25 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.config = void 0;
7
7
  const dotenv_1 = __importDefault(require("dotenv"));
8
- const zod_1 = require("zod");
8
+ const v3_1 = require("zod/v3");
9
9
  dotenv_1.default.config({ quiet: true });
10
- const configSchema = zod_1.z.object({
11
- readWrite: zod_1.z.boolean().default(false),
12
- smtp: zod_1.z.object({
13
- host: zod_1.z.string().min(1, "SMTP_HOST is required"),
14
- port: zod_1.z.coerce.number().int().min(1).max(65535).default(587),
15
- secure: zod_1.z.boolean().default(false),
16
- ignoreTls: zod_1.z.boolean().default(false),
17
- user: zod_1.z.string().min(1).optional(),
18
- pass: zod_1.z.string().min(1).optional(),
10
+ const configSchema = v3_1.z.object({
11
+ readWrite: v3_1.z.boolean().default(false),
12
+ smtp: v3_1.z.object({
13
+ host: v3_1.z.string().min(1, "SMTP_HOST is required"),
14
+ port: v3_1.z.coerce.number().int().min(1).max(65535).default(587),
15
+ secure: v3_1.z.boolean().default(false),
16
+ ignoreTls: v3_1.z.boolean().default(false),
17
+ user: v3_1.z.string().min(1).optional(),
18
+ pass: v3_1.z.string().min(1).optional(),
19
19
  }),
20
- from: zod_1.z.object({
21
- address: zod_1.z.string().email("SMTP_FROM_ADDRESS must be a valid email"),
22
- name: zod_1.z.string().optional(),
20
+ from: v3_1.z.object({
21
+ address: v3_1.z.string().email("SMTP_FROM_ADDRESS must be a valid email"),
22
+ name: v3_1.z.string().optional(),
23
23
  }),
24
- restrictions: zod_1.z.object({
25
- allowedDomains: zod_1.z.array(zod_1.z.string()).default([]),
26
- allowedAddresses: zod_1.z.array(zod_1.z.string().email()).default([]),
24
+ restrictions: v3_1.z.object({
25
+ allowedDomains: v3_1.z.array(v3_1.z.string()).default([]),
26
+ allowedAddresses: v3_1.z.array(v3_1.z.string().email()).default([]),
27
27
  }),
28
28
  });
29
29
  function parseList(value) {
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
38
38
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
39
- const zod_1 = require("zod");
39
+ const v3_1 = require("zod/v3");
40
40
  const config_js_1 = require("./config.js");
41
41
  const restrictions_js_1 = require("./restrictions.js");
42
42
  const email_js_1 = require("./email.js");
@@ -54,12 +54,12 @@ function createConfiguredServer() {
54
54
  // ---------------------------------------------------------------------------
55
55
  // Shared schemas
56
56
  // ---------------------------------------------------------------------------
57
- const attachmentSchema = zod_1.z
57
+ const attachmentSchema = v3_1.z
58
58
  .object({
59
- path: zod_1.z.string().optional().describe("Absolute path to the file on disk — server reads and encodes it"),
60
- filename: zod_1.z.string().optional().describe("Override the filename shown to the recipient"),
61
- content: zod_1.z.string().optional().describe("Base64-encoded file content (use path instead where possible)"),
62
- content_type: zod_1.z.string().optional().describe("MIME type — auto-detected from path extension if omitted"),
59
+ path: v3_1.z.string().optional().describe("Absolute path to the file on disk — server reads and encodes it"),
60
+ filename: v3_1.z.string().optional().describe("Override the filename shown to the recipient"),
61
+ content: v3_1.z.string().optional().describe("Base64-encoded file content (use path instead where possible)"),
62
+ content_type: v3_1.z.string().optional().describe("MIME type — auto-detected from path extension if omitted"),
63
63
  })
64
64
  .refine((a) => a.path || a.content, {
65
65
  message: "Each attachment must include either 'path' (preferred) or 'content' (base64)",
@@ -67,8 +67,8 @@ function createConfiguredServer() {
67
67
  .refine((a) => !a.content || (a.filename && a.content_type), {
68
68
  message: "Attachments using 'content' must also include 'filename' and 'content_type'",
69
69
  });
70
- const recipientSchema = zod_1.z
71
- .union([zod_1.z.string().email(), zod_1.z.array(zod_1.z.string().email()).min(1)])
70
+ const recipientSchema = v3_1.z
71
+ .union([v3_1.z.string().email(), v3_1.z.array(v3_1.z.string().email()).min(1)])
72
72
  .transform((v) => (Array.isArray(v) ? v : [v]));
73
73
  // ---------------------------------------------------------------------------
74
74
  // Tool: health
@@ -125,8 +125,8 @@ function createConfiguredServer() {
125
125
  "the server will encode the file itself without passing binary data through the agent. " +
126
126
  "Use encode_file only when you need to inspect or transform the content before sending.",
127
127
  inputSchema: {
128
- path: zod_1.z.string().min(1).describe("Absolute or relative path to the file"),
129
- content_type: zod_1.z
128
+ path: v3_1.z.string().min(1).describe("Absolute or relative path to the file"),
129
+ content_type: v3_1.z
130
130
  .string()
131
131
  .optional()
132
132
  .describe("MIME type override. If omitted the type is detected from the file extension."),
@@ -170,9 +170,9 @@ function createConfiguredServer() {
170
170
  description: "Send an email via SMTP. Recipient addresses are validated against the server's allowed domains/addresses policy.",
171
171
  inputSchema: {
172
172
  to: recipientSchema.describe("Recipient address or list of addresses"),
173
- subject: zod_1.z.string().min(1).describe("Email subject line"),
174
- body: zod_1.z.string().min(1).describe("Email body content"),
175
- body_type: zod_1.z
173
+ subject: v3_1.z.string().min(1).describe("Email subject line"),
174
+ body: v3_1.z.string().min(1).describe("Email body content"),
175
+ body_type: v3_1.z
176
176
  .enum(["text", "html"])
177
177
  .default("text")
178
178
  .describe("Body format — plain text (default) or HTML"),
@@ -182,7 +182,7 @@ function createConfiguredServer() {
182
182
  bcc: recipientSchema
183
183
  .optional()
184
184
  .describe("BCC address or list of addresses"),
185
- attachments: zod_1.z
185
+ attachments: v3_1.z
186
186
  .array(attachmentSchema)
187
187
  .optional()
188
188
  .describe("Files to attach"),
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.enforceStrictToolInputs = enforceStrictToolInputs;
4
- const zod_1 = require("zod");
4
+ const v3_1 = require("zod/v3");
5
5
  function isSchema(value) {
6
6
  return typeof value === "object" && value !== null && "_def" in value;
7
7
  }
@@ -13,9 +13,9 @@ function isRawShape(value) {
13
13
  }
14
14
  function strictSchema(schema) {
15
15
  if (schema === undefined)
16
- return zod_1.z.object({}).strict();
16
+ return v3_1.z.object({}).strict();
17
17
  if (isRawShape(schema))
18
- return zod_1.z.object(schema).strict();
18
+ return v3_1.z.object(schema).strict();
19
19
  if (isSchema(schema) && typeof schema.strict === "function")
20
20
  return schema.strict();
21
21
  return schema;
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
- {
2
- "name": "@teamnetwork-nz/smtp-mcp-server",
3
- "version": "1.4.1",
4
- "description": "MCP server for sending email via SMTP relay",
5
- "main": "dist/index.js",
6
- "bin": {
7
- "smtp-mcp-server": "dist/index.js"
8
- },
9
- "files": [
10
- "dist",
11
- "README.md",
12
- ".env.example"
13
- ],
14
- "scripts": {
15
- "build": "tsc",
16
- "test": "npm run build && node --test tests/*.test.mjs",
17
- "start": "node dist/index.js",
18
- "dev": "tsc --watch",
19
- "prepublishOnly": "npm run build"
20
- },
21
- "keywords": [
22
- "mcp",
23
- "smtp",
24
- "email",
25
- "model-context-protocol",
26
- "claude"
27
- ],
28
- "author": "",
29
- "license": "ISC",
30
- "type": "commonjs",
31
- "engines": {
32
- "node": ">=18.0.0"
33
- },
34
- "publishConfig": {
35
- "access": "public"
36
- },
37
- "dependencies": {
38
- "@modelcontextprotocol/sdk": "^1.29.0",
39
- "dotenv": "^17.4.2",
40
- "nodemailer": "^8.0.7",
41
- "zod": "^3.25.0"
42
- },
43
- "devDependencies": {
44
- "@types/node": "^25.7.0",
45
- "@types/nodemailer": "^8.0.0",
46
- "typescript": "^6.0.3"
47
- }
48
- }
1
+ {
2
+ "name": "@teamnetwork-nz/smtp-mcp-server",
3
+ "version": "1.4.2",
4
+ "description": "MCP server for sending email via SMTP relay",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "smtp-mcp-server": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ ".env.example"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "test": "npm run build && node --test tests/*.test.mjs",
17
+ "start": "node dist/index.js",
18
+ "dev": "tsc --watch",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "keywords": [
22
+ "mcp",
23
+ "smtp",
24
+ "email",
25
+ "model-context-protocol",
26
+ "claude"
27
+ ],
28
+ "author": "",
29
+ "license": "ISC",
30
+ "type": "commonjs",
31
+ "engines": {
32
+ "node": ">=18.0.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.32.2",
39
+ "dotenv": "^17.4.2",
40
+ "nodemailer": "^8.0.7",
41
+ "zod": "^4.6.7"
42
+ },
43
+ "devDependencies": {
44
+ "@types/node": "^25.7.0",
45
+ "@types/nodemailer": "^8.0.0",
46
+ "typescript": "^6.0.3"
47
+ }
48
+ }