@pipeworx/mcp-usgs-volcano 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,55 @@
1
+ # mcp-usgs-volcano
2
+
3
+ USGS Volcano MCP — Volcano Hazards Program HANS-public feed (no auth)
4
+
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Description |
10
+ |------|-------------|
11
+
12
+ ## Quick Start
13
+
14
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
15
+
16
+ ```json
17
+ {
18
+ "mcpServers": {
19
+ "usgs-volcano": {
20
+ "url": "https://gateway.pipeworx.io/usgs-volcano/mcp"
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Or connect to the full Pipeworx gateway for access to all 250+ data sources:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "pipeworx": {
32
+ "url": "https://gateway.pipeworx.io/mcp"
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ ## Using with ask_pipeworx
39
+
40
+ Instead of calling tools directly, you can ask questions in plain English:
41
+
42
+ ```
43
+ ask_pipeworx({ question: "your question about Usgs Volcano data" })
44
+ ```
45
+
46
+ The gateway picks the right tool and fills the arguments automatically.
47
+
48
+ ## More
49
+
50
+ - [All tools and guides](https://github.com/pipeworx-io/examples)
51
+ - [pipeworx.io](https://pipeworx.io)
52
+
53
+ ## License
54
+
55
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-usgs-volcano",
3
+ "version": "0.1.0",
4
+ "description": "USGS Volcano MCP — Volcano Hazards Program HANS-public feed (no auth)",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "usgs-volcano"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-usgs-volcano"
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/usgs-volcano",
4
+ "title": "Usgs Volcano",
5
+ "description": "USGS Volcano MCP — Volcano Hazards Program HANS-public feed (no auth)",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/usgs-volcano",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-usgs-volcano",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/usgs-volcano/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,204 @@
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
+ * USGS Volcano MCP — Volcano Hazards Program HANS-public feed (no auth)
21
+ *
22
+ * Sister to `usgs-earthquake`. Tracks alert status for ~170 US volcanoes
23
+ * (CONUS, Alaska, Hawaii, Northern Marianas) plus current notices and
24
+ * historic eruption metadata. Pairs nicely with `nws.get_alerts` for
25
+ * ash-cloud warnings.
26
+ *
27
+ * API: https://volcanoes.usgs.gov/hans-public/api/
28
+ * Tools:
29
+ * - list_volcanoes: every US volcano with current alert + color codes
30
+ * - list_elevated: volcanoes currently above "Normal/Green" status
31
+ * - list_notices: recent volcano alert notices (VAN / VONA)
32
+ */
33
+
34
+
35
+ const BASE_URL = 'https://volcanoes.usgs.gov/hans-public/api';
36
+
37
+ const tools: McpToolExport['tools'] = [
38
+ {
39
+ name: 'list_volcanoes',
40
+ description:
41
+ 'List every US volcano monitored by USGS with current alert level (Normal/Advisory/Watch/Warning) and aviation color code (Green/Yellow/Orange/Red). Filter optionally by observatory.',
42
+ inputSchema: {
43
+ type: 'object',
44
+ properties: {
45
+ observatory: {
46
+ type: 'string',
47
+ description: 'Observatory short code (AVO=Alaska, CVO=Cascades, YVO=Yellowstone, HVO=Hawaiian, CalVO=California). Optional.',
48
+ },
49
+ },
50
+ required: [],
51
+ },
52
+ },
53
+ {
54
+ name: 'list_elevated',
55
+ description:
56
+ 'List only the volcanoes currently above Normal/Green status (i.e., elevated unrest or eruption). Smallest practical fingerprint of "what\'s happening right now."',
57
+ inputSchema: { type: 'object', properties: {}, required: [] },
58
+ },
59
+ {
60
+ name: 'list_notices',
61
+ description:
62
+ 'Recent USGS volcano notices and reports — observatory updates, VAN (Volcano Activity Notice) and VONA (Volcano Observatory Notice for Aviation) text. Filter by volcano slug.',
63
+ inputSchema: {
64
+ type: 'object',
65
+ properties: {
66
+ volcano_slug: {
67
+ type: 'string',
68
+ description: 'USGS volcano slug (e.g., "kilauea", "shishaldin"). Optional — omit for all recent.',
69
+ },
70
+ limit: { type: 'number', description: 'Cap notices returned (default 50)' },
71
+ },
72
+ required: [],
73
+ },
74
+ },
75
+ ];
76
+
77
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
78
+ switch (name) {
79
+ case 'list_volcanoes':
80
+ return listVolcanoes(args.observatory as string | undefined);
81
+ case 'list_elevated':
82
+ return listElevated();
83
+ case 'list_notices':
84
+ return listNotices(args.volcano_slug as string | undefined, (args.limit as number) ?? 50);
85
+ default:
86
+ throw new Error(`Unknown tool: ${name}`);
87
+ }
88
+ }
89
+
90
+ async function hansFetch<T>(path: string): Promise<T> {
91
+ const res = await fetch(`${BASE_URL}${path}`, { headers: { Accept: 'application/json' } });
92
+ if (!res.ok) {
93
+ const body = await res.text();
94
+ throw new Error(`USGS HANS error: ${res.status} ${body.slice(0, 200)}`);
95
+ }
96
+ return res.json() as Promise<T>;
97
+ }
98
+
99
+ interface VolcanoRecord {
100
+ volcano_name?: string;
101
+ url_name?: string;
102
+ observatory?: string;
103
+ alert_level?: string;
104
+ color_code?: string;
105
+ obs_abbr?: string;
106
+ latitude?: number;
107
+ longitude?: number;
108
+ elevation?: number;
109
+ vnum?: string;
110
+ synonyms?: string;
111
+ alert_url?: string;
112
+ alert_message?: string;
113
+ date_modified?: string;
114
+ }
115
+
116
+ function normalizeVolcano(v: VolcanoRecord) {
117
+ return {
118
+ name: v.volcano_name ?? null,
119
+ slug: v.url_name ?? null,
120
+ observatory: v.observatory ?? v.obs_abbr ?? null,
121
+ alert_level: v.alert_level ?? null,
122
+ color_code: v.color_code ?? null,
123
+ latitude: v.latitude ?? null,
124
+ longitude: v.longitude ?? null,
125
+ elevation_m: v.elevation ?? null,
126
+ vnum: v.vnum ?? null,
127
+ synonyms: v.synonyms ?? null,
128
+ alert_message: v.alert_message ?? null,
129
+ alert_url: v.alert_url ?? null,
130
+ modified: v.date_modified ?? null,
131
+ };
132
+ }
133
+
134
+ async function listVolcanoes(observatory: string | undefined) {
135
+ const data = await hansFetch<VolcanoRecord[]>('/volcano/getAllVolcanoes');
136
+ const all = (data ?? []).map(normalizeVolcano);
137
+ const filtered = observatory
138
+ ? all.filter(
139
+ (v) => v.observatory?.toLowerCase() === observatory.toLowerCase(),
140
+ )
141
+ : all;
142
+ return {
143
+ total: all.length,
144
+ returned: filtered.length,
145
+ volcanoes: filtered,
146
+ };
147
+ }
148
+
149
+ async function listElevated() {
150
+ const data = await hansFetch<VolcanoRecord[]>('/elevated/getElevatedVolcanoes');
151
+ const list = (data ?? []).map(normalizeVolcano);
152
+ return {
153
+ count: list.length,
154
+ note: 'All volcanoes currently above Normal/Green status (advisories, watches, or warnings).',
155
+ volcanoes: list,
156
+ };
157
+ }
158
+
159
+ interface NoticeRecord {
160
+ notice_id?: string;
161
+ volcano_name?: string;
162
+ url_name?: string;
163
+ observatory?: string;
164
+ message_type?: string;
165
+ alert_level?: string;
166
+ color_code?: string;
167
+ sent_utc?: string;
168
+ date_modified?: string;
169
+ url?: string;
170
+ summary?: string;
171
+ full_message?: string;
172
+ }
173
+
174
+ function normalizeNotice(n: NoticeRecord) {
175
+ return {
176
+ id: n.notice_id ?? null,
177
+ volcano: n.volcano_name ?? null,
178
+ slug: n.url_name ?? null,
179
+ observatory: n.observatory ?? null,
180
+ type: n.message_type ?? null,
181
+ alert_level: n.alert_level ?? null,
182
+ color_code: n.color_code ?? null,
183
+ sent_utc: n.sent_utc ?? n.date_modified ?? null,
184
+ summary: n.summary ?? null,
185
+ message: n.full_message ?? null,
186
+ url: n.url ?? null,
187
+ };
188
+ }
189
+
190
+ async function listNotices(volcanoSlug: string | undefined, limit: number) {
191
+ // The HANS notices endpoint accepts the slug directly when filtering one volcano.
192
+ const path = volcanoSlug
193
+ ? `/notice/getVolcanoNotices?volcano=${encodeURIComponent(volcanoSlug)}`
194
+ : '/notice/getNotices';
195
+ const data = await hansFetch<NoticeRecord[]>(path);
196
+ const list = (data ?? []).slice(0, Math.max(1, limit)).map(normalizeNotice);
197
+ return {
198
+ volcano_slug: volcanoSlug ?? null,
199
+ count: list.length,
200
+ notices: list,
201
+ };
202
+ }
203
+
204
+ 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
+ }