@pipeworx/mcp-aviation-weather 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,63 @@
1
+ # mcp-aviation-weather
2
+
3
+ Aviation Weather MCP — METAR, TAF, PIREPs, AIRMET/SIGMET, station info
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
+ | `metar` | METAR observations. ids = comma-sep ICAO codes (KSFO,EGLL,LFPG). |
12
+ | `taf` | Terminal Aerodrome Forecasts. |
13
+ | `pirep` | Pilot reports. Optional id (station), age (hours), distance (NM), level (flight level). |
14
+ | `sigmet` | Currently active SIGMETs. |
15
+ | `airmet` | Currently active AIRMETs. |
16
+ | `gairmet` | Graphical AIRMETs. |
17
+ | `windsaloft` | Winds aloft forecast. |
18
+ | `stationinfo` | Aerodrome metadata — lat/lon, elevation, country. |
19
+
20
+ ## Quick Start
21
+
22
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "aviation-weather": {
28
+ "url": "https://gateway.pipeworx.io/aviation-weather/mcp"
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Or connect to the full Pipeworx gateway for access to all 250+ data sources:
35
+
36
+ ```json
37
+ {
38
+ "mcpServers": {
39
+ "pipeworx": {
40
+ "url": "https://gateway.pipeworx.io/mcp"
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ ## Using with ask_pipeworx
47
+
48
+ Instead of calling tools directly, you can ask questions in plain English:
49
+
50
+ ```
51
+ ask_pipeworx({ question: "your question about Aviation Weather data" })
52
+ ```
53
+
54
+ The gateway picks the right tool and fills the arguments automatically.
55
+
56
+ ## More
57
+
58
+ - [All tools and guides](https://github.com/pipeworx-io/examples)
59
+ - [pipeworx.io](https://pipeworx.io)
60
+
61
+ ## License
62
+
63
+ MIT
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@pipeworx/mcp-aviation-weather",
3
+ "version": "0.1.0",
4
+ "description": "Aviation Weather MCP — METAR, TAF, PIREPs, AIRMET/SIGMET, station info",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "aviation-weather"],
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/pipeworx-io/mcp-aviation-weather"
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/aviation-weather",
4
+ "title": "Aviation Weather",
5
+ "description": "Aviation Weather MCP — METAR, TAF, PIREPs, AIRMET/SIGMET, station info",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/aviation-weather",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-aviation-weather",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/aviation-weather/mcp"
16
+ }
17
+ ]
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,201 @@
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
+ * Aviation Weather MCP — METAR, TAF, PIREPs, AIRMET/SIGMET, station info
21
+ *
22
+ * Source: aviationweather.gov (US NWS Aviation Weather Center).
23
+ * Auth: none.
24
+ *
25
+ * Most endpoints accept format=json; some only return raw text — we still
26
+ * return them wrapped as { format, body }.
27
+ */
28
+
29
+
30
+ const BASE = 'https://aviationweather.gov/api/data';
31
+
32
+ const tools: McpToolExport['tools'] = [
33
+ {
34
+ name: 'metar',
35
+ description: 'METAR observations. ids = comma-sep ICAO codes (KSFO,EGLL,LFPG).',
36
+ inputSchema: {
37
+ type: 'object',
38
+ properties: {
39
+ ids: { type: 'string', description: 'Comma-separated ICAO airport codes' },
40
+ hours_before: { type: 'number', description: 'How far back to look, 1-24 (default 1)' },
41
+ format: { type: 'string', description: 'json (default) | raw | xml | html' },
42
+ },
43
+ required: ['ids'],
44
+ },
45
+ },
46
+ {
47
+ name: 'taf',
48
+ description: 'Terminal Aerodrome Forecasts.',
49
+ inputSchema: {
50
+ type: 'object',
51
+ properties: {
52
+ ids: { type: 'string', description: 'Comma-separated ICAO codes' },
53
+ hours_before: { type: 'number', description: '1-24 (default 12)' },
54
+ format: { type: 'string', description: 'json (default) | raw' },
55
+ },
56
+ required: ['ids'],
57
+ },
58
+ },
59
+ {
60
+ name: 'pirep',
61
+ description: 'Pilot reports. Optional id (station), age (hours), distance (NM), level (flight level).',
62
+ inputSchema: {
63
+ type: 'object',
64
+ properties: {
65
+ id: { type: 'string', description: 'Center station for proximity filter' },
66
+ age: { type: 'number', description: 'Lookback hours, default 1.5' },
67
+ distance_nm: { type: 'number', description: 'Distance from id in nautical miles, default 200' },
68
+ level: { type: 'number', description: 'Flight level filter (FL310 = 310)' },
69
+ format: { type: 'string', description: 'json (default) | raw' },
70
+ },
71
+ },
72
+ },
73
+ {
74
+ name: 'sigmet',
75
+ description: 'Currently active SIGMETs.',
76
+ inputSchema: {
77
+ type: 'object',
78
+ properties: { format: { type: 'string', description: 'json (default) | raw' } },
79
+ },
80
+ },
81
+ {
82
+ name: 'airmet',
83
+ description: 'Currently active AIRMETs.',
84
+ inputSchema: {
85
+ type: 'object',
86
+ properties: { format: { type: 'string' } },
87
+ },
88
+ },
89
+ {
90
+ name: 'gairmet',
91
+ description: 'Graphical AIRMETs.',
92
+ inputSchema: {
93
+ type: 'object',
94
+ properties: {
95
+ type: { type: 'string', description: 'turb | ice | sfc_winds | lifr | ifr (default any)' },
96
+ format: { type: 'string' },
97
+ },
98
+ },
99
+ },
100
+ {
101
+ name: 'windsaloft',
102
+ description: 'Winds aloft forecast.',
103
+ inputSchema: {
104
+ type: 'object',
105
+ properties: {
106
+ region: { type: 'string', description: 'us | bos | mia | chi | dfw | slc | sfo | alaska' },
107
+ level: { type: 'string', description: 'low | high (default low)' },
108
+ },
109
+ },
110
+ },
111
+ {
112
+ name: 'stationinfo',
113
+ description: 'Aerodrome metadata — lat/lon, elevation, country.',
114
+ inputSchema: {
115
+ type: 'object',
116
+ properties: { ids: { type: 'string', description: 'Comma-separated ICAO codes' } },
117
+ required: ['ids'],
118
+ },
119
+ },
120
+ ];
121
+
122
+ async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
123
+ switch (name) {
124
+ case 'metar':
125
+ return fetchAW('/metar', {
126
+ ids: reqStr(args, 'ids', '"KSFO"'),
127
+ hours: String((args.hours_before as number) ?? 1),
128
+ format: String(args.format ?? 'json'),
129
+ });
130
+ case 'taf':
131
+ return fetchAW('/taf', {
132
+ ids: reqStr(args, 'ids', '"KSFO"'),
133
+ hours: String((args.hours_before as number) ?? 12),
134
+ format: String(args.format ?? 'json'),
135
+ });
136
+ case 'pirep': {
137
+ const params: Record<string, string> = { format: String(args.format ?? 'json') };
138
+ if (args.id) params.id = String(args.id);
139
+ if (args.age !== undefined) params.age = String(args.age);
140
+ if (args.distance_nm !== undefined) params.distance = String(args.distance_nm);
141
+ if (args.level !== undefined) params.level = String(args.level);
142
+ return fetchAW('/pirep', params);
143
+ }
144
+ case 'sigmet':
145
+ return fetchAW('/airsigmet', { hazard: 'sigmet', format: String(args.format ?? 'json') });
146
+ case 'airmet':
147
+ return fetchAW('/airsigmet', { hazard: 'airmet', format: String(args.format ?? 'json') });
148
+ case 'gairmet': {
149
+ const params: Record<string, string> = { format: String(args.format ?? 'json') };
150
+ if (args.type) params.type = String(args.type);
151
+ return fetchAW('/gairmet', params);
152
+ }
153
+ case 'windsaloft': {
154
+ const params: Record<string, string> = {
155
+ region: String(args.region ?? 'us'),
156
+ level: String(args.level ?? 'low'),
157
+ };
158
+ return fetchAW('/windtemp', params);
159
+ }
160
+ case 'stationinfo':
161
+ return fetchAW('/stationinfo', {
162
+ ids: reqStr(args, 'ids', '"KSFO"'),
163
+ format: 'json',
164
+ });
165
+ default:
166
+ throw new Error(`Unknown tool: ${name}`);
167
+ }
168
+ }
169
+
170
+ async function fetchAW(path: string, paramsObj: Record<string, string>) {
171
+ const params = new URLSearchParams(paramsObj);
172
+ const url = `${BASE}${path}?${params}`;
173
+ const res = await fetch(url, {
174
+ headers: { 'User-Agent': 'pipeworx-mcp-aviation-weather/1.0 (+https://pipeworx.io)' },
175
+ });
176
+ if (!res.ok) {
177
+ const t = await res.text();
178
+ throw new Error(`Aviation Weather error: ${res.status} ${t.slice(0, 200)}`);
179
+ }
180
+ const format = paramsObj.format ?? 'json';
181
+ if (format === 'json') {
182
+ try {
183
+ return await res.json();
184
+ } catch {
185
+ const text = await res.text();
186
+ return { format: 'raw', body: text };
187
+ }
188
+ }
189
+ const text = await res.text();
190
+ return { format, body: text };
191
+ }
192
+
193
+ function reqStr(args: Record<string, unknown>, key: string, example: string): string {
194
+ const v = args[key];
195
+ if (typeof v !== 'string' || !v.trim()) {
196
+ throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
197
+ }
198
+ return v;
199
+ }
200
+
201
+ 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
+ }