@pipeworx/mcp-global-fishing-watch 0.1.0
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/LICENSE +21 -0
- package/README.md +179 -0
- package/bin/cli.js +17 -0
- package/package.json +32 -0
- package/server.json +18 -0
- package/src/index.ts +1039 -0
- package/src/server.ts +45 -0
- package/tsconfig.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mojibake Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# @pipeworx/global-fishing-watch
|
|
2
|
+
|
|
3
|
+
Global Fishing Watch API v3 — AIS-derived vessel identity, at-sea events
|
|
4
|
+
(apparent fishing, encounters, loitering, port visits, AIS gaps) and aggregated
|
|
5
|
+
apparent fishing effort.
|
|
6
|
+
|
|
7
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
- `gfwfish_vessels_search(query, datasets?, limit?, offset?, _apiKey)` — vessel
|
|
12
|
+
identity by name, MMSI, IMO or call sign.
|
|
13
|
+
- `gfwfish_events(start_date, end_date, vessel_id?, event_type?, limit?,
|
|
14
|
+
offset?, _apiKey)` — events over a date range.
|
|
15
|
+
- `gfwfish_4wings_report(bbox, start_date, end_date, group_by?,
|
|
16
|
+
temporal_resolution?, spatial_resolution?, datasets?, _apiKey)` — apparent
|
|
17
|
+
fishing effort aggregated over a bounding box.
|
|
18
|
+
|
|
19
|
+
## Auth
|
|
20
|
+
|
|
21
|
+
**Platform-backed since 2026-09-18.** `PLATFORM_GFW_FISHING_TOKEN` is in the
|
|
22
|
+
encrypted keystore (GFW API application "pipeworx", non-commercial intended
|
|
23
|
+
use); the gateway injects it as `_apiKey`, and a caller may pass their own
|
|
24
|
+
instead. Every v3 endpoint requires a Bearer token — there is no keyless or
|
|
25
|
+
demo path. Free non-commercial tokens:
|
|
26
|
+
<https://globalfishingwatch.org/our-apis/tokens>.
|
|
27
|
+
|
|
28
|
+
Distinct from `PLATFORM_GFW_KEY`, which is Global Forest **Watch** — different
|
|
29
|
+
organisation, different API, similar abbreviation.
|
|
30
|
+
|
|
31
|
+
`licence: non-commercial` is set on the pack: GFW data is free for
|
|
32
|
+
non-commercial use and commercial use needs their permission.
|
|
33
|
+
|
|
34
|
+
## Data sources
|
|
35
|
+
|
|
36
|
+
- <https://gateway.api.globalfishingwatch.org/v3/vessels/search>
|
|
37
|
+
- <https://gateway.api.globalfishingwatch.org/v3/events>
|
|
38
|
+
- <https://gateway.api.globalfishingwatch.org/v3/4wings/report> (POST; the
|
|
39
|
+
region geometry goes in the body, the resolution/grouping in the query
|
|
40
|
+
string)
|
|
41
|
+
|
|
42
|
+
**A 401 from this API proves nothing about the path.** An unauthenticated
|
|
43
|
+
request to any path — including one that does not exist, verified against
|
|
44
|
+
`/v3/zzz-not-a-path` on 2026-09-17 — answers `401 {"error":"invalid token"}`.
|
|
45
|
+
That is why the shapes shipped on 2026-09-17 were unverifiable, and why the
|
|
46
|
+
first probe on a real token returned a 422.
|
|
47
|
+
|
|
48
|
+
**The two paging schemes are different, and mixing them is the 422.**
|
|
49
|
+
`/v3/vessels/search` pages by CURSOR: the response carries `since`, you pass it
|
|
50
|
+
back as `since`, and sending `offset` is rejected `422 Unprocessable Entity`.
|
|
51
|
+
`/v3/events` pages the ordinary way — `offset` and `limit` are both required,
|
|
52
|
+
and the response carries `nextOffset`. Do not unify them.
|
|
53
|
+
|
|
54
|
+
Other shape facts, each from the v3 docs and then proved live (fleet #2245):
|
|
55
|
+
|
|
56
|
+
- Multi-value parameters use indexed square brackets: `datasets[0]=...`,
|
|
57
|
+
`vessels[0]=...`, `filters[0]=...`.
|
|
58
|
+
- `/v3/vessels/search` needs at least 3 characters in `query`; `limit` maxes at
|
|
59
|
+
50. **A `since` cursor carries its own page size** — pass `since` with a
|
|
60
|
+
smaller `limit` and you still get the original page's worth back, so do not
|
|
61
|
+
read `returned` as proof the limit was honoured (measured live: limit 2 plus a
|
|
62
|
+
cursor from a limit-5 call returned 5).
|
|
63
|
+
- Every repeated parameter on this endpoint takes INDEXED brackets:
|
|
64
|
+
`datasets[0]`, `includes[0]`. The bare `includes[]` form is a 422. Identity is nested under two parallel arrays — `selfReportedInfo` (what
|
|
65
|
+
the vessel broadcast) and `registryInfo` (what a registry holds) — which can
|
|
66
|
+
disagree. The pack lifts the common fields and keeps both arrays.
|
|
67
|
+
- `/v3/events` takes `start-date` / `end-date` on GET (hyphenated) but
|
|
68
|
+
`startDate` / `endDate` in a POST body (camelCase). This pack uses GET.
|
|
69
|
+
- `/v3/4wings/report` is a POST: the grid parameters go in the query string
|
|
70
|
+
(`spatial-resolution`, `temporal-resolution`, `group-by`, `date-range` as
|
|
71
|
+
`YYYY-MM-DD,YYYY-MM-DD`, `format=JSON`) and the AREA goes in the body — either
|
|
72
|
+
a named region, `{"region":{"dataset":"public-eez-areas","id":8371}}`, or a
|
|
73
|
+
custom polygon under a top-level `"geojson"` key. `temporal-resolution` is one
|
|
74
|
+
of HOURLY, DAILY, MONTHLY, YEARLY, ENTIRE. Its `entries` are arrays of grouped
|
|
75
|
+
rows rather than rows, so the pack flattens them.
|
|
76
|
+
|
|
77
|
+
## Quick Start
|
|
78
|
+
|
|
79
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"mcpServers": {
|
|
84
|
+
"global-fishing-watch": {
|
|
85
|
+
"url": "https://gateway.pipeworx.io/global-fishing-watch/mcp"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### What this endpoint actually serves
|
|
92
|
+
|
|
93
|
+
`tools/list` at `https://gateway.pipeworx.io/global-fishing-watch/mcp` returns the tools in the table
|
|
94
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
95
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
96
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
97
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
98
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
99
|
+
is the authoritative answer for a given day.
|
|
100
|
+
|
|
101
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
102
|
+
scoped connection answer a question this pack does not cover — via
|
|
103
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
104
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
105
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
106
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
107
|
+
|
|
108
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
109
|
+
directly, instead of just this one's:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"mcpServers": {
|
|
114
|
+
"pipeworx": {
|
|
115
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Both URLs reach the same gateway and the same 1679+ data sources. The
|
|
122
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
123
|
+
reaches all of them from either one.
|
|
124
|
+
|
|
125
|
+
## No MCP client? Call it over HTTP
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/gfwfish_vessels_search \
|
|
129
|
+
-H 'Content-Type: application/json' \
|
|
130
|
+
-d '{"query":"ARCTIC LOON","limit":5}'
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/gfwfish_vessels_search`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
134
|
+
|
|
135
|
+
## Standalone (no gateway account)
|
|
136
|
+
|
|
137
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
138
|
+
gateway round-trip:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"mcpServers": {
|
|
143
|
+
"global-fishing-watch": {
|
|
144
|
+
"command": "npx",
|
|
145
|
+
"args": ["-y", "@pipeworx/mcp-global-fishing-watch"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Or run it directly to confirm it starts:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npx -y @pipeworx/mcp-global-fishing-watch
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
158
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
159
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
160
|
+
|
|
161
|
+
## Using with ask_pipeworx
|
|
162
|
+
|
|
163
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
164
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
ask_pipeworx({ question: "your question about Global Fishing Watch data" })
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
171
|
+
|
|
172
|
+
## More
|
|
173
|
+
|
|
174
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
175
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-global-fishing-watch",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Global Fishing Watch — AIS-derived fishing vessel identity, at-sea events (apparent fishing, vessel-to-vessel encounters, loitering, port visits, AIS gaps) and aggregated apparent fishing effort by flag, gear type and area.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-global-fishing-watch": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "global-fishing-watch"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-global-fishing-watch.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
},
|
|
28
|
+
"pipeworx": {
|
|
29
|
+
"sourceHash": "v1-26969b745dd3494f407b1a0d5ddc404745e7fb58590249deb537854db8ae3728",
|
|
30
|
+
"sourceCommit": "b0fb3c31386cf0256dcf1e2f1b3440435a87ec35"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/global-fishing-watch",
|
|
4
|
+
"title": "Global Fishing Watch",
|
|
5
|
+
"description": "Global Fishing Watch — AIS-derived fishing vessel identity, at-sea events (apparent fishing…",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/global-fishing-watch",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-global-fishing-watch",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/global-fishing-watch/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|