@sendora/mcp 1.15.3 → 1.15.5

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.
@@ -360,7 +360,7 @@ button:focus-visible {
360
360
  }
361
361
 
362
362
  // src/version.ts
363
- var MCP_VERSION = "1.15.3";
363
+ var MCP_VERSION = "1.15.5";
364
364
 
365
365
  // screens/host.ts
366
366
  var PROTOCOL_VERSION = "2026-01-26";
@@ -360,7 +360,7 @@ button:focus-visible {
360
360
  }
361
361
 
362
362
  // src/version.ts
363
- var MCP_VERSION = "1.15.3";
363
+ var MCP_VERSION = "1.15.5";
364
364
 
365
365
  // screens/host.ts
366
366
  var PROTOCOL_VERSION = "2026-01-26";
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { address, attachment, attachmentBytes, builtSize, customHeaders, MAX_ATTACHMENT_BYTES, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, metadata, substitutions, tag, } from './message-fields.js';
2
+ import { address, atMost, attachment, attachmentBytes, builtSize, customHeaders, MAX_ATTACHMENT_BYTES, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, metadata, recipients, substitutions, tag, toRecipients, } from './message-fields.js';
3
3
  /*
4
4
  * What send_broadcast takes (docs/design/mcp.md §4.2): the API's broadcast
5
5
  * request as packages/domain/src/broadcast-request.ts has it, on the rules
@@ -11,14 +11,13 @@ import { address, attachment, attachmentBytes, builtSize, customHeaders, MAX_ATT
11
11
  * refuse the same inputs with the same issues (§13 E05).
12
12
  */
13
13
  const MAX_BROADCAST_ENTRIES = 100;
14
+ const TOO_MANY_ENTRIES = 'at most 100 messages from here; a real list is sent by code with an SDK';
15
+ const TOO_MANY_ATTACHMENTS = 'at most 20 attachments per broadcast';
14
16
  const entry = z
15
17
  .object({
16
- to: z
17
- .array(address)
18
- .min(1)
19
- .describe('Recipients of this message; at most 50 across to, cc and bcc.'),
20
- cc: z.array(address).optional().describe('Copied recipients, shown in the message.'),
21
- bcc: z.array(address).optional().describe('Blind-copied recipients.'),
18
+ to: toRecipients.describe('Recipients of this message; at most 50 across to, cc and bcc.'),
19
+ cc: recipients.optional().describe('Copied recipients, shown in the message.'),
20
+ bcc: recipients.optional().describe('Blind-copied recipients.'),
22
21
  metadata: metadata
23
22
  .optional()
24
23
  .describe("Up to 20 key-value pairs for this message, merged over the broadcast's."),
@@ -54,9 +53,7 @@ export const broadcastInput = z
54
53
  headers: customHeaders
55
54
  .optional()
56
55
  .describe('Custom headers on every message. Headers Sendora sets itself, the List-Unsubscribe pair included, are refused.'),
57
- attachments: z
58
- .array(attachment)
59
- .max(20, 'at most 20 attachments per broadcast')
56
+ attachments: atMost(20, TOO_MANY_ATTACHMENTS, z.array(attachment).max(20, TOO_MANY_ATTACHMENTS))
60
57
  .optional()
61
58
  .describe('At most 20, sent with every message, together at most 5 MB decoded.'),
62
59
  tag: tag.describe('A label of up to 100 characters, on the broadcast and every message.'),
@@ -71,11 +68,7 @@ export const broadcastInput = z
71
68
  .boolean()
72
69
  .optional()
73
70
  .describe("Whether the links of every message are tracked, whatever the stream's switch in get_server says; left out, the stream decides. true is refused until an administrator has first switched tracking on in the dashboard."),
74
- messages: z
75
- .array(entry)
76
- .min(1)
77
- .max(MAX_BROADCAST_ENTRIES, 'at most 100 messages from here; a real list is sent by code with an SDK')
78
- .describe('One entry per message, at most 100.'),
71
+ messages: atMost(MAX_BROADCAST_ENTRIES, TOO_MANY_ENTRIES, z.array(entry).min(1).max(MAX_BROADCAST_ENTRIES, TOO_MANY_ENTRIES)).describe('One entry per message, at most 100.'),
79
72
  })
80
73
  .refine((input) => input.text !== undefined || input.html !== undefined, {
81
74
  message: 'text or html is required',
@@ -62,17 +62,36 @@ export function isDeniedHeader(name) {
62
62
  const lower = name.toLowerCase();
63
63
  return DENIED_HEADERS.has(lower) || DENIED_HEADER_PREFIXES.some((each) => lower.startsWith(each));
64
64
  }
65
- export const customHeaders = z
65
+ function countOf(value) {
66
+ if (Array.isArray(value)) {
67
+ return value.length;
68
+ }
69
+ return typeof value === 'object' && value !== null ? Object.keys(value).length : 0;
70
+ }
71
+ /**
72
+ * Counts a list's or record's entries before `schema` reads them. Zod reads every entry before it
73
+ * counts them, and a short request can hold millions that each become an issue.
74
+ */
75
+ export function atMost(max, message, schema) {
76
+ return z.preprocess((value, context) => {
77
+ if (countOf(value) > max) {
78
+ context.addIssue({ code: 'custom', message });
79
+ return z.NEVER;
80
+ }
81
+ return value;
82
+ }, schema);
83
+ }
84
+ const TOO_MANY_RECIPIENTS = 'at most 50 recipients per message';
85
+ export const recipients = atMost(MAX_RECIPIENTS, TOO_MANY_RECIPIENTS, z.array(address));
86
+ /** The `to` of a message, which needs a recipient where `cc` and `bcc` need none. */
87
+ export const toRecipients = atMost(MAX_RECIPIENTS, TOO_MANY_RECIPIENTS, z.array(address).min(1));
88
+ const headersRecord = z
66
89
  .record(z.string(), z
67
90
  .string()
68
91
  .regex(HEADER_VALUE, 'header values are 1 to 998 characters without control characters'))
69
92
  .superRefine((values, ctx) => {
70
- const names = Object.keys(values);
71
- if (names.length > 20) {
72
- ctx.addIssue({ code: 'custom', message: 'at most 20 headers per message' });
73
- }
74
93
  const seen = new Set();
75
- for (const name of names) {
94
+ for (const name of Object.keys(values)) {
76
95
  const lower = name.toLowerCase();
77
96
  if (!HEADER_NAME.test(name)) {
78
97
  ctx.addIssue({
@@ -90,17 +109,14 @@ export const customHeaders = z
90
109
  seen.add(lower);
91
110
  }
92
111
  });
112
+ export const customHeaders = atMost(20, 'at most 20 headers per message', headersRecord);
93
113
  const METADATA_KEY = /^[A-Za-z0-9_.-]{1,40}$/;
94
- export const metadata = z
114
+ const metadataRecord = z
95
115
  .record(z.string(), z
96
116
  .string()
97
117
  .regex(new RegExp(`^[^${CONTROL}]{0,500}$`, 'u'), 'metadata values are at most 500 characters without control characters'))
98
118
  .superRefine((values, ctx) => {
99
- const keys = Object.keys(values);
100
- if (keys.length > 20) {
101
- ctx.addIssue({ code: 'custom', message: 'at most 20 metadata entries per message' });
102
- }
103
- for (const key of keys) {
119
+ for (const key of Object.keys(values)) {
104
120
  if (!METADATA_KEY.test(key)) {
105
121
  ctx.addIssue({
106
122
  code: 'custom',
@@ -110,17 +126,14 @@ export const metadata = z
110
126
  }
111
127
  }
112
128
  });
129
+ export const metadata = atMost(20, 'at most 20 metadata entries per message', metadataRecord);
113
130
  const SUBSTITUTION_KEY = /^[A-Za-z0-9_]{1,40}$/;
114
- export const substitutions = z
131
+ const substitutionsRecord = z
115
132
  .record(z.string(), z
116
133
  .string()
117
134
  .regex(new RegExp(`^[^${CONTROL}]{0,500}$`, 'u'), 'substitution values are at most 500 characters without control characters'))
118
135
  .superRefine((values, ctx) => {
119
- const keys = Object.keys(values);
120
- if (keys.length > 20) {
121
- ctx.addIssue({ code: 'custom', message: 'at most 20 substitutions per message' });
122
- }
123
- for (const key of keys) {
136
+ for (const key of Object.keys(values)) {
124
137
  if (!SUBSTITUTION_KEY.test(key)) {
125
138
  ctx.addIssue({
126
139
  code: 'custom',
@@ -137,6 +150,7 @@ export const substitutions = z
137
150
  }
138
151
  }
139
152
  });
153
+ export const substitutions = atMost(20, 'at most 20 substitutions per message', substitutionsRecord);
140
154
  export const tag = z
141
155
  .string()
142
156
  .trim()
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { address, attachment, attachmentBytes, builtSize, customHeaders, MAX_ATTACHMENT_BYTES, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, metadata, tag, } from './message-fields.js';
2
+ import { address, atMost, attachment, attachmentBytes, builtSize, customHeaders, MAX_ATTACHMENT_BYTES, MAX_MESSAGE_BYTES, MAX_RECIPIENTS, metadata, recipients, tag, toRecipients, } from './message-fields.js';
3
3
  /*
4
4
  * What send_email takes (docs/design/mcp.md §4.2): the API's send request as
5
5
  * packages/domain/src/send-request.ts has it, on the rules of
@@ -15,18 +15,16 @@ export const sendInput = z
15
15
  .uuid()
16
16
  .optional()
17
17
  .describe('The stream it goes on, from get_server; the default transactional stream when left out.'),
18
- to: z.array(address).min(1).describe('Recipients; at most 50 across to, cc and bcc.'),
19
- cc: z.array(address).optional().describe('Copied recipients, shown in the message.'),
20
- bcc: z.array(address).optional().describe('Blind-copied recipients.'),
18
+ to: toRecipients.describe('Recipients; at most 50 across to, cc and bcc.'),
19
+ cc: recipients.optional().describe('Copied recipients, shown in the message.'),
20
+ bcc: recipients.optional().describe('Blind-copied recipients.'),
21
21
  subject: z.string().min(1).max(998).describe('The subject line, 1 to 998 characters.'),
22
22
  text: z.string().min(1).optional().describe('The plain-text part; text or html is required.'),
23
23
  html: z.string().min(1).optional().describe('The HTML part.'),
24
24
  headers: customHeaders
25
25
  .optional()
26
26
  .describe('Custom headers by name, at most 20. Headers Sendora sets itself, such as From, Subject and Content-*, are refused.'),
27
- attachments: z
28
- .array(attachment)
29
- .max(20, 'at most 20 attachments per message')
27
+ attachments: atMost(20, 'at most 20 attachments per message', z.array(attachment).max(20, 'at most 20 attachments per message'))
30
28
  .optional()
31
29
  .describe('At most 20, together at most 5 MB decoded.'),
32
30
  tag: tag.describe('A label of up to 100 characters, returned with the message and its events.'),
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /** This package's version, held equal to its package.json by a test. */
2
- export const MCP_VERSION = '1.15.3';
2
+ export const MCP_VERSION = '1.15.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendora/mcp",
3
- "version": "1.15.3",
3
+ "version": "1.15.5",
4
4
  "description": "The official MCP server for Sendora: its documentation and API for coding agents.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,10 +39,10 @@
39
39
  "fflate": "^0.8.3",
40
40
  "typescript": "~7.0.2",
41
41
  "vitest": "^4.1.11",
42
- "@sendora/api": "0.0.0",
43
42
  "@sendora/db": "0.0.0",
44
- "@sendora/observability": "0.0.0",
43
+ "@sendora/api": "0.0.0",
45
44
  "@sendora/domain": "0.0.0",
45
+ "@sendora/observability": "0.0.0",
46
46
  "@sendora/site": "0.0.0"
47
47
  },
48
48
  "scripts": {