@pipeworx/mcp-hurricanes 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pipeworx
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,56 @@
1
+ # mcp-hurricanes
2
+
3
+ Hurricanes / tropical cyclones MCP.
4
+
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1191+ live data sources.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+ | `storm_details` | Full details for one active storm by id (e.g. "al052026") or name (e.g. "Douglas"), including all advisory/forecast/cone/surge product links. Keyless. |
12
+
13
+ ## Quick Start
14
+
15
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "hurricanes": {
21
+ "url": "https://gateway.pipeworx.io/hurricanes/mcp"
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ Or connect to the full Pipeworx gateway for access to all 1191+ data sources:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "pipeworx": {
33
+ "url": "https://gateway.pipeworx.io/mcp"
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## Using with ask_pipeworx
40
+
41
+ Instead of calling tools directly, you can ask questions in plain English:
42
+
43
+ ```
44
+ ask_pipeworx({ question: "your question about Hurricanes data" })
45
+ ```
46
+
47
+ The gateway picks the right tool and fills the arguments automatically.
48
+
49
+ ## More
50
+
51
+ - [All tools and guides](https://github.com/pipeworx-io/examples)
52
+ - [pipeworx.io](https://pipeworx.io)
53
+
54
+ ## License
55
+
56
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-hurricanes",
3
+ "version": "0.1.0",
4
+ "description": "Hurricanes / tropical cyclones MCP.",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "hurricanes"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-hurricanes"
13
+ },
14
+ "scripts": {
15
+ "typecheck": "tsc --noEmit"
16
+ },
17
+ "devDependencies": {
18
+ "typescript": "^5.7.0"
19
+ }
20
+ }
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/hurricanes",
4
+ "title": "Hurricanes",
5
+ "description": "Hurricanes / tropical cyclones MCP.",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/hurricanes",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-hurricanes",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/hurricanes/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,119 @@
1
+ interface McpToolDefinition {
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: 'object';
6
+ properties: Record<string, unknown>;
7
+ required?: string[];
8
+ };
9
+ }
10
+
11
+ interface McpToolExport {
12
+ tools: McpToolDefinition[];
13
+ callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
14
+ meter?: { credits: number };
15
+ cost?: Record<string, unknown>;
16
+ provider?: string;
17
+ }
18
+
19
+ /**
20
+ * Hurricanes / tropical cyclones MCP.
21
+ *
22
+ * Keyless: current active tropical cyclones from the US National Hurricane
23
+ * Center (NHC) — name, classification, Saffir-Simpson category, position,
24
+ * intensity, movement, and links to the official advisories/forecast cone.
25
+ * Free, no key. Atlantic + Eastern/Central Pacific basins.
26
+ */
27
+
28
+
29
+ const URL = 'https://www.nhc.noaa.gov/CurrentStorms.json';
30
+ const UA = 'pipeworx-mcp-hurricanes/1.0 (+https://pipeworx.io)';
31
+
32
+ const CLASS: Record<string, string> = {
33
+ TD: 'Tropical Depression', TS: 'Tropical Storm', HU: 'Hurricane', MH: 'Major Hurricane',
34
+ STD: 'Subtropical Depression', STS: 'Subtropical Storm', PTC: 'Potential Tropical Cyclone',
35
+ PC: 'Post-Tropical Cyclone', DB: 'Disturbance',
36
+ };
37
+ const BASIN: Record<string, string> = { al: 'Atlantic', ep: 'Eastern Pacific', cp: 'Central Pacific' };
38
+
39
+ function category(kt: number): string | null {
40
+ if (kt < 64) return null;
41
+ if (kt < 83) return 'Category 1';
42
+ if (kt < 96) return 'Category 2';
43
+ if (kt < 113) return 'Category 3';
44
+ if (kt < 137) return 'Category 4';
45
+ return 'Category 5';
46
+ }
47
+
48
+ function normalize(s: any) {
49
+ const kt = Number(s.intensity);
50
+ const basinCode = String(s.id ?? '').slice(0, 2).toLowerCase();
51
+ return {
52
+ id: s.id,
53
+ name: s.name,
54
+ basin: BASIN[basinCode] ?? basinCode.toUpperCase(),
55
+ classification: CLASS[s.classification] ?? s.classification,
56
+ saffir_simpson: category(kt),
57
+ max_sustained_winds_kt: kt,
58
+ max_sustained_winds_mph: Math.round(kt * 1.15078),
59
+ min_pressure_mb: s.pressure ? Number(s.pressure) : null,
60
+ position: { lat: s.latitudeNumeric, lon: s.longitudeNumeric, text: `${s.latitude} ${s.longitude}` },
61
+ movement: { direction_deg: s.movementDir, speed_kt: s.movementSpeed },
62
+ last_update: s.lastUpdate,
63
+ advisory_url: s.publicAdvisory?.url ?? null,
64
+ forecast_discussion_url: s.forecastDiscussion?.url ?? null,
65
+ forecast_track_url: s.forecastTrack?.url ?? null,
66
+ cone_url: s.trackCone?.url ?? null,
67
+ watches_warnings_url: s.windWatchesWarnings?.url ?? null,
68
+ };
69
+ }
70
+
71
+ async function fetchStorms(): Promise<any[]> {
72
+ const res = await fetch(URL, { headers: { Accept: 'application/json', 'User-Agent': UA } });
73
+ if (!res.ok) throw new Error(`NHC error: ${res.status} ${await res.text().then((t) => t.slice(0, 120))}`);
74
+ const j = (await res.json()) as { activeStorms?: any[] };
75
+ return j.activeStorms ?? [];
76
+ }
77
+
78
+ const tools: McpToolExport['tools'] = [
79
+ {
80
+ name: 'active_storms',
81
+ description:
82
+ 'List currently active tropical cyclones (tropical storms / hurricanes) from the US National Hurricane Center — name, classification, Saffir-Simpson category, position, max winds, pressure, movement, and links to official advisories/forecast cone. Filter by basin. Keyless. Returns an empty list in the off-season.',
83
+ inputSchema: { type: 'object', properties: { basin: { type: 'string', description: 'Optional filter: "atlantic", "eastern-pacific", or "central-pacific".' } } },
84
+ },
85
+ {
86
+ name: 'storm_details',
87
+ description: 'Full details for one active storm by id (e.g. "al052026") or name (e.g. "Douglas"), including all advisory/forecast/cone/surge product links. Keyless.',
88
+ inputSchema: { type: 'object', properties: { storm: { type: 'string', description: 'Storm id or name.' } }, required: ['storm'] },
89
+ },
90
+ ];
91
+
92
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
93
+ const storms = await fetchStorms();
94
+ switch (name) {
95
+ case 'active_storms': {
96
+ let list = storms.map(normalize);
97
+ const basin = typeof args.basin === 'string' ? args.basin.toLowerCase().replace(/[\s_]/g, '-') : '';
98
+ const wanted: Record<string, string> = { atlantic: 'Atlantic', 'eastern-pacific': 'Eastern Pacific', 'central-pacific': 'Central Pacific' };
99
+ if (basin && wanted[basin]) list = list.filter((s) => s.basin === wanted[basin]);
100
+ return { count: list.length, storms: list, note: list.length ? undefined : 'No active tropical cyclones right now (or none in that basin).' };
101
+ }
102
+ case 'storm_details': {
103
+ const q = reqStr(args, 'storm', '"al052026"').toLowerCase();
104
+ const raw = storms.find((s: any) => String(s.id).toLowerCase() === q || String(s.name).toLowerCase() === q);
105
+ if (!raw) return { query: args.storm, found: false, reason: 'No active storm with that id/name. Use active_storms to list current storms.' };
106
+ return { found: true, ...normalize(raw), advisory_number: raw.publicAdvisory?.advNum ?? null, wind_speed_probabilities_url: raw.windSpeedProbabilities?.url ?? null, storm_surge_watch_warning_url: raw.stormSurgeWatchWarningGIS?.url ?? null };
107
+ }
108
+ default:
109
+ throw new Error(`Unknown tool: ${name}`);
110
+ }
111
+ }
112
+
113
+ function reqStr(args: Record<string, unknown>, key: string, ex: string): string {
114
+ const v = args[key];
115
+ if (typeof v !== 'string' || !v.trim()) throw new Error(`Required argument "${key}" is missing. Pass a string like ${ex}.`);
116
+ return v;
117
+ }
118
+
119
+ export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ "outDir": "dist",
10
+ "rootDir": "src",
11
+ "declaration": true
12
+ },
13
+ "include": ["src"]
14
+ }