@cyanheads/noaa-spaceweather-mcp-server 0.1.1

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 (49) hide show
  1. package/AGENTS.md +328 -0
  2. package/CLAUDE.md +328 -0
  3. package/Dockerfile +99 -0
  4. package/LICENSE +201 -0
  5. package/README.md +315 -0
  6. package/changelog/0.1.x/0.1.1.md +31 -0
  7. package/changelog/template.md +127 -0
  8. package/dist/index.d.ts +7 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +23 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts +37 -0
  13. package/dist/mcp-server/tools/definitions/get-alerts.tool.d.ts.map +1 -0
  14. package/dist/mcp-server/tools/definitions/get-alerts.tool.js +114 -0
  15. package/dist/mcp-server/tools/definitions/get-alerts.tool.js.map +1 -0
  16. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts +37 -0
  17. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.d.ts.map +1 -0
  18. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js +202 -0
  19. package/dist/mcp-server/tools/definitions/get-aurora-forecast.tool.js.map +1 -0
  20. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts +55 -0
  21. package/dist/mcp-server/tools/definitions/get-conditions.tool.d.ts.map +1 -0
  22. package/dist/mcp-server/tools/definitions/get-conditions.tool.js +129 -0
  23. package/dist/mcp-server/tools/definitions/get-conditions.tool.js.map +1 -0
  24. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts +34 -0
  25. package/dist/mcp-server/tools/definitions/get-kp-index.tool.d.ts.map +1 -0
  26. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js +126 -0
  27. package/dist/mcp-server/tools/definitions/get-kp-index.tool.js.map +1 -0
  28. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts +58 -0
  29. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.d.ts.map +1 -0
  30. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js +237 -0
  31. package/dist/mcp-server/tools/definitions/get-solar-activity.tool.js.map +1 -0
  32. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts +46 -0
  33. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.d.ts.map +1 -0
  34. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js +197 -0
  35. package/dist/mcp-server/tools/definitions/get-solar-wind.tool.js.map +1 -0
  36. package/dist/mcp-server/tools/definitions/index.d.ts +225 -0
  37. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  38. package/dist/mcp-server/tools/definitions/index.js +19 -0
  39. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  40. package/dist/services/space-weather/space-weather-service.d.ts +42 -0
  41. package/dist/services/space-weather/space-weather-service.d.ts.map +1 -0
  42. package/dist/services/space-weather/space-weather-service.js +402 -0
  43. package/dist/services/space-weather/space-weather-service.js.map +1 -0
  44. package/dist/services/space-weather/types.d.ts +189 -0
  45. package/dist/services/space-weather/types.d.ts.map +1 -0
  46. package/dist/services/space-weather/types.js +6 -0
  47. package/dist/services/space-weather/types.js.map +1 -0
  48. package/package.json +105 -0
  49. package/server.json +99 -0
package/Dockerfile ADDED
@@ -0,0 +1,99 @@
1
+ # ==============================================================================
2
+ # Build Stage
3
+ #
4
+ # This stage installs all dependencies (including dev), builds the TypeScript
5
+ # source code into JavaScript, and prepares the production assets.
6
+ # ==============================================================================
7
+ FROM oven/bun:1.3 AS build
8
+
9
+ WORKDIR /usr/src/app
10
+
11
+ # Copy dependency manifests for optimized layer caching
12
+ COPY package.json bun.lock ./
13
+
14
+ # Install all dependencies (including dev dependencies for building)
15
+ RUN bun install --frozen-lockfile
16
+
17
+ # Copy the rest of the source code
18
+ COPY . .
19
+
20
+ # Build the application
21
+ RUN bun run build
22
+
23
+
24
+ # ==============================================================================
25
+ # Production Stage
26
+ #
27
+ # This stage creates a minimal, optimized, and secure image for running the
28
+ # application. It uses a slim base image and only includes production
29
+ # dependencies and build artifacts.
30
+ # ==============================================================================
31
+ FROM oven/bun:1.3-slim AS production
32
+
33
+ WORKDIR /usr/src/app
34
+
35
+ # Set the environment to production for performance and to ensure only
36
+ # production dependencies are installed.
37
+ ENV NODE_ENV=production
38
+
39
+ # OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
40
+ LABEL org.opencontainers.image.title="noaa-spaceweather-mcp-server"
41
+ LABEL org.opencontainers.image.description="Query NOAA SWPC space weather: geomagnetic storm scales, Kp index, aurora forecasts, solar wind, solar activity, and alerts via MCP. STDIO or Streamable HTTP."
42
+ LABEL org.opencontainers.image.source="https://github.com/cyanheads/noaa-spaceweather-mcp-server"
43
+ LABEL org.opencontainers.image.licenses="Apache-2.0"
44
+
45
+ # Copy dependency manifests
46
+ COPY package.json bun.lock ./
47
+
48
+ # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
49
+ # that are not needed in the final production image.
50
+ RUN bun install --production --frozen-lockfile --ignore-scripts
51
+
52
+ # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
53
+ # These are not bundled by default to keep the base image lean. Enable at build time
54
+ # with: docker build --build-arg OTEL_ENABLED=true
55
+ ARG OTEL_ENABLED=true
56
+ RUN if [ "$OTEL_ENABLED" = "true" ]; then \
57
+ bun add @hono/otel \
58
+ @opentelemetry/instrumentation-http \
59
+ @opentelemetry/exporter-metrics-otlp-http \
60
+ @opentelemetry/exporter-trace-otlp-http \
61
+ @opentelemetry/instrumentation-pino \
62
+ @opentelemetry/resources \
63
+ @opentelemetry/sdk-metrics \
64
+ @opentelemetry/sdk-node \
65
+ @opentelemetry/sdk-trace-node \
66
+ @opentelemetry/semantic-conventions; \
67
+ fi
68
+
69
+ # Copy the compiled application code from the build stage
70
+ COPY --from=build /usr/src/app/dist ./dist
71
+
72
+ # The 'oven/bun' image already provides a non-root user named 'bun'.
73
+ # We will use this existing user for enhanced security.
74
+
75
+ # Create and set permissions for the log directory, assigning ownership to the 'bun' user.
76
+ RUN mkdir -p /var/log/noaa-spaceweather-mcp-server && chown -R bun:bun /var/log/noaa-spaceweather-mcp-server
77
+
78
+ # Switch to the non-root user
79
+ USER bun
80
+
81
+ # Define an argument for the port, allowing it to be overridden at build time.
82
+ # The `PORT` variable is often injected by cloud environments at runtime.
83
+ ARG PORT
84
+
85
+ # Set runtime environment variables
86
+ # Note: PORT is an automatic variable in many cloud environments (e.g., Cloud Run)
87
+ ENV MCP_HTTP_PORT=${PORT:-3010}
88
+ ENV MCP_HTTP_HOST="0.0.0.0"
89
+ ENV MCP_TRANSPORT_TYPE="http"
90
+ ENV MCP_SESSION_MODE="stateless"
91
+ ENV MCP_LOG_LEVEL="info"
92
+ ENV LOGS_DIR="/var/log/noaa-spaceweather-mcp-server"
93
+ ENV MCP_FORCE_CONSOLE_LOGGING="true"
94
+
95
+ # Expose the port the server listens on
96
+ EXPOSE ${MCP_HTTP_PORT}
97
+
98
+ # The command to start the server
99
+ CMD ["bun", "run", "dist/index.js"]
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Casey Hand @cyanheads
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,315 @@
1
+ <div align="center">
2
+ <h1>@cyanheads/noaa-spaceweather-mcp-server</h1>
3
+ <p><b>Query NOAA SWPC space weather: geomagnetic storm scales, Kp index, aurora forecasts, solar wind, solar activity, and alerts via MCP. STDIO or Streamable HTTP.</b>
4
+ <div>6 Tools</div>
5
+ </p>
6
+ </div>
7
+
8
+ <div align="center">
9
+
10
+ [![Version](https://img.shields.io/badge/Version-0.1.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/noaa-spaceweather-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/noaa-spaceweather-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/noaa-spaceweather-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.11-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
+
12
+ </div>
13
+
14
+ <div align="center">
15
+
16
+ [![Install in Claude Desktop](https://img.shields.io/badge/Install_in-Claude_Desktop-D97757?style=for-the-badge&logo=anthropic&logoColor=white)](https://github.com/cyanheads/noaa-spaceweather-mcp-server/releases/latest/download/noaa-spaceweather-mcp-server.mcpb) [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=noaa-spaceweather-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvbm9hYS1zcGFjZXdlYXRoZXItbWNwLXNlcnZlciJdfQ==) [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22noaa-spaceweather-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Fnoaa-spaceweather-mcp-server%22%5D%7D)
17
+
18
+ [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-67E8F9?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Tools
25
+
26
+ Six tools covering the full NOAA SWPC space weather surface — from a quick status heartbeat to deep solar and geomagnetic data:
27
+
28
+ | Tool | Description |
29
+ |:-----|:------------|
30
+ | `noaa_spaceweather_get_conditions` | Current space-weather snapshot: NOAA R/S/G storm scales, latest Kp, and a plain-language status summary |
31
+ | `noaa_spaceweather_get_kp_index` | Planetary K-index (0–9) — recent observed 3-hour values with G-scale equivalents and aurora-latitude guidance, plus 3-day forecast |
32
+ | `noaa_spaceweather_get_aurora_forecast` | OVATION model aurora forecast: global probability grid, optional local lookup by coordinates with go/no-go verdict |
33
+ | `noaa_spaceweather_get_solar_wind` | Real-time solar wind from DSCOVR: speed, proton density, temperature, and the critical Bz component — explains why current geomagnetic conditions exist |
34
+ | `noaa_spaceweather_get_solar_activity` | Solar flare picture: GOES X-ray flux, 3-day flare-class probabilities, active solar regions with per-region probabilities, and solar radiation storm level |
35
+ | `noaa_spaceweather_get_alerts` | Active SWPC alerts, watches, and warnings — structured records with product type, severity, issue time, validity window, and full message text |
36
+
37
+ ### `noaa_spaceweather_get_conditions`
38
+
39
+ The heartbeat tool. Use it first — it composes storm scales + current Kp into a single snapshot with a plain-language summary.
40
+
41
+ - Returns today's R/S/G storm scales plus a 3-day forecast
42
+ - Current Kp with G-scale equivalent and aurora-visibility latitude guidance
43
+ - Plain-language summary: "Quiet conditions" vs. "G2 moderate geomagnetic storm in progress"
44
+ - Data sourced from `noaa-scales.json` + `noaa-planetary-k-index.json`
45
+
46
+ ---
47
+
48
+ ### `noaa_spaceweather_get_kp_index`
49
+
50
+ Planetary K-index time series for geomagnetic activity tracking.
51
+
52
+ - `window_days` parameter (1–7, default 1) — recent 3-hour observed values
53
+ - Each record includes Kp value, G-scale equivalent, aurora-latitude guidance, and observation time
54
+ - Separate 3-day forecast series with predicted Kp and NOAA G-scale labels
55
+
56
+ ---
57
+
58
+ ### `noaa_spaceweather_get_aurora_forecast`
59
+
60
+ OVATION model aurora probability at 1° resolution, updated every ~5 minutes.
61
+
62
+ - Without coordinates: global metadata — grid point count, global peak probability, peak region
63
+ - With coordinates (`latitude`, `longitude`): nearest-grid-point lookup, minimum Kp required at that latitude, and a plain-language verdict ("Good aurora chance (42%) — Kp≥6 needed at this latitude")
64
+ - Covers both hemispheres; coordinates are geographic (WGS84)
65
+
66
+ ---
67
+
68
+ ### `noaa_spaceweather_get_solar_wind`
69
+
70
+ DSCOVR satellite real-time solar wind plasma and magnetic field.
71
+
72
+ - `window_hours` parameter (1–168, default 3) — time series sliced client-side from 7-day feed
73
+ - Plasma: speed (km/s), proton density (n/cm³), temperature
74
+ - Bz component (southward Bz = storm driver) surfaced prominently in output and format
75
+ - Bt (total field magnitude) and GSM vector components
76
+
77
+ ---
78
+
79
+ ### `noaa_spaceweather_get_solar_activity`
80
+
81
+ Solar flare and radiation storm picture from GOES and SWPC probabilities.
82
+
83
+ - GOES primary X-ray flux in the 0.1–0.8 nm band (R-scale driver)
84
+ - 3-day C/M/X flare-class probabilities
85
+ - Active solar regions with per-region flare and proton probabilities when `include_regions: true` (default)
86
+ - Solar radiation storm (S-scale) level from ≥10 MeV integral proton flux
87
+
88
+ ---
89
+
90
+ ### `noaa_spaceweather_get_alerts`
91
+
92
+ Active SWPC alerts, watches, and warnings from the `products/alerts.json` feed.
93
+
94
+ - Structured product metadata: type (Watch/Warning/Alert/Summary), issue time, valid from/to
95
+ - Parsed severity from product code (G/R/S-scale, K-index level)
96
+ - Filtered to active-only by default (`active_only: true`); set `false` for recent history
97
+ - Full raw message text preserved for downstream display
98
+
99
+ ---
100
+
101
+ ## Features
102
+
103
+ Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
104
+
105
+ - Declarative tool definitions — single file per tool, framework handles registration and validation
106
+ - Unified error handling — handlers throw, framework catches, classifies, and formats
107
+ - Pluggable auth: `none`, `jwt`, `oauth`
108
+ - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
109
+ - Structured logging with optional OpenTelemetry tracing
110
+ - STDIO and Streamable HTTP transports
111
+
112
+ Space weather domain:
113
+
114
+ - All SWPC feeds are public and keyless — no API keys required
115
+ - Single `SpaceWeatherService` wraps all six NOAA SWPC JSON feeds with `fetchWithTimeout` + `withRetry`
116
+ - Heterogeneous feed normalization: array-of-arrays (solar wind), keyed objects (storm scales), coordinate triples (OVATION)
117
+ - NOAA scale interpretation: raw Kp 6 → "G2 moderate storm — aurora possible to ~55° geomagnetic latitude"
118
+ - Feed freshness surfaced per-response: solar wind updates ~1 min, aurora ~5 min, Kp 3-hour intervals
119
+
120
+ Agent-friendly output:
121
+
122
+ - Observed timestamps on every response so agents can reason about data freshness
123
+ - Plain-language summaries and verdicts alongside raw values — agents can display or reason without re-interpreting indices
124
+ - Bz component surfaced as a first-class field in solar wind output (southward Bz = primary storm driver)
125
+ - Typed error contracts with recovery hints: `feed_unavailable` → "Retry in 30–60 s"
126
+
127
+ ---
128
+
129
+ ## Getting started
130
+
131
+ Add the following to your MCP client configuration file.
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "noaa-spaceweather": {
137
+ "type": "stdio",
138
+ "command": "bunx",
139
+ "args": ["@cyanheads/noaa-spaceweather-mcp-server@latest"],
140
+ "env": {
141
+ "MCP_TRANSPORT_TYPE": "stdio",
142
+ "MCP_LOG_LEVEL": "info"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ Or with npx (no Bun required):
150
+
151
+ ```json
152
+ {
153
+ "mcpServers": {
154
+ "noaa-spaceweather": {
155
+ "type": "stdio",
156
+ "command": "npx",
157
+ "args": ["-y", "@cyanheads/noaa-spaceweather-mcp-server@latest"],
158
+ "env": {
159
+ "MCP_TRANSPORT_TYPE": "stdio",
160
+ "MCP_LOG_LEVEL": "info"
161
+ }
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ Or with Docker:
168
+
169
+ ```json
170
+ {
171
+ "mcpServers": {
172
+ "noaa-spaceweather": {
173
+ "type": "stdio",
174
+ "command": "docker",
175
+ "args": [
176
+ "run", "-i", "--rm",
177
+ "-e", "MCP_TRANSPORT_TYPE=stdio",
178
+ "ghcr.io/cyanheads/noaa-spaceweather-mcp-server:latest"
179
+ ]
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ For Streamable HTTP, set the transport and start the server:
186
+
187
+ ```sh
188
+ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
189
+ # Server listens at http://localhost:3010/mcp
190
+ ```
191
+
192
+ ### Prerequisites
193
+
194
+ - [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
195
+ - No API keys required — all SWPC feeds are public.
196
+
197
+ ### Installation
198
+
199
+ 1. **Clone the repository:**
200
+
201
+ ```sh
202
+ git clone https://github.com/cyanheads/noaa-spaceweather-mcp-server.git
203
+ ```
204
+
205
+ 2. **Navigate into the directory:**
206
+
207
+ ```sh
208
+ cd noaa-spaceweather-mcp-server
209
+ ```
210
+
211
+ 3. **Install dependencies:**
212
+
213
+ ```sh
214
+ bun install
215
+ ```
216
+
217
+ 4. **Configure environment:**
218
+
219
+ ```sh
220
+ cp .env.example .env
221
+ # edit .env if needed — all defaults work out of the box
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Configuration
227
+
228
+ | Variable | Description | Default |
229
+ |:---------|:------------|:--------|
230
+ | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
231
+ | `MCP_HTTP_PORT` | Port for HTTP server. | `3010` |
232
+ | `MCP_HTTP_HOST` | Hostname for HTTP server. | `127.0.0.1` |
233
+ | `MCP_HTTP_ENDPOINT_PATH` | Endpoint path. | `/mcp` |
234
+ | `MCP_AUTH_MODE` | Auth mode: `none`, `jwt`, or `oauth`. | `none` |
235
+ | `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
236
+ | `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
237
+ | `STORAGE_PROVIDER_TYPE` | Storage backend. | `in-memory` |
238
+ | `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry). | `false` |
239
+
240
+ No domain-specific API keys are required. See [`.env.example`](./.env.example) for the full list of optional overrides.
241
+
242
+ ---
243
+
244
+ ## Running the server
245
+
246
+ ### Local development
247
+
248
+ - **Build and run:**
249
+
250
+ ```sh
251
+ # One-time build
252
+ bun run rebuild
253
+
254
+ # Run the built server
255
+ bun run start:stdio
256
+ # or
257
+ bun run start:http
258
+ ```
259
+
260
+ - **Run checks and tests:**
261
+
262
+ ```sh
263
+ bun run devcheck # Lint, format, typecheck, security
264
+ bun run test # Vitest test suite
265
+ bun run lint:mcp # Validate MCP definitions against spec
266
+ ```
267
+
268
+ ### Docker
269
+
270
+ ```sh
271
+ docker build -t noaa-spaceweather-mcp-server .
272
+ docker run --rm -p 3010:3010 noaa-spaceweather-mcp-server
273
+ ```
274
+
275
+ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/noaa-spaceweather-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
276
+
277
+ ---
278
+
279
+ ## Project structure
280
+
281
+ | Path | Purpose |
282
+ |:-----|:--------|
283
+ | `src/index.ts` | `createApp()` entry point — registers tools and inits the service. |
284
+ | `src/services/space-weather/` | `SpaceWeatherService` — fetches and normalizes all NOAA SWPC feeds. |
285
+ | `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`) — one file per tool. |
286
+ | `tests/` | Unit and integration tests mirroring `src/`. |
287
+ | `docs/` | Design doc and directory tree. |
288
+
289
+ ---
290
+
291
+ ## Development guide
292
+
293
+ See [`CLAUDE.md`/`AGENTS.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
294
+
295
+ - Handlers throw, framework catches — no `try/catch` in tool logic
296
+ - Use `ctx.log` for request-scoped logging, `ctx.state` for tenant-scoped storage
297
+ - Register new tools via the barrel in `src/mcp-server/tools/definitions/index.ts`
298
+ - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
299
+
300
+ ---
301
+
302
+ ## Contributing
303
+
304
+ Issues and pull requests are welcome. Run checks and tests before submitting:
305
+
306
+ ```sh
307
+ bun run devcheck
308
+ bun run test
309
+ ```
310
+
311
+ ---
312
+
313
+ ## License
314
+
315
+ Apache-2.0 — see [LICENSE](LICENSE) for details.
@@ -0,0 +1,31 @@
1
+ ---
2
+ summary: "Initial public release — 6 NOAA SWPC space weather tools (conditions, Kp index, aurora forecast, solar wind, solar activity, alerts), output injection hardening, and field-validated data normalization"
3
+ breaking: false
4
+ security: true
5
+ ---
6
+
7
+ # 0.1.1 — 2026-06-05
8
+
9
+ Initial public release of `@cyanheads/noaa-spaceweather-mcp-server`. Provides 6 MCP tools over the [NOAA Space Weather Prediction Center (SWPC)](https://www.swpc.noaa.gov/) public feeds — no API key required:
10
+
11
+ - **`noaa_spaceweather_get_conditions`** — current space-weather heartbeat: NOAA R/S/G storm scales (today + 3-day forecast), latest Kp index, and a plain-language status summary
12
+ - **`noaa_spaceweather_get_kp_index`** — planetary K-index (0–9), recent observed 3-hour values with G-scale equivalents and aurora-latitude guidance, plus 3-day forecast
13
+ - **`noaa_spaceweather_get_aurora_forecast`** — OVATION model global probability grid with optional local lookup by coordinates and go/no-go verdict
14
+ - **`noaa_spaceweather_get_solar_wind`** — real-time solar wind from DSCOVR: speed, proton density, temperature, and the critical Bz component
15
+ - **`noaa_spaceweather_get_solar_activity`** — GOES X-ray flux, 3-day flare-class probabilities, active solar regions with per-region probabilities, solar radiation storm level
16
+ - **`noaa_spaceweather_get_alerts`** — active SWPC alerts, watches, and warnings with product type, severity, issue time, validity window, and full message text
17
+
18
+ ## Added
19
+
20
+ - **`noaa_spaceweather_get_conditions`** — NOAA R/S/G storm-scale snapshot sourced from `noaa-scales.json` + `noaa-planetary-k-index.json`; returns current and forecast levels with aurora-visibility latitude guidance
21
+ - **`noaa_spaceweather_get_kp_index`** — K-index history from `noaa-planetary-k-index.json` with configurable observation window (1–168 hours); 3-day forecast from `3-day-geomag-forecast.txt`
22
+ - **`noaa_spaceweather_get_aurora_forecast`** — OVATION model probability grid from `ovation_aurora_latest.json`; local coordinates resolve to nearest grid point with aurora-activity verdict
23
+ - **`noaa_spaceweather_get_solar_wind`** — 1-minute DSCOVR plasma and magnetic field data from `rtsw/rtsw_wind_1m.json`; surfaces Bz component with its geomagnetic storm significance
24
+ - **`noaa_spaceweather_get_solar_activity`** — GOES X-ray flux from `xray-flares.json`, flare probabilities from `3-day-solar-geomag-predictions.txt`, active region table from `solar-regions.json`
25
+ - **`noaa_spaceweather_get_alerts`** — SWPC parsed alert feed from `noaa-alerts.json`; structures issue time, validity windows, and full message text per record
26
+ - **`SpaceWeatherService`** — shared NOAA SWPC feed client wrapping all upstream endpoints; normalizes sparse upstream payloads and handles feed downtime with `ServiceUnavailable` errors
27
+ - **Test suite** — 7 test files covering the service layer and all 6 tools against real and sparse upstream payloads
28
+
29
+ ## Security
30
+
31
+ - **Output injection hardening** — upstream alert message text (verbatim SWPC prose, opaque provenance) fenced in code blocks in `noaa_spaceweather_get_alerts` output to prevent prompt injection from alert content reaching downstream LLMs unquoted