@dangahagan/weather-mcp 1.3.0 → 1.7.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 (149) hide show
  1. package/README.md +451 -18
  2. package/dist/analytics/anonymizer.d.ts +37 -0
  3. package/dist/analytics/anonymizer.d.ts.map +1 -0
  4. package/dist/analytics/anonymizer.js +112 -0
  5. package/dist/analytics/anonymizer.js.map +1 -0
  6. package/dist/analytics/collector.d.ts +72 -0
  7. package/dist/analytics/collector.d.ts.map +1 -0
  8. package/dist/analytics/collector.js +282 -0
  9. package/dist/analytics/collector.js.map +1 -0
  10. package/dist/analytics/config.d.ts +15 -0
  11. package/dist/analytics/config.d.ts.map +1 -0
  12. package/dist/analytics/config.js +172 -0
  13. package/dist/analytics/config.js.map +1 -0
  14. package/dist/analytics/index.d.ts +8 -0
  15. package/dist/analytics/index.d.ts.map +1 -0
  16. package/dist/analytics/index.js +7 -0
  17. package/dist/analytics/index.js.map +1 -0
  18. package/dist/analytics/middleware.d.ts +33 -0
  19. package/dist/analytics/middleware.d.ts.map +1 -0
  20. package/dist/analytics/middleware.js +99 -0
  21. package/dist/analytics/middleware.js.map +1 -0
  22. package/dist/analytics/transport.d.ts +11 -0
  23. package/dist/analytics/transport.d.ts.map +1 -0
  24. package/dist/analytics/transport.js +92 -0
  25. package/dist/analytics/transport.js.map +1 -0
  26. package/dist/analytics/types.d.ts +74 -0
  27. package/dist/analytics/types.d.ts.map +1 -0
  28. package/dist/analytics/types.js +6 -0
  29. package/dist/analytics/types.js.map +1 -0
  30. package/dist/config/tools.d.ts +44 -0
  31. package/dist/config/tools.d.ts.map +1 -0
  32. package/dist/config/tools.js +276 -0
  33. package/dist/config/tools.js.map +1 -0
  34. package/dist/errors/ApiError.d.ts +6 -6
  35. package/dist/errors/ApiError.d.ts.map +1 -1
  36. package/dist/errors/ApiError.js +2 -1
  37. package/dist/errors/ApiError.js.map +1 -1
  38. package/dist/handlers/forecastHandler.d.ts +2 -1
  39. package/dist/handlers/forecastHandler.d.ts.map +1 -1
  40. package/dist/handlers/forecastHandler.js +10 -7
  41. package/dist/handlers/forecastHandler.js.map +1 -1
  42. package/dist/handlers/lightningHandler.d.ts +14 -0
  43. package/dist/handlers/lightningHandler.d.ts.map +1 -0
  44. package/dist/handlers/lightningHandler.js +258 -0
  45. package/dist/handlers/lightningHandler.js.map +1 -0
  46. package/dist/handlers/locationHandler.d.ts +3 -2
  47. package/dist/handlers/locationHandler.d.ts.map +1 -1
  48. package/dist/handlers/locationHandler.js +54 -18
  49. package/dist/handlers/locationHandler.js.map +1 -1
  50. package/dist/handlers/marineConditionsHandler.d.ts.map +1 -1
  51. package/dist/handlers/marineConditionsHandler.js +11 -7
  52. package/dist/handlers/marineConditionsHandler.js.map +1 -1
  53. package/dist/handlers/riverConditionsHandler.d.ts +11 -0
  54. package/dist/handlers/riverConditionsHandler.d.ts.map +1 -0
  55. package/dist/handlers/riverConditionsHandler.js +180 -0
  56. package/dist/handlers/riverConditionsHandler.js.map +1 -0
  57. package/dist/handlers/savedLocationsHandler.d.ts +50 -0
  58. package/dist/handlers/savedLocationsHandler.d.ts.map +1 -0
  59. package/dist/handlers/savedLocationsHandler.js +399 -0
  60. package/dist/handlers/savedLocationsHandler.js.map +1 -0
  61. package/dist/handlers/statusHandler.js +2 -2
  62. package/dist/handlers/statusHandler.js.map +1 -1
  63. package/dist/handlers/weatherImageryHandler.d.ts +14 -0
  64. package/dist/handlers/weatherImageryHandler.d.ts.map +1 -0
  65. package/dist/handlers/weatherImageryHandler.js +143 -0
  66. package/dist/handlers/weatherImageryHandler.js.map +1 -0
  67. package/dist/handlers/wildfireHandler.d.ts +11 -0
  68. package/dist/handlers/wildfireHandler.d.ts.map +1 -0
  69. package/dist/handlers/wildfireHandler.js +186 -0
  70. package/dist/handlers/wildfireHandler.js.map +1 -0
  71. package/dist/index.js +592 -241
  72. package/dist/index.js.map +1 -1
  73. package/dist/services/blitzortung.d.ts +67 -0
  74. package/dist/services/blitzortung.d.ts.map +1 -0
  75. package/dist/services/blitzortung.js +475 -0
  76. package/dist/services/blitzortung.js.map +1 -0
  77. package/dist/services/geocoding.d.ts +57 -0
  78. package/dist/services/geocoding.d.ts.map +1 -0
  79. package/dist/services/geocoding.js +393 -0
  80. package/dist/services/geocoding.js.map +1 -0
  81. package/dist/services/locationStore.d.ts +62 -0
  82. package/dist/services/locationStore.d.ts.map +1 -0
  83. package/dist/services/locationStore.js +201 -0
  84. package/dist/services/locationStore.js.map +1 -0
  85. package/dist/services/nifc.d.ts +44 -0
  86. package/dist/services/nifc.d.ts.map +1 -0
  87. package/dist/services/nifc.js +159 -0
  88. package/dist/services/nifc.js.map +1 -0
  89. package/dist/services/noaa.d.ts +56 -1
  90. package/dist/services/noaa.d.ts.map +1 -1
  91. package/dist/services/noaa.js +235 -1
  92. package/dist/services/noaa.js.map +1 -1
  93. package/dist/services/nominatim.d.ts +62 -0
  94. package/dist/services/nominatim.d.ts.map +1 -0
  95. package/dist/services/nominatim.js +254 -0
  96. package/dist/services/nominatim.js.map +1 -0
  97. package/dist/services/openmeteo.d.ts.map +1 -1
  98. package/dist/services/openmeteo.js +16 -11
  99. package/dist/services/openmeteo.js.map +1 -1
  100. package/dist/services/rainviewer.d.ts +37 -0
  101. package/dist/services/rainviewer.d.ts.map +1 -0
  102. package/dist/services/rainviewer.js +115 -0
  103. package/dist/services/rainviewer.js.map +1 -0
  104. package/dist/types/imagery.d.ts +82 -0
  105. package/dist/types/imagery.d.ts.map +1 -0
  106. package/dist/types/imagery.js +6 -0
  107. package/dist/types/imagery.js.map +1 -0
  108. package/dist/types/lightning.d.ts +89 -0
  109. package/dist/types/lightning.d.ts.map +1 -0
  110. package/dist/types/lightning.js +6 -0
  111. package/dist/types/lightning.js.map +1 -0
  112. package/dist/types/noaa.d.ts +185 -0
  113. package/dist/types/noaa.d.ts.map +1 -1
  114. package/dist/types/nominatim.d.ts +72 -0
  115. package/dist/types/nominatim.d.ts.map +1 -0
  116. package/dist/types/nominatim.js +6 -0
  117. package/dist/types/nominatim.js.map +1 -0
  118. package/dist/types/savedLocations.d.ts +58 -0
  119. package/dist/types/savedLocations.d.ts.map +1 -0
  120. package/dist/types/savedLocations.js +5 -0
  121. package/dist/types/savedLocations.js.map +1 -0
  122. package/dist/types/wildfire.d.ts +83 -0
  123. package/dist/types/wildfire.d.ts.map +1 -0
  124. package/dist/types/wildfire.js +5 -0
  125. package/dist/types/wildfire.js.map +1 -0
  126. package/dist/utils/distance.d.ts +25 -0
  127. package/dist/utils/distance.d.ts.map +1 -0
  128. package/dist/utils/distance.js +40 -0
  129. package/dist/utils/distance.js.map +1 -0
  130. package/dist/utils/geography.d.ts +17 -0
  131. package/dist/utils/geography.d.ts.map +1 -1
  132. package/dist/utils/geography.js +56 -0
  133. package/dist/utils/geography.js.map +1 -1
  134. package/dist/utils/geohash.d.ts +62 -0
  135. package/dist/utils/geohash.d.ts.map +1 -0
  136. package/dist/utils/geohash.js +146 -0
  137. package/dist/utils/geohash.js.map +1 -0
  138. package/dist/utils/locationResolver.d.ts +25 -0
  139. package/dist/utils/locationResolver.d.ts.map +1 -0
  140. package/dist/utils/locationResolver.js +70 -0
  141. package/dist/utils/locationResolver.js.map +1 -0
  142. package/dist/utils/logger.d.ts +16 -0
  143. package/dist/utils/logger.d.ts.map +1 -1
  144. package/dist/utils/logger.js +25 -0
  145. package/dist/utils/logger.js.map +1 -1
  146. package/dist/utils/timezone.d.ts.map +1 -1
  147. package/dist/utils/timezone.js +7 -9
  148. package/dist/utils/timezone.js.map +1 -1
  149. package/package.json +13 -10
package/README.md CHANGED
@@ -30,6 +30,14 @@ An MCP (Model Context Protocol) server that provides **global weather data** to
30
30
  - Support for cities, airports, landmarks, and regions globally
31
31
  - Detailed metadata: timezone, elevation, population, country
32
32
  - Enables natural language queries: "What's the weather in Tokyo?"
33
+ - **Saved Locations**: Save and reuse favorite locations (NEW in v1.7.0)
34
+ - Save frequently used locations with simple aliases ("home", "work", "cabin")
35
+ - Use saved locations by name instead of coordinates in all weather tools
36
+ - Tag locations with activities ("boating", "hiking", "skiing") for contextual weather info
37
+ - Automatic geocoding when saving (just provide location name)
38
+ - Persistent storage in `~/.weather-mcp/locations.json`
39
+ - Manage locations: save, list, view details, remove
40
+ - Makes queries natural: "What's the weather at home?" instead of providing coordinates
33
41
  - **Climate Normals - Historical Context**: Compare weather to 30-year averages (NEW in v1.2.0)
34
42
  - **Optional enhancement** for current conditions and forecasts (`include_normals=true`)
35
43
  - Shows normal high/low temperatures and precipitation for comparison
@@ -91,6 +99,39 @@ An MCP (Model Context Protocol) server that provides **global weather data** to
91
99
  - Safety assessment for maritime activities (sailing, boating, surfing)
92
100
  - Wave interpretation guide based on Douglas Sea Scale
93
101
  - Important: Data has limited coastal accuracy - NOT for navigation
102
+ - **Weather Imagery**: Visual weather radar and precipitation maps (NEW in v1.5.0)
103
+ - Global precipitation radar from RainViewer API
104
+ - Static radar images showing current precipitation
105
+ - Animated radar loops (up to 2 hours of history)
106
+ - Tile URLs for efficient rendering
107
+ - Automatic coordinate-to-tile calculation
108
+ - Visual confirmation of approaching weather
109
+ - Free, no API key required
110
+ - **Lightning Activity**: Real-time lightning strike detection and safety monitoring (NEW in v1.5.0)
111
+ - Real-time strike detection from Blitzortung.org network
112
+ - Strikes within customizable radius (default: 100km)
113
+ - 4-level safety assessment (Safe, Elevated, High, Extreme)
114
+ - Distance to nearest strike with comprehensive statistics
115
+ - Strike polarity and amplitude information
116
+ - Safety recommendations based on proximity
117
+ - Critical for outdoor activity safety planning
118
+ - Free, no API key required
119
+ - **River Conditions**: Monitor river levels and flood status for safety and recreation (NEW in v1.6.0)
120
+ - Current water levels from NOAA and USGS gauges
121
+ - Flood stage thresholds (action, minor, moderate, major)
122
+ - Streamflow data in cubic feet per second
123
+ - Distance-based gauge filtering within customizable radius
124
+ - Safety assessment for boating and recreation
125
+ - Historical flood crest data when available
126
+ - US coverage via NOAA NWPS and USGS Water Services
127
+ - **Wildfire Information**: Track active wildfires and fire perimeters (NEW in v1.6.0)
128
+ - Active wildfire locations and prescribed burns
129
+ - Fire size, containment status, and discovery date
130
+ - Distance-based proximity filtering
131
+ - 4-level safety assessment (Extreme Danger, High Alert, Caution, Awareness)
132
+ - Evacuation recommendations based on proximity
133
+ - Detailed fire attributes (type, location, status)
134
+ - Data from NIFC WFIGS (National Interagency Fire Center)
94
135
  - **Service Status Checking**: Proactively verify API availability with health checks
95
136
  - **Enhanced Error Handling**: Detailed, actionable error messages with status page links
96
137
  - **Intelligent Caching**: Built-in in-memory cache reduces API calls and improves performance
@@ -112,6 +153,10 @@ The cache automatically stores and retrieves weather data with intelligent expir
112
153
 
113
154
  - **Location Searches**: Cached for 30 days (locations don't move)
114
155
  - **Climate Normals**: Cached indefinitely (30-year averages are static) - NEW in v1.2.0
156
+ - **Weather Imagery**: Cached for 15 minutes (radar updates frequently) - NEW in v1.5.0
157
+ - **Lightning Strikes**: Cached for 5 minutes (real-time safety data) - NEW in v1.5.0
158
+ - **River Conditions**: Cached for 1 hour (gauge data updates frequently) - NEW in v1.6.0
159
+ - **Wildfire Information**: Cached for 30 minutes (fire data changes rapidly) - NEW in v1.6.0
115
160
  - **Marine Conditions**: Cached for 1 hour (marine data updates hourly) - NEW in v0.6.0
116
161
  - **Air Quality Data**: Cached for 1 hour (air quality updates hourly) - v0.5.0
117
162
  - **Fire Weather Data**: Cached for 2 hours (gridpoint data updates ~hourly) - v0.5.0
@@ -124,18 +169,74 @@ The cache automatically stores and retrieves weather data with intelligent expir
124
169
 
125
170
  ### Configuration
126
171
 
127
- Caching is **enabled by default** with sensible settings. To customize:
172
+ **For most users: No configuration needed!** The server works out of the box with sensible defaults and requires no API keys.
173
+
174
+ #### Optional: Environment Variables
175
+
176
+ To customize server behavior, copy the example configuration file:
128
177
 
129
178
  ```bash
130
- # Disable caching (not recommended)
131
- export CACHE_ENABLED=false
179
+ cp .env.example .env
180
+ ```
181
+
182
+ Then edit `.env` to adjust settings as needed. See [`.env.example`](./.env.example) for comprehensive documentation on all available options.
183
+
184
+ **What you can configure:**
185
+ - **Tool Selection** - Choose which MCP tools to expose (basic/standard/full/all presets)
186
+ - **Cache Settings** - Adjust cache size and enable/disable caching
187
+ - **API Configuration** - Set request timeouts
188
+ - **Logging** - Control log verbosity levels
189
+ - **Optional API Tokens** - Add NCEI token for official US climate normals (falls back to free Open-Meteo data)
190
+ - **Lightning Detection** - Configure alternative MQTT broker (optional)
132
191
 
133
- # Adjust maximum cache size (default: 1000 entries)
134
- export CACHE_MAX_SIZE=1500
192
+ All settings have sensible defaults and can be omitted entirely.
135
193
 
136
- # Optional: NOAA NCEI API token for official climate normals (US only, NEW in v1.2.0)
137
- # Falls back to Open-Meteo computed normals if not configured
138
- export NCEI_API_TOKEN=your_token_here
194
+ #### Tool Selection (NEW in v1.4.0)
195
+
196
+ Control which MCP tools are exposed to reduce context overhead and customize functionality. By default, only **basic** tools are enabled.
197
+
198
+ **Available Presets:**
199
+ - `basic` (default): Essential weather tools (5 tools) - forecast, current_conditions, alerts, search_location, check_service_status
200
+ - `standard`: Basic + historical_weather (6 tools)
201
+ - `full`: Standard + air_quality (7 tools)
202
+ - `all`: All available tools (16 tools) - includes marine_conditions, weather_imagery, lightning_activity, river_conditions, wildfire_info, save_location, list_saved_locations, get_saved_location, remove_saved_location
203
+
204
+ **Configuration Examples:**
205
+
206
+ ```bash
207
+ # In .env file or MCP client config
208
+ ENABLED_TOOLS=full # Use a preset
209
+ ENABLED_TOOLS=forecast,current,alerts,air_quality # Specific tools only
210
+ ENABLED_TOOLS=basic,+historical,+air_quality # Add to preset
211
+ ENABLED_TOOLS=all,-marine # Remove from preset
212
+ ```
213
+
214
+ **Tool Aliases:**
215
+ Short names are supported: `forecast`, `current`, `conditions`, `alerts`, `warnings`, `historical`, `history`, `status`, `location`, `search`, `air_quality`, `aqi`, `marine`, `ocean`, `waves`, `imagery`, `radar`, `satellite`, `lightning`, `strikes`, `thunderstorm`
216
+
217
+ **Benefits:**
218
+ - **Reduced Context**: Load only needed tools to reduce initial MCP context
219
+ - **Better Security**: Only expose necessary functionality
220
+ - **Customization**: Tailor the server to your specific use case
221
+
222
+ #### MCP Client Configuration
223
+
224
+ You can also set environment variables directly in your MCP client configuration file instead of using a `.env` file:
225
+
226
+ ```json
227
+ {
228
+ "mcpServers": {
229
+ "weather": {
230
+ "command": "npx",
231
+ "args": ["-y", "@dangahagan/weather-mcp@latest"],
232
+ "env": {
233
+ "ENABLED_TOOLS": "full",
234
+ "CACHE_MAX_SIZE": "2000",
235
+ "LOG_LEVEL": "1"
236
+ }
237
+ }
238
+ }
239
+ }
139
240
  ```
140
241
 
141
242
  **Note on Climate Normals (v1.2.0):**
@@ -144,6 +245,25 @@ export NCEI_API_TOKEN=your_token_here
144
245
  - Get a free token at: https://www.ncdc.noaa.gov/cdo-web/token
145
246
  - If NCEI token is configured but unavailable, the system automatically falls back to Open-Meteo
146
247
 
248
+ #### Saved Locations (NEW in v1.7.0)
249
+
250
+ The saved locations feature stores your favorite places (like "home", "work", "cabin") for easy reuse in weather queries. No configuration needed - it works automatically!
251
+
252
+ **Storage Location:**
253
+ - Data stored in: `~/.weather-mcp/locations.json`
254
+ - Directory created automatically on first save
255
+ - File is human-readable JSON (can be backed up or edited manually)
256
+
257
+ **Features:**
258
+ - No limit on number of saved locations
259
+ - Tag locations with activities (e.g., "boating", "hiking") to help AI provide relevant weather info
260
+ - Persistent across MCP server restarts
261
+ - Portable - copy the file to migrate locations to another machine
262
+
263
+ **Learn More:**
264
+ - See [save_location](#13-save_location-new-in-v170) for usage instructions
265
+ - See [Using Saved Locations](#using-saved-locations-with-weather-tools) for examples
266
+
147
267
  ### Monitoring
148
268
 
149
269
  Use the `check_service_status` tool to view cache statistics including:
@@ -192,7 +312,7 @@ If you prefer to build from source:
192
312
 
193
313
  1. Clone the repository:
194
314
  ```bash
195
- git clone https://github.com/dgahagan/weather-mcp.git
315
+ git clone https://github.com/weather-mcp/weather-mcp.git
196
316
  cd weather-mcp
197
317
  ```
198
318
 
@@ -206,6 +326,14 @@ npm install
206
326
  npm run build
207
327
  ```
208
328
 
329
+ 4. (Optional) Configure environment variables:
330
+ ```bash
331
+ cp .env.example .env
332
+ # Edit .env to customize settings (all optional)
333
+ ```
334
+
335
+ See the [Configuration](#configuration) section for details.
336
+
209
337
  ## Upgrading to Latest Version
210
338
 
211
339
  ### Upgrading npm Installation
@@ -257,7 +385,7 @@ npm run build
257
385
  You can verify your installed version by checking:
258
386
  - npm: `npm list -g @dangahagan/weather-mcp`
259
387
  - Source: `git describe --tags` or check `package.json`
260
- - Latest release: https://github.com/dgahagan/weather-mcp/releases
388
+ - Latest release: https://github.com/weather-mcp/weather-mcp/releases
261
389
 
262
390
  ## Usage with AI Assistants
263
391
 
@@ -581,6 +709,274 @@ Provides comprehensive marine weather data with intelligent dual-source support:
581
709
  - Wave period for planning and safety
582
710
  - Optional 5-day forecast with daily summaries
583
711
 
712
+ ### 9. get_weather_imagery (NEW in v1.5.0)
713
+ Get weather radar and precipitation imagery for visual weather analysis.
714
+
715
+ **Parameters:**
716
+ - `latitude` (required): Latitude coordinate (-90 to 90)
717
+ - `longitude` (required): Longitude coordinate (-180 to 180)
718
+ - `type` (required): Imagery type - "precipitation", "radar", or "satellite" (Note: satellite not yet implemented)
719
+ - `animated` (optional): Return animated loop vs static image (default: false)
720
+ - `layers` (optional): Additional map layers (reserved for future use)
721
+
722
+ **Description:**
723
+ Provides access to weather radar and precipitation imagery from RainViewer API with global coverage. Returns tile URLs for efficient rendering of current precipitation or animated radar loops showing up to 2 hours of history. Perfect for visual confirmation of approaching weather systems.
724
+
725
+ **Examples:**
726
+ ```
727
+ "Show me the current radar for New York"
728
+ "Get animated precipitation radar for London for the last 2 hours"
729
+ "Is there any precipitation showing on radar near me?"
730
+ ```
731
+
732
+ **Returns:**
733
+ - Precipitation radar imagery (static or animated)
734
+ - Tile URLs for efficient rendering
735
+ - Frame timestamps for animated sequences
736
+ - Coverage area and resolution information
737
+ - Automatic coordinate-to-tile calculation
738
+ - Up to 2 hours of historical radar frames when animated
739
+
740
+ **Note:** Satellite imagery is planned for a future release. Precipitation radar provides global coverage via the free RainViewer API.
741
+
742
+ ### 10. get_lightning_activity (NEW in v1.5.0)
743
+ Get real-time lightning strike detection and safety assessment for outdoor activity planning.
744
+
745
+ **Parameters:**
746
+ - `latitude` (required): Latitude coordinate (-90 to 90)
747
+ - `longitude` (required): Longitude coordinate (-180 to 180)
748
+ - `radius` (optional): Search radius in kilometers (1-500, default: 100)
749
+ - `timeWindow` (optional): Historical time window in minutes (1-180, default: 60)
750
+
751
+ **Description:**
752
+ Provides real-time lightning strike detection from the Blitzortung.org global lightning detection network. Includes comprehensive safety assessment with 4 risk levels based on strike proximity. Critical for outdoor safety planning including boating, hiking, golfing, and other outdoor activities.
753
+
754
+ **Examples:**
755
+ ```
756
+ "Are there any lightning strikes near Miami?"
757
+ "Check for lightning activity within 50km"
758
+ "Is it safe to be outside based on lightning?"
759
+ "Show me recent lightning strikes in the last hour"
760
+ ```
761
+
762
+ **Returns:**
763
+ - Real-time lightning strikes within specified radius
764
+ - 4-level safety assessment:
765
+ - **Safe** (>50km): No immediate lightning threat
766
+ - **Elevated** (16-50km): Monitor conditions, plan indoor access
767
+ - **High** (8-16km): Seek shelter immediately
768
+ - **Extreme** (<8km): Active thunderstorm, dangerous conditions
769
+ - Comprehensive statistics:
770
+ - Total strikes and strike density (per sq km)
771
+ - Strikes per minute rate
772
+ - Distance to nearest strike
773
+ - Average distance of all strikes
774
+ - Strike details:
775
+ - Polarity (cloud-to-ground vs intra-cloud)
776
+ - Amplitude in kiloamperes (kA)
777
+ - Precise timestamp and location
778
+ - Safety recommendations based on proximity
779
+ - Geographic region-optimized data retrieval
780
+
781
+ **Note:** Data provided by Blitzortung.org, a free community-operated lightning detection network. May have regional coverage variations.
782
+
783
+ ### 11. get_river_conditions (NEW in v1.6.0)
784
+ Monitor river levels and flood status using NOAA and USGS data sources.
785
+
786
+ **Parameters:**
787
+ - `latitude` (required): Latitude coordinate (-90 to 90)
788
+ - `longitude` (required): Longitude coordinate (-180 to 180)
789
+ - `radius` (optional): Search radius in kilometers (1-500, default: 50)
790
+
791
+ **Description:**
792
+ Provides comprehensive river and streamflow monitoring for flood safety and recreation planning. Automatically finds the nearest river gauges within the specified radius and reports current water levels, flood stages, and flow rates. Uses NOAA National Water Prediction Service (NWPS) for gauge locations and USGS Water Services for real-time streamflow data.
793
+
794
+ **Examples:**
795
+ ```
796
+ "What are the river conditions near St. Louis?" (latitude: 38.6270, longitude: -90.1994)
797
+ "Check for flooding on the Mississippi River"
798
+ "Is the river level safe for kayaking?"
799
+ "Show me nearby river gauge readings"
800
+ ```
801
+
802
+ **Returns:**
803
+ - Nearest river gauges with current water levels
804
+ - Flood stage thresholds (action, minor, moderate, major)
805
+ - Current flood status and forecast
806
+ - Streamflow data (cubic feet per second)
807
+ - Distance to each gauge from query location
808
+ - River and location names
809
+ - Safety assessment for recreation
810
+ - Historical context (flood crests if available)
811
+
812
+ **Note:** US coverage only. Data provided by NOAA National Water Prediction Service and USGS Water Services.
813
+
814
+ ### 12. get_wildfire_info (NEW in v1.6.0)
815
+ Monitor active wildfires and fire perimeters for safety and evacuation planning.
816
+
817
+ **Parameters:**
818
+ - `latitude` (required): Latitude coordinate (-90 to 90)
819
+ - `longitude` (required): Longitude coordinate (-180 to 180)
820
+ - `radius` (optional): Search radius in kilometers (1-500, default: 100)
821
+
822
+ **Description:**
823
+ Provides critical wildfire monitoring and safety information using NIFC (National Interagency Fire Center) data. Reports active wildfires and prescribed burns within the specified radius, including fire size, containment status, and proximity-based safety assessments. Essential for residents in fire-prone regions and outdoor activity planning.
824
+
825
+ **Examples:**
826
+ ```
827
+ "Are there any wildfires near Los Angeles?" (latitude: 34.0522, longitude: -118.2437)
828
+ "Check for active fires in Colorado"
829
+ "How close is the nearest wildfire?"
830
+ "Show me fire perimeters and containment status"
831
+ ```
832
+
833
+ **Returns:**
834
+ - Active wildfire locations within search radius
835
+ - Fire size in acres and hectares
836
+ - Containment percentage with visual indicator
837
+ - Distance from query location to each fire
838
+ - Discovery date and days active
839
+ - Fire type (Wildfire vs Prescribed Fire)
840
+ - Location details (state, county, city)
841
+ - 4-level safety assessment:
842
+ - **EXTREME DANGER** (<5km): Evacuate if advised
843
+ - **HIGH ALERT** (5-25km): Prepare for evacuation
844
+ - **CAUTION** (25-50km): Monitor conditions
845
+ - **AWARENESS** (>50km): Stay informed
846
+ - Evacuation recommendations and safety guidance
847
+
848
+ **Note:** Data from NIFC WFIGS (Wildland Fire Interagency Geospatial Services). Always consult official sources for evacuation orders at https://inciweb.nwcg.gov/
849
+
850
+ ### 13. save_location (NEW in v1.7.0)
851
+ Save a location with an alias for easy reuse in weather queries.
852
+
853
+ **Parameters:**
854
+ - `alias` (required): Short name for the location (e.g., "home", "work", "cabin"). Max 50 characters.
855
+ - `location_query` (optional): Location to geocode and save (e.g., "Seattle, WA", "Paris, France"). Not required if latitude/longitude provided.
856
+ - `latitude` (optional): Latitude if providing coordinates directly. Not required if location_query provided.
857
+ - `longitude` (optional): Longitude if providing coordinates directly. Not required if location_query provided.
858
+ - `name` (optional): Display name (required when using latitude/longitude directly)
859
+ - `activities` (optional): Activities you do at this location (e.g., ["boating", "fishing"]). Helps AI provide relevant weather information. Each activity max 50 characters.
860
+
861
+ **Description:**
862
+ Saves a location to persistent storage (`~/.weather-mcp/locations.json`) for easy reuse. Accepts either a location query (which will be automatically geocoded using Nominatim/OpenStreetMap) or direct coordinates. Once saved, the location can be used in any weather tool by providing `location_name` instead of coordinates.
863
+
864
+ **Smart Updates:** If the alias already exists and you only provide `name` and/or `activities` (without location details), it will update just those fields while preserving all coordinates and metadata. This makes it easy to add activities or rename locations without re-specifying the full address.
865
+
866
+ **Examples:**
867
+ ```
868
+ "Save my home location in Seattle, WA"
869
+ → save_location(alias="home", location_query="Seattle, WA")
870
+
871
+ "Save the cabin at Lake Tahoe"
872
+ → save_location(alias="cabin", location_query="Lake Tahoe, CA")
873
+
874
+ "Save coordinates 47.6062, -122.3321 as my office"
875
+ → save_location(alias="office", latitude=47.6062, longitude=-122.3321, name="Seattle Office")
876
+
877
+ "Save the lake house where we go boating and fishing"
878
+ → save_location(alias="lake_house", location_query="Lake Tahoe, CA", activities=["boating", "fishing"])
879
+
880
+ "Save my favorite hiking spot"
881
+ → save_location(alias="trail", location_query="Mt. Rainier, WA", activities=["hiking", "camping", "photography"])
882
+
883
+ "Add more activities to the cabin" (smart update - no location needed)
884
+ → save_location(alias="cabin", activities=["boating", "fishing", "hiking", "swimming"])
885
+
886
+ "Rename my campsite" (smart update - no location needed)
887
+ → save_location(alias="campsite", name="Yosemite Valley Campground")
888
+ ```
889
+
890
+ **Returns:**
891
+ - Confirmation of save with location details
892
+ - Coordinates, timezone, and administrative region
893
+ - Usage examples showing how to use with weather tools
894
+
895
+ ### 14. list_saved_locations (NEW in v1.7.0)
896
+ View all saved locations.
897
+
898
+ **Parameters:** None
899
+
900
+ **Description:**
901
+ Lists all locations saved in your persistent storage with their aliases, names, coordinates, and save dates. Helpful for seeing what location names are available for use with weather tools.
902
+
903
+ **Examples:**
904
+ ```
905
+ "Show my saved locations"
906
+ "What locations do I have saved?"
907
+ "List all my saved places"
908
+ ```
909
+
910
+ **Returns:**
911
+ - List of all saved locations with full details
912
+ - Usage examples for each location
913
+ - Total count of saved locations
914
+
915
+ ### 15. get_saved_location (NEW in v1.7.0)
916
+ Get details for a specific saved location.
917
+
918
+ **Parameters:**
919
+ - `alias` (required): The name of the saved location to retrieve (e.g., "home", "work")
920
+
921
+ **Description:**
922
+ Retrieves detailed information about a specific saved location, including coordinates, timezone, region information, and save/update timestamps.
923
+
924
+ **Examples:**
925
+ ```
926
+ "Show details for my home location"
927
+ "What are the coordinates for my cabin?"
928
+ "Get info about my work location"
929
+ ```
930
+
931
+ **Returns:**
932
+ - Location name and coordinates
933
+ - Timezone and administrative regions
934
+ - Save and update timestamps
935
+ - Usage examples
936
+
937
+ ### 16. remove_saved_location (NEW in v1.7.0)
938
+ Remove a saved location.
939
+
940
+ **Parameters:**
941
+ - `alias` (required): The name of the saved location to remove (e.g., "home", "work")
942
+
943
+ **Description:**
944
+ Permanently removes a saved location from storage. The location data is deleted and can no longer be used with weather tools unless saved again.
945
+
946
+ **Examples:**
947
+ ```
948
+ "Remove my work location"
949
+ "Delete the cabin from saved locations"
950
+ "Remove home"
951
+ ```
952
+
953
+ **Returns:**
954
+ - Confirmation of removal
955
+ - Count of remaining saved locations
956
+
957
+ ## Using Saved Locations with Weather Tools
958
+
959
+ Once you've saved locations, you can use them with any weather tool by providing `location_name` instead of coordinates:
960
+
961
+ **Examples:**
962
+ ```
963
+ # Instead of:
964
+ get_forecast(latitude=47.6062, longitude=-122.3321)
965
+
966
+ # You can use:
967
+ get_forecast(location_name="home")
968
+
969
+ # Natural language queries work too:
970
+ "What's the weather forecast at home?"
971
+ "How's the air quality at my cabin?"
972
+ "Are there any weather alerts for my work location?"
973
+ ```
974
+
975
+ **Currently Supported Tools:**
976
+ - `get_forecast` - Weather forecasts using saved locations
977
+
978
+ **Coming Soon:** Support for saved locations in all weather tools (current conditions, alerts, air quality, marine conditions, etc.)
979
+
584
980
  ## Error Handling & Service Status
585
981
 
586
982
  ### Enhanced Error Messages
@@ -655,7 +1051,7 @@ Use the `check_service_status` tool to proactively verify API availability:
655
1051
 
656
1052
  ### Automated Test Suite
657
1053
 
658
- This project includes a comprehensive test suite with 722 automated tests:
1054
+ This project includes a comprehensive test suite with 1,042 automated tests:
659
1055
 
660
1056
  ```bash
661
1057
  # Run all tests
@@ -672,14 +1068,14 @@ npm run test:ui
672
1068
  ```
673
1069
 
674
1070
  **Test Coverage:**
675
- - **722 tests** across unit and integration test suites (29 new tests in v1.2.1)
676
- - **100% coverage** on critical utilities (cache, validation, units, errors, normals, snow, timezone)
677
- - **54% overall coverage** with focus on reliability and security
678
- - All tests execute in ~1 second
1071
+ - **1,042 tests** across unit and integration test suites (111 new tests in v1.6.0)
1072
+ - **100% coverage** on critical utilities (cache, validation, units, errors, normals, snow, timezone, distance, geohash, security)
1073
+ - **100% pass rate** with comprehensive security and boundary validation
1074
+ - All tests execute in ~2 seconds
679
1075
 
680
1076
  **Test Categories:**
681
- - **Unit Tests** (427 tests) - Cache, validation, units, errors, config, retry logic, normals, snow, timezone
682
- - **Integration Tests** (19 tests) - Error recovery scenarios, service status checks
1077
+ - **Unit Tests** (965 tests) - Cache, validation, units, errors, config, retry logic, normals, snow, timezone, distance, security, geohash
1078
+ - **Integration Tests** (77 tests) - Error recovery, service status checks, safety & hazards features
683
1079
 
684
1080
  ### Quick API Connectivity Test
685
1081
 
@@ -690,7 +1086,7 @@ npx tsx tests/test_noaa_api.ts
690
1086
 
691
1087
  ### Manual Testing with Claude Code
692
1088
 
693
- See [TESTING_GUIDE.md](./docs/TESTING_GUIDE.md) for comprehensive manual testing instructions including:
1089
+ See [TESTING_GUIDE.md](./docs/testing/TESTING_GUIDE.md) for comprehensive manual testing instructions including:
694
1090
  - Setup steps for MCP clients
695
1091
  - Test cases for all tools
696
1092
  - Error handling verification
@@ -893,6 +1289,43 @@ To report a security vulnerability, please see our [Security Policy](./SECURITY.
893
1289
  - Response timeline commitments (48hr acknowledgment, 7-day assessment)
894
1290
  - Security best practices for users and developers
895
1291
 
1292
+ ## Documentation
1293
+
1294
+ 📚 **[Complete Documentation Index](./docs/README.md)** - Comprehensive navigation guide to all project documentation
1295
+
1296
+ ### Quick Links
1297
+
1298
+ **For Users:**
1299
+ - [Client Setup Guide](./docs/CLIENT_SETUP.md) - Setup instructions for 8 different MCP clients
1300
+ - [Testing Guide](./docs/testing/TESTING_GUIDE.md) - Manual testing procedures
1301
+ - [Error Handling](./docs/ERROR_HANDLING.md) - Enhanced error handling features
1302
+
1303
+ **For Developers:**
1304
+ - [Contributing Guidelines](./CONTRIBUTING.md) - How to contribute
1305
+ - [Development Guide](./CLAUDE.md) - AI assistant development guide
1306
+ - [Code Review](./docs/development/CODE_REVIEW.md) - Code quality analysis
1307
+ - [Security Audit](./docs/development/SECURITY_AUDIT_V1.6.md) - Security assessment
1308
+
1309
+ **Planning & Roadmap:**
1310
+ - [Implementation Plan](./docs/planning/IMPLEMENTATION_PLAN.md) - Project roadmap
1311
+ - [Future Enhancements](./docs/planning/FUTURE_ENHANCEMENTS.md) - Planned features
1312
+ - [Roadmap](./docs/planning/ROADMAP.md) - Long-term plans
1313
+
1314
+ **Testing & Quality:**
1315
+ - [Test Suite](./docs/testing/TEST_SUITE_README.md) - Test overview
1316
+ - [Test Coverage](./docs/testing/TEST_COVERAGE_ANALYSIS_2025.md) - Latest coverage analysis
1317
+ - [Test Recommendations](./docs/testing/TEST_RECOMMENDATIONS.md) - Improvement suggestions
1318
+
1319
+ **Analytics (Optional):**
1320
+ - [Analytics Plan](./docs/analytics/ANALYTICS_MCP_PLAN.md) - Privacy-first analytics
1321
+ - [Analytics Security](./docs/analytics/MCP_ANALYTICS_SECURITY_GUIDE.md) - Security implementation guide
1322
+ - [Local Analytics](./docs/analytics/LOCAL_ANALYTICS_GUIDE.md) - Setup guide
1323
+
1324
+ **Technical Documentation:**
1325
+ - [NOAA API Research](./docs/NOAA_API_RESEARCH.md) - NOAA API integration details
1326
+ - [Historical Data Plan](./docs/HISTORICAL_DATA_PLAN.md) - Historical weather implementation
1327
+ - [MCP Best Practices](./docs/MCP_BEST_PRACTICES.md) - MCP protocol guidelines
1328
+
896
1329
  ## License
897
1330
 
898
1331
  MIT
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Data anonymization utilities for privacy-first analytics
3
+ * Ensures no PII is collected as per docs/ANALYTICS_MCP_PLAN.md
4
+ */
5
+ import { AnalyticsEvent, AnalyticsLevel } from './types.js';
6
+ /**
7
+ * Raw event data before anonymization
8
+ * Includes all possible fields that might be collected
9
+ */
10
+ interface RawEventData {
11
+ version: string;
12
+ tool: string;
13
+ status: 'success' | 'error';
14
+ timestamp_hour: string;
15
+ analytics_level?: AnalyticsLevel;
16
+ error_type?: string;
17
+ response_time_ms?: number;
18
+ service?: string;
19
+ cache_hit?: boolean;
20
+ retry_count?: number;
21
+ country?: string;
22
+ parameters?: Record<string, unknown>;
23
+ session_id?: string;
24
+ sequence_number?: number;
25
+ }
26
+ /**
27
+ * Anonymize event data based on analytics level
28
+ * Strips sensitive information and ensures privacy compliance
29
+ */
30
+ export declare function anonymizeEvent(rawData: RawEventData, level: AnalyticsLevel, salt?: string): AnalyticsEvent;
31
+ /**
32
+ * Round timestamp to nearest hour for privacy
33
+ * Prevents precise user tracking
34
+ */
35
+ export declare function roundToHour(date: Date): string;
36
+ export {};
37
+ //# sourceMappingURL=anonymizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anonymizer.d.ts","sourceRoot":"","sources":["../../src/analytics/anonymizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5D;;;GAGG;AACH,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,cAAc,EACrB,IAAI,CAAC,EAAE,MAAM,GACZ,cAAc,CA0ChB;AAiED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAI9C"}