@sendinel/mcp-server 1.0.67 → 1.0.68

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.
@@ -5,16 +5,23 @@
5
5
  // than a cross-package import — keep both in sync if the SSRF guard changes.
6
6
  import dns from 'node:dns/promises';
7
7
  import net from 'node:net';
8
- import { Agent } from 'undici';
8
+ // #4049: fetch must come from the same undici as Agent. Node's global fetch bundles its own undici and
9
+ // rejects a foreign dispatcher (UND_ERR_INVALID_ARG) before any request, so every pinned fetch failed.
10
+ import { Agent, fetch as undiciFetch } from 'undici';
9
11
  export function createPinnedIpDispatcher(hostname, resolved) {
10
12
  const expectedHost = hostname.toLowerCase();
11
13
  return new Agent({
12
14
  connect: {
13
- lookup(requestedHost, _options, callback) {
15
+ lookup(requestedHost, options, callback) {
14
16
  if (String(requestedHost).toLowerCase() !== expectedHost) {
15
17
  callback(new Error('Pinned fetch attempted to resolve an unexpected host'), []);
16
18
  return;
17
19
  }
20
+ // Node's connect asks for every address when options.all is set; answer in the shape it asked for.
21
+ if (options?.all) {
22
+ callback(null, [{ address: resolved.address, family: resolved.family }]);
23
+ return;
24
+ }
18
25
  callback(null, resolved.address, resolved.family);
19
26
  },
20
27
  },
@@ -23,7 +30,7 @@ export function createPinnedIpDispatcher(hostname, resolved) {
23
30
  }
24
31
  export function fetchPinnedToResolvedIp(url, resolved, init = {}) {
25
32
  const dispatcher = createPinnedIpDispatcher(url.hostname, resolved);
26
- return fetch(url, { ...init, dispatcher });
33
+ return undiciFetch(url, { ...init, dispatcher });
27
34
  }
28
35
  function isPrivateIp(address) {
29
36
  if (net.isIPv4(address)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendinel/mcp-server",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
5
5
  "mcpName": "ai.sendinel/mcp-server",
6
6
  "type": "module",