@cyanheads/noaa-spaceweather-mcp-server 0.1.13 → 0.2.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.
Files changed (39) hide show
  1. package/AGENTS.md +6 -4
  2. package/CLAUDE.md +6 -4
  3. package/README.md +26 -17
  4. package/changelog/0.1.x/0.1.14.md +32 -0
  5. package/changelog/0.2.x/0.2.0.md +21 -0
  6. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +19 -1
  7. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -1
  8. package/dist/mcp-server/tools/definitions/get-alerts.tool.js +281 -41
  9. package/dist/mcp-server/tools/definitions/get-alerts.tool.js.map +1 -1
  10. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts +9 -1
  11. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js +91 -52
  13. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts +27 -8
  15. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-conditions.tool.js +234 -38
  17. package/dist/mcp-server/tools/definitions/get-conditions.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts +7 -1
  19. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js +21 -6
  21. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts +32 -2
  23. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js +243 -39
  25. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts +17 -1
  27. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js +150 -21
  29. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/index.d.ts +111 -14
  31. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  32. package/dist/services/space-weather/space-weather-service.d.ts +76 -3
  33. package/dist/services/space-weather/space-weather-service.d.ts.map +1 -1
  34. package/dist/services/space-weather/space-weather-service.js +539 -82
  35. package/dist/services/space-weather/space-weather-service.js.map +1 -1
  36. package/dist/services/space-weather/types.d.ts +177 -21
  37. package/dist/services/space-weather/types.d.ts.map +1 -1
  38. package/package.json +3 -3
  39. package/server.json +3 -3
@@ -8,9 +8,50 @@
8
8
  import type { Context } from '@cyanheads/mcp-ts-core';
9
9
  import type { AppConfig } from '@cyanheads/mcp-ts-core/config';
10
10
  import type { StorageService } from '@cyanheads/mcp-ts-core/storage';
11
- import type { AuroraForecastData, KpForecast, KpObservation, NoaaScalesData, ProtonFlux, SolarProbabilities, SolarRegion, SolarWindMag, SolarWindPlasma, SpaceWeatherAlert, XrayFlux } from './types.js';
12
- /** Maps Kp value (0–9) to NOAA G-scale level (0–5). Shared with get-kp-index tool. */
11
+ import type { AuroraForecastData, F107Observation, ForecastDiscussion, KpForecast, KpObservation, NoaaScalesData, ProtonFlux, SolarProbabilities, SolarRegion, SolarWindMag, SolarWindPlasma, SpaceWeatherAlert, XrayFlare, XrayFlux } from './types.js';
12
+ /**
13
+ * Maps a Kp value (0–9) to its NOAA G-scale level (0–5). Shared with the
14
+ * get-kp-index tool.
15
+ *
16
+ * SWPC publishes Kp in thirds and starts each G level at that level's "minus"
17
+ * value, so G1 begins at 5− (4.67) rather than 5. Rounding to thirds
18
+ * (`Math.round(kp * 3)`) maps every spelling of a third — 4.67, 4.66 — onto one
19
+ * integer, which makes the bands exact integer comparisons instead of float
20
+ * compares needing a tuned epsilon per band. The top boundary follows the NOAA
21
+ * scales page, which gives G4 as "Kp = 8, including a 9-" and G5 as "Kp = 9": 8.67
22
+ * is G4 and only 9.00 is G5.
23
+ */
13
24
  export declare function kpToGScale(kp: number): number;
25
+ /** One geomagnetic-latitude band of the aurora reachability table. */
26
+ export interface AuroraBand {
27
+ /** Equatorward edge of the band, in degrees of geomagnetic latitude. */
28
+ geomagneticLatitude: number;
29
+ /** NOAA G level that reaches this band; 0 means inside the quiet-time oval. */
30
+ gScale: number;
31
+ /** Kp floor at which that G level begins; 0 inside the oval. */
32
+ minKp: number;
33
+ }
34
+ /**
35
+ * Aurora reachability by geomagnetic latitude, keyed on NOAA G level, ordered
36
+ * poleward-first. The single table for the whole server: aurora-latitude guidance
37
+ * on the Kp tools and the Kp threshold the aurora tool reports for a location both
38
+ * read it, so the two can no longer state different thresholds for one place.
39
+ *
40
+ * Latitudes for G2–G5 are the NOAA scales page figures. The 60° G1 row is this
41
+ * server's interpolation between that page's G2 row and the oval edge — the page
42
+ * states no G1 latitude. The 65° row is not a storm level at all: it is the
43
+ * quiet-time equatorward edge of the auroral oval, where aurora needs no elevated
44
+ * Kp. Below the 40° G5 row no level on the scale reaches.
45
+ *
46
+ * Each Kp floor is its level's "minus" third — the value at which SWPC starts the
47
+ * level, per {@link kpToGScale} — except G5, which begins at a whole Kp 9.
48
+ */
49
+ export declare const AURORA_BANDS: readonly AuroraBand[];
50
+ /**
51
+ * Resolve the aurora band a geomagnetic latitude sits in, north or south. Returns
52
+ * null equatorward of the 40° G5 edge, where no NOAA storm level reaches.
53
+ */
54
+ export declare function auroraBandForGeomagneticLatitude(geomagneticLatitude: number): AuroraBand | null;
14
55
  /** NOAA SWPC public feeds client. Initialized once; accessed via accessor. */
15
56
  export declare class SpaceWeatherService {
16
57
  /**
@@ -21,6 +62,11 @@ export declare class SpaceWeatherService {
21
62
  constructor(config: AppConfig, _storage: StorageService);
22
63
  /** Fetch current NOAA storm scales (today + 3-day forecast). */
23
64
  getNoaaScales(ctx: Context): Promise<NoaaScalesData>;
65
+ /**
66
+ * Fetch the SWPC Forecast Discussion — the forecaster-written narrative explaining
67
+ * what is driving the storm scales, split into its topic sections.
68
+ */
69
+ getForecastDiscussion(ctx: Context): Promise<ForecastDiscussion>;
24
70
  /** Fetch observed Kp index history. */
25
71
  getKpObserved(ctx: Context): Promise<KpObservation[]>;
26
72
  /** Fetch Kp 3-day forecast. */
@@ -40,8 +86,35 @@ export declare class SpaceWeatherService {
40
86
  * {@link SpaceWeatherService.getSolarWindPlasma}.
41
87
  */
42
88
  getSolarWindMag(ctx: Context): Promise<SolarWindMag[]>;
43
- /** Fetch GOES X-ray flux (7-day, long-channel 0.1-0.8nm only). */
89
+ /**
90
+ * Fetch GOES X-ray flux (6-hour, long-channel 0.1-0.8nm only).
91
+ *
92
+ * The 6-hour feed's records are byte-identical to the newest 710 of the 7-day
93
+ * feed — same seven keys, same two energy channels, same 1-minute cadence, same
94
+ * newest time tag — so the past-hour slice its only caller takes is the same 61
95
+ * records either way, for ~4.36 MB less per call.
96
+ */
44
97
  getXrayFlux(ctx: Context): Promise<XrayFlux[]>;
98
+ /**
99
+ * Fetch discrete GOES X-ray flare events (rolling 7 days), oldest-first.
100
+ *
101
+ * Classes are read as published, not derived from the flux. Ordering is
102
+ * normalized here rather than depending on upstream's, the same as the solar-wind
103
+ * series: it makes oldest-first an invariant of the domain type instead of an
104
+ * accident of the feed.
105
+ */
106
+ getXrayFlares(ctx: Context): Promise<XrayFlare[]>;
107
+ /**
108
+ * Fetch the latest daily F10.7 solar radio flux report, or null when the feed
109
+ * carries no Noon record.
110
+ *
111
+ * The newest record is not the answer: the feed serves three reports per UTC day
112
+ * and its index 0 is often that day's Afternoon report, while SWPC's own one-value
113
+ * summary product reports the Noon one — which is also the only schedule carrying
114
+ * `ninety_day_mean`. Selection is by time among the Noon records, so it does not
115
+ * depend on the order upstream serves.
116
+ */
117
+ getF107(ctx: Context): Promise<F107Observation | null>;
45
118
  /** Fetch active solar regions (most recent observed date only). */
46
119
  getSolarRegions(ctx: Context): Promise<SolarRegion[]>;
47
120
  /** Fetch solar flare probabilities (3-day forward outlook from the latest issued entry). */
@@ -1 +1 @@
1
- {"version":3,"file":"space-weather-service.d.ts","sourceRoot":"","sources":["../../../src/services/space-weather/space-weather-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,cAAc,EAEd,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACT,MAAM,YAAY,CAAC;AAqBpB,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAO7C;AAkXD,8EAA8E;AAC9E,qBAAa,mBAAmB;IAC9B;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,YAAY,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAEtD;IAID,gEAAgE;IAC1D,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CA8CzD;IAID,uCAAuC;IACjC,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAkB1D;IAED,+BAA+B;IACzB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAYvD;IAID,qDAAqD;IAC/C,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAoBjE;IAID;;;;;OAKG;IACG,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAYjE;IAED;;;;OAIG;IACG,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAa3D;IAID,kEAAkE;IAC5D,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAcnD;IAED,mEAAmE;IAC7D,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAgC1D;IAED,4FAA4F;IACtF,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAuCvE;IAED,gEAAgE;IAC1D,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAcvD;IAID,gDAAgD;IAC1C,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA0C1D;CACF;AAMD,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAExF;AAED,4DAA4D;AAC5D,wBAAgB,sBAAsB,IAAI,mBAAmB,CAM5D"}
1
+ {"version":3,"file":"space-weather-service.d.ts","sourceRoot":"","sources":["../../../src/services/space-weather/space-weather-service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,cAAc,EAEd,UAAU,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