@squawk/mcp 0.6.0 → 0.8.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/README.md +21 -16
- package/dist/tools/airspace.d.ts.map +1 -1
- package/dist/tools/airspace.js +56 -0
- package/dist/tools/weather.d.ts.map +1 -1
- package/dist/tools/weather.js +62 -2
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -98,7 +98,7 @@ version explicitly in the client config:
|
|
|
98
98
|
"mcpServers": {
|
|
99
99
|
"squawk": {
|
|
100
100
|
"command": "npx",
|
|
101
|
-
"args": ["-y", "@squawk/mcp@0.
|
|
101
|
+
"args": ["-y", "@squawk/mcp@0.8.0"]
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -209,9 +209,12 @@ directly.
|
|
|
209
209
|
|
|
210
210
|
### Airspace (`@squawk/airspace` + `@squawk/airspace-data`)
|
|
211
211
|
|
|
212
|
-
| Tool | Purpose
|
|
213
|
-
| ---------------------------- |
|
|
214
|
-
| `query_airspace_at_position` | Class B/C/D/E and
|
|
212
|
+
| Tool | Purpose |
|
|
213
|
+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
214
|
+
| `query_airspace_at_position` | Class B/C/D/E, SUA, and ARTCC features whose lateral polygon and vertical bounds contain a point + altitude |
|
|
215
|
+
| `get_airspace_for_airport` | Class B/C/D/E2 surface-area sectors associated with an airport, with full polygon boundaries |
|
|
216
|
+
| `find_artcc_for_position` | US ARTCC features containing a given position and altitude (typically one feature; multiple for oceanic CTA+FIR overlaps or stratum boundaries) |
|
|
217
|
+
| `find_artcc_by_identifier` | All ARTCC features for a 3-letter center code (e.g. "ZNY"), optionally narrowed to a single stratum, with full polygon boundaries |
|
|
215
218
|
|
|
216
219
|
### Navaids (`@squawk/navaids` + `@squawk/navaid-data`)
|
|
217
220
|
|
|
@@ -264,18 +267,20 @@ do not pay the decompression cost.
|
|
|
264
267
|
|
|
265
268
|
### Weather (`@squawk/weather` + `@squawk/weather/fetch`)
|
|
266
269
|
|
|
267
|
-
| Tool | Purpose
|
|
268
|
-
| ----------------------------- |
|
|
269
|
-
| `parse_metar` | Parse a user-supplied METAR/SPECI string
|
|
270
|
-
| `parse_taf` | Parse a user-supplied TAF
|
|
271
|
-
| `parse_sigmet` | Parse a US-domestic or ICAO SIGMET
|
|
272
|
-
| `parse_airmet` | Parse an AIRMET bulletin
|
|
273
|
-
| `parse_pirep` | Parse a PIREP report
|
|
274
|
-
| `
|
|
275
|
-
| `
|
|
276
|
-
| `
|
|
277
|
-
| `
|
|
278
|
-
| `
|
|
270
|
+
| Tool | Purpose |
|
|
271
|
+
| ----------------------------- | ------------------------------------------------------------------- |
|
|
272
|
+
| `parse_metar` | Parse a user-supplied METAR/SPECI string |
|
|
273
|
+
| `parse_taf` | Parse a user-supplied TAF |
|
|
274
|
+
| `parse_sigmet` | Parse a US-domestic or ICAO SIGMET |
|
|
275
|
+
| `parse_airmet` | Parse an AIRMET bulletin |
|
|
276
|
+
| `parse_pirep` | Parse a PIREP report |
|
|
277
|
+
| `parse_winds_aloft` | Parse an FD (winds and temperatures aloft) bulletin |
|
|
278
|
+
| `fetch_metar` | Fetch and parse live METARs from the Aviation Weather Center |
|
|
279
|
+
| `fetch_taf` | Fetch and parse live TAFs |
|
|
280
|
+
| `fetch_pirep` | Fetch PIREPs near a center station |
|
|
281
|
+
| `fetch_sigmets` | Fetch active US (CONUS) SIGMETs, optionally filtered by hazard |
|
|
282
|
+
| `fetch_international_sigmets` | Fetch active international SIGMETs in ICAO format |
|
|
283
|
+
| `fetch_winds_aloft` | Fetch and parse a live FD winds-aloft forecast by region and period |
|
|
279
284
|
|
|
280
285
|
### NOTAMs (`@squawk/notams`)
|
|
281
286
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"airspace.d.ts","sourceRoot":"","sources":["../../src/tools/airspace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"airspace.d.ts","sourceRoot":"","sources":["../../src/tools/airspace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiFzE;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmI7D"}
|
package/dist/tools/airspace.js
CHANGED
|
@@ -23,6 +23,16 @@ const AIRSPACE_TYPE_VALUES = [
|
|
|
23
23
|
'WARNING',
|
|
24
24
|
'ALERT',
|
|
25
25
|
'NSA',
|
|
26
|
+
'ARTCC',
|
|
27
|
+
];
|
|
28
|
+
/** All {@link ArtccStratum} values, used for input validation. */
|
|
29
|
+
const ARTCC_STRATUM_VALUES = [
|
|
30
|
+
'LOW',
|
|
31
|
+
'HIGH',
|
|
32
|
+
'UTA',
|
|
33
|
+
'CTA',
|
|
34
|
+
'FIR',
|
|
35
|
+
'CTA/FIR',
|
|
26
36
|
];
|
|
27
37
|
/**
|
|
28
38
|
* Strips the polygon boundary from a feature for tool output. The boundary
|
|
@@ -43,6 +53,7 @@ function summarizeFeature(feature) {
|
|
|
43
53
|
state: feature.state,
|
|
44
54
|
controllingFacility: feature.controllingFacility,
|
|
45
55
|
scheduleDescription: feature.scheduleDescription,
|
|
56
|
+
artccStratum: feature.artccStratum,
|
|
46
57
|
vertexCount: ring.length,
|
|
47
58
|
};
|
|
48
59
|
}
|
|
@@ -109,4 +120,49 @@ export function registerAirspaceTools(server) {
|
|
|
109
120
|
structuredContent: { airport, features },
|
|
110
121
|
};
|
|
111
122
|
});
|
|
123
|
+
server.registerTool('find_artcc_for_position', {
|
|
124
|
+
title: 'Find the ARTCC center containing a position and altitude',
|
|
125
|
+
description: 'Returns the US Air Route Traffic Control Center (ARTCC) features whose lateral boundary contains the given position at the given altitude. Typically returns a single feature (one center, one stratum), but can return multiple in three cases: (1) oceanic positions covered by overlapping CTA and FIR strata; (2) positions exactly at a stratum boundary (e.g. FL180 matches both LOW and HIGH); (3) antimeridian-split centers like ZAK where a stratum is published as multiple sub-polygons that each cover part of the same geographic area. If the position falls outside any US ARTCC, returns an empty features array. Boundary geometry is summarized as a vertex count to keep responses compact - use find_artcc_by_identifier to retrieve full polygons.',
|
|
126
|
+
inputSchema: {
|
|
127
|
+
lat: z.number().min(-90).max(90).describe('Latitude in decimal degrees (WGS84).'),
|
|
128
|
+
lon: z.number().min(-180).max(180).describe('Longitude in decimal degrees (WGS84).'),
|
|
129
|
+
altitudeFt: z
|
|
130
|
+
.number()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Altitude in feet MSL. Defaults to 0 (surface), which selects the LOW stratum where applicable. Pass FL180+ to target HIGH or FL600+ to target UTA.'),
|
|
133
|
+
},
|
|
134
|
+
}, ({ lat, lon, altitudeFt }) => {
|
|
135
|
+
const query = {
|
|
136
|
+
lat,
|
|
137
|
+
lon,
|
|
138
|
+
altitudeFt: altitudeFt ?? 0,
|
|
139
|
+
types: new Set(['ARTCC']),
|
|
140
|
+
};
|
|
141
|
+
const features = airspaceResolver.query(query).map(summarizeFeature);
|
|
142
|
+
return {
|
|
143
|
+
content: [{ type: 'text', text: JSON.stringify({ features }, null, 2) }],
|
|
144
|
+
structuredContent: { features },
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
server.registerTool('find_artcc_by_identifier', {
|
|
148
|
+
title: 'Find ARTCC features for a center identifier',
|
|
149
|
+
description: 'Returns every ARTCC feature for the given three-letter center code (e.g. "ZNY", "ZBW", "ZAK"), with full polygon boundary coordinates suitable for drawing. Each US center is published as multiple features (one per stratum: LOW, HIGH, plus oceanic UTA/CTA/FIR), all returned by default. A single stratum can map to more than one feature when the source data has multiple disjoint shapes (e.g. ZOA UTA spans four oceanic delegation areas) or when antimeridian-crossing shapes are split into eastern and western sub-polygons (ZAK and ZAP). Pass a stratum filter to narrow results. Lookup is case-insensitive. Returns an empty features array for unknown identifiers.',
|
|
150
|
+
inputSchema: {
|
|
151
|
+
artccId: z
|
|
152
|
+
.string()
|
|
153
|
+
.min(3)
|
|
154
|
+
.max(3)
|
|
155
|
+
.describe('Three-letter ARTCC center code (e.g. "ZNY", "ZBW").'),
|
|
156
|
+
stratum: z
|
|
157
|
+
.enum(ARTCC_STRATUM_VALUES)
|
|
158
|
+
.optional()
|
|
159
|
+
.describe('Restrict to a single stratum (LOW, HIGH, UTA, CTA, FIR, or CTA/FIR). Omit to return every published stratum for the center.'),
|
|
160
|
+
},
|
|
161
|
+
}, ({ artccId, stratum }) => {
|
|
162
|
+
const features = airspaceResolver.byArtcc(artccId, stratum);
|
|
163
|
+
return {
|
|
164
|
+
content: [{ type: 'text', text: JSON.stringify({ features }, null, 2) }],
|
|
165
|
+
structuredContent: { features },
|
|
166
|
+
};
|
|
167
|
+
});
|
|
112
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../src/tools/weather.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../src/tools/weather.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwFzE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgS5D"}
|
package/dist/tools/weather.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* and return both the parsed records and any per-record parse errors so the
|
|
9
9
|
* model can surface partial failures.
|
|
10
10
|
*/
|
|
11
|
-
import { parseAirmet, parseMetar, parsePirep, parseSigmet, parseTaf } from '@squawk/weather';
|
|
12
|
-
import { fetchInternationalSigmets, fetchMetar, fetchPirep, fetchSigmets, fetchTaf, } from '@squawk/weather/fetch';
|
|
11
|
+
import { parseAirmet, parseMetar, parsePirep, parseSigmet, parseTaf, parseWindsAloft, } from '@squawk/weather';
|
|
12
|
+
import { fetchInternationalSigmets, fetchMetar, fetchPirep, fetchSigmets, fetchTaf, fetchWindsAloft, } from '@squawk/weather/fetch';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { runParser, summarizeParseErrors } from './tool-helpers.js';
|
|
15
15
|
/** Allowed values for the AWC SIGMET hazard filter. */
|
|
@@ -25,6 +25,24 @@ const PIREP_INTENSITY_VALUES = [
|
|
|
25
25
|
'mod',
|
|
26
26
|
'sev',
|
|
27
27
|
];
|
|
28
|
+
/** Allowed geographic regions for the AWC winds-aloft (FD) endpoint. */
|
|
29
|
+
const WINDS_ALOFT_REGION_VALUES = [
|
|
30
|
+
'contiguousUs',
|
|
31
|
+
'northeast',
|
|
32
|
+
'southeast',
|
|
33
|
+
'northCentral',
|
|
34
|
+
'southCentral',
|
|
35
|
+
'rockyMountain',
|
|
36
|
+
'pacificCoast',
|
|
37
|
+
'alaska',
|
|
38
|
+
'hawaii',
|
|
39
|
+
'westernPacific',
|
|
40
|
+
];
|
|
41
|
+
/** Allowed altitude bands for the AWC winds-aloft (FD) endpoint. */
|
|
42
|
+
const WINDS_ALOFT_ALTITUDE_BAND_VALUES = [
|
|
43
|
+
'low',
|
|
44
|
+
'high',
|
|
45
|
+
];
|
|
28
46
|
/**
|
|
29
47
|
* Optional override for the Aviation Weather Center base URL. Read once at
|
|
30
48
|
* module load from the `SQUAWK_AWC_BASE_URL` environment variable. When set,
|
|
@@ -92,6 +110,13 @@ export function registerWeatherTools(server) {
|
|
|
92
110
|
raw: z.string().min(1).describe('Raw PIREP report text.'),
|
|
93
111
|
},
|
|
94
112
|
}, ({ raw }) => runParser(raw, parsePirep, 'pirep'));
|
|
113
|
+
server.registerTool('parse_winds_aloft', {
|
|
114
|
+
title: 'Parse a winds-aloft (FD) forecast bulletin',
|
|
115
|
+
description: 'Parses a raw FD (Forecast Winds and Temperatures Aloft) bulletin - sometimes referred to by its older name "FB" - into a structured object with the issue time, valid time, usable period, altitude columns, and per-station forecast levels. Each level includes wind direction, wind speed, and (usually) temperature; light-and-variable winds are flagged, missing columns are flagged, and temperatures above the "TEMPS NEG ABV" threshold are decoded from the implicit-negative wire format.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
raw: z.string().min(1).describe('Raw FD bulletin text.'),
|
|
118
|
+
},
|
|
119
|
+
}, ({ raw }) => runParser(raw, parseWindsAloft, 'windsAloft'));
|
|
95
120
|
// ---------------------------------------------------------------------------
|
|
96
121
|
// Fetch (Aviation Weather Center text API)
|
|
97
122
|
// ---------------------------------------------------------------------------
|
|
@@ -212,4 +237,39 @@ export function registerWeatherTools(server) {
|
|
|
212
237
|
structuredContent: payload,
|
|
213
238
|
};
|
|
214
239
|
});
|
|
240
|
+
server.registerTool('fetch_winds_aloft', {
|
|
241
|
+
title: 'Fetch a winds-aloft (FD) forecast from the Aviation Weather Center',
|
|
242
|
+
description: 'Fetches a winds-aloft forecast (FD product) from the Aviation Weather Center text API and parses the response. Returns a single parsed bulletin covering many reporting stations at several altitudes. All three inputs (region, altitudeBand, forecastHours) are optional - omit them to let AWC apply its own defaults.',
|
|
243
|
+
inputSchema: {
|
|
244
|
+
region: z
|
|
245
|
+
.enum(WINDS_ALOFT_REGION_VALUES)
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Optional geographic region. "contiguousUs" covers all 48 contiguous US sites; the per-center regions ("northeast", "southeast", "northCentral", "southCentral", "rockyMountain", "pacificCoast") cover subsets. "alaska", "hawaii", and "westernPacific" are separate regions.'),
|
|
248
|
+
altitudeBand: z
|
|
249
|
+
.enum(WINDS_ALOFT_ALTITUDE_BAND_VALUES)
|
|
250
|
+
.optional()
|
|
251
|
+
.describe('Optional altitude band. "low" covers 3000-39000 ft (9 altitude columns); "high" covers FL450 and above (typically 45000 and 53000 ft).'),
|
|
252
|
+
forecastHours: z
|
|
253
|
+
.union([z.literal(6), z.literal(12), z.literal(24)])
|
|
254
|
+
.optional()
|
|
255
|
+
.describe('Optional forecast horizon in hours from issue time. Must be 6, 12, or 24.'),
|
|
256
|
+
},
|
|
257
|
+
}, async ({ region, altitudeBand, forecastHours }) => {
|
|
258
|
+
const options = baseFetchOptions();
|
|
259
|
+
if (region !== undefined) {
|
|
260
|
+
options.region = region;
|
|
261
|
+
}
|
|
262
|
+
if (altitudeBand !== undefined) {
|
|
263
|
+
options.altitudeBand = altitudeBand;
|
|
264
|
+
}
|
|
265
|
+
if (forecastHours !== undefined) {
|
|
266
|
+
options.forecastHours = forecastHours;
|
|
267
|
+
}
|
|
268
|
+
const { forecast } = await fetchWindsAloft(options);
|
|
269
|
+
const payload = { forecast };
|
|
270
|
+
return {
|
|
271
|
+
content: [{ type: 'text', text: JSON.stringify(payload, null, 2) }],
|
|
272
|
+
structuredContent: payload,
|
|
273
|
+
};
|
|
274
|
+
});
|
|
215
275
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squawk/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Model Context Protocol server exposing squawk's aviation libraries as tools for LLM clients",
|
|
6
6
|
"author": "Neil Cochran",
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
41
|
-
"@squawk/airport-data": "^0.6.
|
|
42
|
-
"@squawk/airports": "^0.5.
|
|
43
|
-
"@squawk/airspace": "^0.
|
|
44
|
-
"@squawk/airspace-data": "^0.
|
|
45
|
-
"@squawk/airway-data": "^0.4.
|
|
46
|
-
"@squawk/airways": "^0.3.
|
|
47
|
-
"@squawk/fix-data": "^0.5.
|
|
48
|
-
"@squawk/fixes": "^0.2.
|
|
41
|
+
"@squawk/airport-data": "^0.6.1",
|
|
42
|
+
"@squawk/airports": "^0.5.1",
|
|
43
|
+
"@squawk/airspace": "^0.6.0",
|
|
44
|
+
"@squawk/airspace-data": "^0.4.0",
|
|
45
|
+
"@squawk/airway-data": "^0.4.2",
|
|
46
|
+
"@squawk/airways": "^0.3.2",
|
|
47
|
+
"@squawk/fix-data": "^0.5.2",
|
|
48
|
+
"@squawk/fixes": "^0.2.2",
|
|
49
49
|
"@squawk/flight-math": "^0.5.1",
|
|
50
|
-
"@squawk/flightplan": "^0.4.
|
|
51
|
-
"@squawk/geo": "^0.3.
|
|
52
|
-
"@squawk/icao-registry": "^0.3.
|
|
53
|
-
"@squawk/icao-registry-data": "^0.4.
|
|
54
|
-
"@squawk/navaid-data": "^0.5.
|
|
55
|
-
"@squawk/navaids": "^0.3.
|
|
56
|
-
"@squawk/notams": "^0.3.
|
|
57
|
-
"@squawk/procedure-data": "^0.5.
|
|
58
|
-
"@squawk/procedures": "^0.4.
|
|
59
|
-
"@squawk/types": "^0.
|
|
60
|
-
"@squawk/weather": "^0.
|
|
50
|
+
"@squawk/flightplan": "^0.4.2",
|
|
51
|
+
"@squawk/geo": "^0.3.2",
|
|
52
|
+
"@squawk/icao-registry": "^0.3.2",
|
|
53
|
+
"@squawk/icao-registry-data": "^0.4.2",
|
|
54
|
+
"@squawk/navaid-data": "^0.5.2",
|
|
55
|
+
"@squawk/navaids": "^0.3.2",
|
|
56
|
+
"@squawk/notams": "^0.3.2",
|
|
57
|
+
"@squawk/procedure-data": "^0.5.2",
|
|
58
|
+
"@squawk/procedures": "^0.4.2",
|
|
59
|
+
"@squawk/types": "^0.7.0",
|
|
60
|
+
"@squawk/weather": "^0.5.1",
|
|
61
61
|
"zod": "^4.3.6"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|