@mongodb-js/mcp-fetch 3.0.3 → 3.0.4

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.
@@ -4,11 +4,18 @@
4
4
  * system-CA bundle and proxy Agent per call, which accumulates until OOM.
5
5
  */
6
6
  export declare function getSharedProxyFetch(): typeof fetch;
7
- /** A matched `fetch`/`Request` pair (must come from the same implementation). */
7
+ /**
8
+ * A matched `fetch`/`Request` pair. Both must come from the same implementation:
9
+ * a `Request` built by one implementation is not recognized as a `Request` by
10
+ * another and gets coerced to a string, producing a bogus URL.
11
+ */
8
12
  export type HttpClient = {
9
13
  fetch: typeof fetch;
10
14
  Request: typeof globalThis.Request;
11
15
  };
12
- /** Default `httpClient`: the shared proxy-aware `fetch` + platform `Request`. */
16
+ /**
17
+ * The `HttpClient` used when an embedder doesn't provide one: the shared
18
+ * proxy-aware `fetch` paired with the `Request` implementation it understands.
19
+ */
13
20
  export declare function getDefaultHttpClient(): HttpClient;
14
21
  //# sourceMappingURL=proxyFetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxyFetch.d.ts","sourceRoot":"","sources":["../src/proxyFetch.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,KAAK,CASlD;AAED,iFAAiF;AACjF,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,UAAU,CAAC,OAAO,CAAC;CACtC,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,oBAAoB,IAAI,UAAU,CAKjD"}
1
+ {"version":3,"file":"proxyFetch.d.ts","sourceRoot":"","sources":["../src/proxyFetch.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,KAAK,CASlD;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,UAAU,CAAC,OAAO,CAAC;CACtC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CAMjD"}
@@ -1,4 +1,5 @@
1
1
  import { createFetch } from "@mongodb-js/devtools-proxy-support";
2
+ import { Request as NodeFetchRequest } from "node-fetch";
2
3
  let sharedProxyFetch;
3
4
  /**
4
5
  * Node detection via `process.versions.node` (bundlers may shim `process`
@@ -22,11 +23,15 @@ export function getSharedProxyFetch() {
22
23
  }
23
24
  return sharedProxyFetch;
24
25
  }
25
- /** Default `httpClient`: the shared proxy-aware `fetch` + platform `Request`. */
26
+ /**
27
+ * The `HttpClient` used when an embedder doesn't provide one: the shared
28
+ * proxy-aware `fetch` paired with the `Request` implementation it understands.
29
+ */
26
30
  export function getDefaultHttpClient() {
27
31
  return {
28
32
  fetch: getSharedProxyFetch(),
29
- Request: globalThis.Request,
33
+ // The proxy fetch delegates to node-fetch, so pair it with node-fetch's Request here.
34
+ Request: (isNodeRuntime() ? NodeFetchRequest : globalThis.Request),
30
35
  };
31
36
  }
32
37
  //# sourceMappingURL=proxyFetch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxyFetch.js","sourceRoot":"","sources":["../src/proxyFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,IAAI,gBAA0C,CAAC;AAE/C;;;GAGG;AACH,SAAS,aAAa;IAClB,OAAO,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC;AACnH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IAC/B,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACjC,gBAAgB,GAAG,aAAa,EAAE;YAC9B,CAAC,CAAE,WAAW,CAAC;gBACT,6BAA6B,EAAE,IAAI;aACtC,CAA6B;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@@
1
1
  {
2
2
  "name": "@mongodb-js/mcp-fetch",
3
3
  "description": "Shared proxy-aware fetch and httpClient factory for the MongoDB MCP server",
4
- "version": "3.0.3",
4
+ "version": "3.0.4",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
7
7
  "author": "MongoDB <info@mongodb.com>",
@@ -21,7 +21,8 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@mongodb-js/devtools-proxy-support": "^0.7.19"
24
+ "@mongodb-js/devtools-proxy-support": "^0.7.19",
25
+ "node-fetch": "^3.3.2"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@types/node": "^25.6.0",