@globalfishingwatch/mcp 0.0.1 → 0.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.
Files changed (2) hide show
  1. package/dist/lib/api.js +6 -1
  2. package/package.json +2 -1
package/dist/lib/api.js CHANGED
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.gfwFetch = gfwFetch;
4
+ const undici_1 = require("undici");
4
5
  const GFW_BASE = 'https://gateway.api.globalfishingwatch.org';
6
+ const proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
7
+ const dispatcher = proxyUrl ? new undici_1.ProxyAgent(proxyUrl) : undefined;
5
8
  /**
6
9
  * Fetch wrapper for the GFW API.
7
10
  * Automatically injects the Bearer token from API_KEY env var when present.
11
+ * Respects HTTPS_PROXY / HTTP_PROXY environment variables.
8
12
  * Throws an Error if the response is not OK.
9
13
  */
10
14
  async function gfwFetch(path, params) {
@@ -14,11 +18,12 @@ async function gfwFetch(path, params) {
14
18
  }
15
19
  const apiKey = process.env.API_KEY;
16
20
  console.error(`Making GFW API request to ${url}`);
17
- const response = await fetch(url.toString(), {
21
+ const response = await (0, undici_1.fetch)(url.toString(), {
18
22
  headers: {
19
23
  ...(apiKey && { Authorization: `Bearer ${apiKey}` }),
20
24
  Referer: 'gfw-mcp-js',
21
25
  },
26
+ dispatcher,
22
27
  });
23
28
  if (!response.ok) {
24
29
  throw new Error(`GFW API error ${response.status}: ${response.statusText}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalfishingwatch/mcp",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "MCP server for Global Fishing Watch data — vessel search, events, fishing hours, and region lookups",
5
5
  "author": "Global Fishing Watch",
6
6
  "license": "Apache-2.0",
@@ -35,6 +35,7 @@
35
35
  "commander": "^14.0.3",
36
36
  "express": "^5.1.0",
37
37
  "qs": "^6.15.1",
38
+ "undici": "^7.25.0",
38
39
  "zod": "^3.25.76"
39
40
  },
40
41
  "devDependencies": {