@jablum/weather-mcp 1.7.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 (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1319 -0
  3. package/dist/analytics/anonymizer.d.ts +37 -0
  4. package/dist/analytics/anonymizer.d.ts.map +1 -0
  5. package/dist/analytics/anonymizer.js +112 -0
  6. package/dist/analytics/anonymizer.js.map +1 -0
  7. package/dist/analytics/collector.d.ts +72 -0
  8. package/dist/analytics/collector.d.ts.map +1 -0
  9. package/dist/analytics/collector.js +282 -0
  10. package/dist/analytics/collector.js.map +1 -0
  11. package/dist/analytics/config.d.ts +15 -0
  12. package/dist/analytics/config.d.ts.map +1 -0
  13. package/dist/analytics/config.js +172 -0
  14. package/dist/analytics/config.js.map +1 -0
  15. package/dist/analytics/index.d.ts +8 -0
  16. package/dist/analytics/index.d.ts.map +1 -0
  17. package/dist/analytics/index.js +7 -0
  18. package/dist/analytics/index.js.map +1 -0
  19. package/dist/analytics/middleware.d.ts +33 -0
  20. package/dist/analytics/middleware.d.ts.map +1 -0
  21. package/dist/analytics/middleware.js +99 -0
  22. package/dist/analytics/middleware.js.map +1 -0
  23. package/dist/analytics/transport.d.ts +11 -0
  24. package/dist/analytics/transport.d.ts.map +1 -0
  25. package/dist/analytics/transport.js +92 -0
  26. package/dist/analytics/transport.js.map +1 -0
  27. package/dist/analytics/types.d.ts +74 -0
  28. package/dist/analytics/types.d.ts.map +1 -0
  29. package/dist/analytics/types.js +6 -0
  30. package/dist/analytics/types.js.map +1 -0
  31. package/dist/config/api.d.ts +30 -0
  32. package/dist/config/api.d.ts.map +1 -0
  33. package/dist/config/api.js +32 -0
  34. package/dist/config/api.js.map +1 -0
  35. package/dist/config/cache.d.ts +31 -0
  36. package/dist/config/cache.d.ts.map +1 -0
  37. package/dist/config/cache.js +108 -0
  38. package/dist/config/cache.js.map +1 -0
  39. package/dist/config/displayThresholds.d.ts +83 -0
  40. package/dist/config/displayThresholds.d.ts.map +1 -0
  41. package/dist/config/displayThresholds.js +83 -0
  42. package/dist/config/displayThresholds.js.map +1 -0
  43. package/dist/config/tools.d.ts +44 -0
  44. package/dist/config/tools.d.ts.map +1 -0
  45. package/dist/config/tools.js +269 -0
  46. package/dist/config/tools.js.map +1 -0
  47. package/dist/errors/ApiError.d.ts +62 -0
  48. package/dist/errors/ApiError.d.ts.map +1 -0
  49. package/dist/errors/ApiError.js +171 -0
  50. package/dist/errors/ApiError.js.map +1 -0
  51. package/dist/handlers/airQualityHandler.d.ts +11 -0
  52. package/dist/handlers/airQualityHandler.d.ts.map +1 -0
  53. package/dist/handlers/airQualityHandler.js +154 -0
  54. package/dist/handlers/airQualityHandler.js.map +1 -0
  55. package/dist/handlers/alertsHandler.d.ts +11 -0
  56. package/dist/handlers/alertsHandler.d.ts.map +1 -0
  57. package/dist/handlers/alertsHandler.js +98 -0
  58. package/dist/handlers/alertsHandler.js.map +1 -0
  59. package/dist/handlers/currentConditionsHandler.d.ts +13 -0
  60. package/dist/handlers/currentConditionsHandler.d.ts.map +1 -0
  61. package/dist/handlers/currentConditionsHandler.js +296 -0
  62. package/dist/handlers/currentConditionsHandler.js.map +1 -0
  63. package/dist/handlers/forecastHandler.d.ts +16 -0
  64. package/dist/handlers/forecastHandler.d.ts.map +1 -0
  65. package/dist/handlers/forecastHandler.js +454 -0
  66. package/dist/handlers/forecastHandler.js.map +1 -0
  67. package/dist/handlers/historicalWeatherHandler.d.ts +12 -0
  68. package/dist/handlers/historicalWeatherHandler.d.ts.map +1 -0
  69. package/dist/handlers/historicalWeatherHandler.js +188 -0
  70. package/dist/handlers/historicalWeatherHandler.js.map +1 -0
  71. package/dist/handlers/lightningHandler.d.ts +14 -0
  72. package/dist/handlers/lightningHandler.d.ts.map +1 -0
  73. package/dist/handlers/lightningHandler.js +258 -0
  74. package/dist/handlers/lightningHandler.js.map +1 -0
  75. package/dist/handlers/locationHandler.d.ts +12 -0
  76. package/dist/handlers/locationHandler.d.ts.map +1 -0
  77. package/dist/handlers/locationHandler.js +149 -0
  78. package/dist/handlers/locationHandler.js.map +1 -0
  79. package/dist/handlers/marineConditionsHandler.d.ts +13 -0
  80. package/dist/handlers/marineConditionsHandler.d.ts.map +1 -0
  81. package/dist/handlers/marineConditionsHandler.js +270 -0
  82. package/dist/handlers/marineConditionsHandler.js.map +1 -0
  83. package/dist/handlers/riverConditionsHandler.d.ts +11 -0
  84. package/dist/handlers/riverConditionsHandler.d.ts.map +1 -0
  85. package/dist/handlers/riverConditionsHandler.js +176 -0
  86. package/dist/handlers/riverConditionsHandler.js.map +1 -0
  87. package/dist/handlers/savedLocationsHandler.d.ts +50 -0
  88. package/dist/handlers/savedLocationsHandler.d.ts.map +1 -0
  89. package/dist/handlers/savedLocationsHandler.js +397 -0
  90. package/dist/handlers/savedLocationsHandler.js.map +1 -0
  91. package/dist/handlers/statusHandler.d.ts +12 -0
  92. package/dist/handlers/statusHandler.d.ts.map +1 -0
  93. package/dist/handlers/statusHandler.js +115 -0
  94. package/dist/handlers/statusHandler.js.map +1 -0
  95. package/dist/handlers/weatherImageryHandler.d.ts +14 -0
  96. package/dist/handlers/weatherImageryHandler.d.ts.map +1 -0
  97. package/dist/handlers/weatherImageryHandler.js +143 -0
  98. package/dist/handlers/weatherImageryHandler.js.map +1 -0
  99. package/dist/handlers/wildfireHandler.d.ts +11 -0
  100. package/dist/handlers/wildfireHandler.d.ts.map +1 -0
  101. package/dist/handlers/wildfireHandler.js +186 -0
  102. package/dist/handlers/wildfireHandler.js.map +1 -0
  103. package/dist/index.d.ts +7 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +735 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/services/blitzortung.d.ts +67 -0
  108. package/dist/services/blitzortung.d.ts.map +1 -0
  109. package/dist/services/blitzortung.js +475 -0
  110. package/dist/services/blitzortung.js.map +1 -0
  111. package/dist/services/geocoding.d.ts +57 -0
  112. package/dist/services/geocoding.d.ts.map +1 -0
  113. package/dist/services/geocoding.js +393 -0
  114. package/dist/services/geocoding.js.map +1 -0
  115. package/dist/services/locationStore.d.ts +62 -0
  116. package/dist/services/locationStore.d.ts.map +1 -0
  117. package/dist/services/locationStore.js +201 -0
  118. package/dist/services/locationStore.js.map +1 -0
  119. package/dist/services/ncei.d.ts +61 -0
  120. package/dist/services/ncei.d.ts.map +1 -0
  121. package/dist/services/ncei.js +126 -0
  122. package/dist/services/ncei.js.map +1 -0
  123. package/dist/services/nifc.d.ts +44 -0
  124. package/dist/services/nifc.d.ts.map +1 -0
  125. package/dist/services/nifc.js +159 -0
  126. package/dist/services/nifc.js.map +1 -0
  127. package/dist/services/noaa.d.ts +161 -0
  128. package/dist/services/noaa.d.ts.map +1 -0
  129. package/dist/services/noaa.js +681 -0
  130. package/dist/services/noaa.js.map +1 -0
  131. package/dist/services/nominatim.d.ts +62 -0
  132. package/dist/services/nominatim.d.ts.map +1 -0
  133. package/dist/services/nominatim.js +254 -0
  134. package/dist/services/nominatim.js.map +1 -0
  135. package/dist/services/openmeteo.d.ts +189 -0
  136. package/dist/services/openmeteo.d.ts.map +1 -0
  137. package/dist/services/openmeteo.js +936 -0
  138. package/dist/services/openmeteo.js.map +1 -0
  139. package/dist/services/rainviewer.d.ts +37 -0
  140. package/dist/services/rainviewer.d.ts.map +1 -0
  141. package/dist/services/rainviewer.js +115 -0
  142. package/dist/services/rainviewer.js.map +1 -0
  143. package/dist/types/imagery.d.ts +82 -0
  144. package/dist/types/imagery.d.ts.map +1 -0
  145. package/dist/types/imagery.js +6 -0
  146. package/dist/types/imagery.js.map +1 -0
  147. package/dist/types/lightning.d.ts +89 -0
  148. package/dist/types/lightning.d.ts.map +1 -0
  149. package/dist/types/lightning.js +6 -0
  150. package/dist/types/lightning.js.map +1 -0
  151. package/dist/types/noaa.d.ts +535 -0
  152. package/dist/types/noaa.d.ts.map +1 -0
  153. package/dist/types/noaa.js +5 -0
  154. package/dist/types/noaa.js.map +1 -0
  155. package/dist/types/nominatim.d.ts +72 -0
  156. package/dist/types/nominatim.d.ts.map +1 -0
  157. package/dist/types/nominatim.js +6 -0
  158. package/dist/types/nominatim.js.map +1 -0
  159. package/dist/types/openmeteo.d.ts +583 -0
  160. package/dist/types/openmeteo.d.ts.map +1 -0
  161. package/dist/types/openmeteo.js +6 -0
  162. package/dist/types/openmeteo.js.map +1 -0
  163. package/dist/types/savedLocations.d.ts +58 -0
  164. package/dist/types/savedLocations.d.ts.map +1 -0
  165. package/dist/types/savedLocations.js +5 -0
  166. package/dist/types/savedLocations.js.map +1 -0
  167. package/dist/types/wildfire.d.ts +83 -0
  168. package/dist/types/wildfire.d.ts.map +1 -0
  169. package/dist/types/wildfire.js +5 -0
  170. package/dist/types/wildfire.js.map +1 -0
  171. package/dist/utils/airQuality.d.ts +54 -0
  172. package/dist/utils/airQuality.d.ts.map +1 -0
  173. package/dist/utils/airQuality.js +251 -0
  174. package/dist/utils/airQuality.js.map +1 -0
  175. package/dist/utils/cache.d.ts +69 -0
  176. package/dist/utils/cache.d.ts.map +1 -0
  177. package/dist/utils/cache.js +164 -0
  178. package/dist/utils/cache.js.map +1 -0
  179. package/dist/utils/distance.d.ts +25 -0
  180. package/dist/utils/distance.d.ts.map +1 -0
  181. package/dist/utils/distance.js +40 -0
  182. package/dist/utils/distance.js.map +1 -0
  183. package/dist/utils/fireWeather.d.ts +76 -0
  184. package/dist/utils/fireWeather.d.ts.map +1 -0
  185. package/dist/utils/fireWeather.js +243 -0
  186. package/dist/utils/fireWeather.js.map +1 -0
  187. package/dist/utils/geography.d.ts +79 -0
  188. package/dist/utils/geography.d.ts.map +1 -0
  189. package/dist/utils/geography.js +266 -0
  190. package/dist/utils/geography.js.map +1 -0
  191. package/dist/utils/geohash.d.ts +62 -0
  192. package/dist/utils/geohash.d.ts.map +1 -0
  193. package/dist/utils/geohash.js +146 -0
  194. package/dist/utils/geohash.js.map +1 -0
  195. package/dist/utils/locationResolver.d.ts +34 -0
  196. package/dist/utils/locationResolver.d.ts.map +1 -0
  197. package/dist/utils/locationResolver.js +120 -0
  198. package/dist/utils/locationResolver.js.map +1 -0
  199. package/dist/utils/logger.d.ts +75 -0
  200. package/dist/utils/logger.d.ts.map +1 -0
  201. package/dist/utils/logger.js +153 -0
  202. package/dist/utils/logger.js.map +1 -0
  203. package/dist/utils/marine.d.ts +59 -0
  204. package/dist/utils/marine.d.ts.map +1 -0
  205. package/dist/utils/marine.js +215 -0
  206. package/dist/utils/marine.js.map +1 -0
  207. package/dist/utils/normals.d.ts +86 -0
  208. package/dist/utils/normals.d.ts.map +1 -0
  209. package/dist/utils/normals.js +223 -0
  210. package/dist/utils/normals.js.map +1 -0
  211. package/dist/utils/snow.d.ts +45 -0
  212. package/dist/utils/snow.d.ts.map +1 -0
  213. package/dist/utils/snow.js +144 -0
  214. package/dist/utils/snow.js.map +1 -0
  215. package/dist/utils/temperatureConversion.d.ts +12 -0
  216. package/dist/utils/temperatureConversion.d.ts.map +1 -0
  217. package/dist/utils/temperatureConversion.js +17 -0
  218. package/dist/utils/temperatureConversion.js.map +1 -0
  219. package/dist/utils/timezone.d.ts +56 -0
  220. package/dist/utils/timezone.d.ts.map +1 -0
  221. package/dist/utils/timezone.js +167 -0
  222. package/dist/utils/timezone.js.map +1 -0
  223. package/dist/utils/units.d.ts +69 -0
  224. package/dist/utils/units.d.ts.map +1 -0
  225. package/dist/utils/units.js +158 -0
  226. package/dist/utils/units.js.map +1 -0
  227. package/dist/utils/validation.d.ts +89 -0
  228. package/dist/utils/validation.d.ts.map +1 -0
  229. package/dist/utils/validation.js +177 -0
  230. package/dist/utils/validation.js.map +1 -0
  231. package/dist/utils/version.d.ts +15 -0
  232. package/dist/utils/version.d.ts.map +1 -0
  233. package/dist/utils/version.js +24 -0
  234. package/dist/utils/version.js.map +1 -0
  235. package/package.json +74 -0
package/README.md ADDED
@@ -0,0 +1,1319 @@
1
+ # Weather MCP Server
2
+
3
+ [![npm version](https://badge.fury.io/js/@dangahagan%2Fweather-mcp.svg)](https://www.npmjs.com/package/@dangahagan/weather-mcp)
4
+ [![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.dgahagan/weather-mcp)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ An MCP (Model Context Protocol) server that provides **global weather data** to AI systems like Claude Code. Uses NOAA's API for detailed US weather, plus Open-Meteo for international forecasts and historical weather data worldwide.
8
+
9
+ **📦 Available in the [Official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.dgahagan/weather-mcp)** as `io.github.dgahagan/weather-mcp`
10
+
11
+ **No API keys required!** All APIs (NOAA, Open-Meteo) are free to use with no authentication needed.
12
+
13
+ ## Features
14
+
15
+ - **Global Weather Forecasts**: Get forecasts for any location worldwide (ENHANCED in v0.4.0)
16
+ - Automatic source selection: NOAA (US, more detailed) or Open-Meteo (international)
17
+ - Extended forecasts up to 16 days (was 7)
18
+ - Sunrise/sunset times with daylight duration
19
+ - Daily or hourly granularity
20
+ - Precipitation probability display
21
+ - Temperature trends, humidity, wind, and UV index
22
+ - **Current Conditions**: Get enhanced real-time weather observations for US locations
23
+ - Heat index and wind chill when relevant
24
+ - 24-hour temperature range
25
+ - Wind gusts and detailed cloud cover
26
+ - Recent precipitation history
27
+ - Optional fire weather indices (see below)
28
+ - **Location Search**: Find coordinates for any location worldwide (v0.4.0)
29
+ - Convert location names to coordinates ("Paris" → 48.8534°, 2.3488°)
30
+ - Support for cities, airports, landmarks, and regions globally
31
+ - Detailed metadata: timezone, elevation, population, country
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
41
+ - **Climate Normals - Historical Context**: Compare weather to 30-year averages (NEW in v1.2.0)
42
+ - **Optional enhancement** for current conditions and forecasts (`include_normals=true`)
43
+ - Shows normal high/low temperatures and precipitation for comparison
44
+ - Displays departure from normal ("10°F warmer than normal")
45
+ - **Hybrid data strategy**: Open-Meteo computed normals (global, free) or optional NOAA NCEI official normals (US only, requires free API token)
46
+ - Based on 1991-2020 climate normals period
47
+ - Helps understand if weather is unusual for the time of year
48
+ - **Snow and Ice Data**: Enhanced winter weather information (NEW in v1.2.0)
49
+ - Snow depth on ground (current conditions, US only)
50
+ - Snowfall accumulation forecasts with time periods
51
+ - Ice accumulation forecasts for freezing rain events
52
+ - Smart threshold-based display (filters trace amounts)
53
+ - Unit conversions from metric to imperial
54
+ - **Timezone-Aware Display**: All timestamps in local time (NEW in v1.2.0)
55
+ - Automatic timezone detection from coordinates
56
+ - All times displayed in location's local timezone
57
+ - Includes timezone abbreviations (EST, PDT, etc.)
58
+ - Handles daylight saving time transitions
59
+ - Formatted time ranges for forecast periods
60
+ - **Weather Alerts**: Get active weather watches, warnings, and advisories for US locations
61
+ - Severity levels (Extreme, Severe, Moderate, Minor)
62
+ - Urgency and certainty indicators
63
+ - Effective and expiration times
64
+ - Instructions and recommended responses
65
+ - **Historical Data**: Access historical weather observations for any location worldwide
66
+ - Recent data (last 7 days): Detailed hourly observations from NOAA real-time API (US only)
67
+ - Archival data (>7 days old): Hourly/daily weather data from 1940-present via Open-Meteo (global coverage)
68
+ - **Air Quality Monitoring**: Comprehensive air quality data for any location worldwide (v0.5.0)
69
+ - Air Quality Index (AQI) with automatic region detection (US AQI or European EAQI)
70
+ - Health recommendations based on AQI levels
71
+ - Pollutant concentrations (PM2.5, PM10, O₃, NO₂, SO₂, CO, NH₃)
72
+ - UV Index with sun protection recommendations
73
+ - Optional hourly air quality forecasts (5-day outlook)
74
+ - Categorized health risk levels (Good, Moderate, Unhealthy, etc.)
75
+ - Activity recommendations for sensitive populations
76
+ - **Severe Weather Probabilities**: Probabilistic severe weather forecasting (NEW in v0.6.0)
77
+ - US locations only (NOAA gridpoint data)
78
+ - Optional enhancement to forecasts (`include_severe_weather` parameter)
79
+ - Thunderstorm probability for next 48 hours
80
+ - Wind gust probabilities (20-60+ mph categories)
81
+ - Tropical storm and hurricane wind probabilities
82
+ - Lightning activity levels
83
+ - Smart display showing only significant threats
84
+ - Works with both daily and hourly forecasts
85
+ - **Fire Weather Data**: Fire danger indices for US locations (v0.5.0)
86
+ - Haines Index (atmospheric fire growth potential)
87
+ - Grassland Fire Danger Index
88
+ - Red Flag Threat Index
89
+ - Mixing Height (smoke dispersion indicator)
90
+ - Transport Wind Speed (smoke transport)
91
+ - Optional enhancement to current conditions
92
+ - **Marine Conditions**: Comprehensive marine weather for coastal and ocean areas (NEW in v0.6.0)
93
+ - Global coverage for waves, swell, and ocean currents
94
+ - Significant wave height with safety categorization (Calm to Extreme)
95
+ - Wind waves (locally generated) and swell (distant systems) separation
96
+ - Wave period and direction for planning
97
+ - Ocean current velocity and direction
98
+ - Optional 5-day marine forecast with daily summaries
99
+ - Safety assessment for maritime activities (sailing, boating, surfing)
100
+ - Wave interpretation guide based on Douglas Sea Scale
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)
135
+ - **Service Status Checking**: Proactively verify API availability with health checks
136
+ - **Enhanced Error Handling**: Detailed, actionable error messages with status page links
137
+ - **Intelligent Caching**: Built-in in-memory cache reduces API calls and improves performance
138
+
139
+ ## Caching
140
+
141
+ The Weather MCP server includes an intelligent in-memory caching system that significantly improves performance for AI-driven weather queries.
142
+
143
+ ### Benefits
144
+
145
+ - **Faster Responses**: Cached queries return in <10ms vs 200-1000ms for API calls
146
+ - **Reduced API Load**: 50-80% fewer API calls for typical AI conversation patterns
147
+ - **Rate Limit Protection**: Prevents hitting API rate limits during heavy usage
148
+ - **Automatic Management**: Smart TTL-based expiration with LRU eviction
149
+
150
+ ### How It Works
151
+
152
+ The cache automatically stores and retrieves weather data with intelligent expiration:
153
+
154
+ - **Location Searches**: Cached for 30 days (locations don't move)
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
160
+ - **Marine Conditions**: Cached for 1 hour (marine data updates hourly) - NEW in v0.6.0
161
+ - **Air Quality Data**: Cached for 1 hour (air quality updates hourly) - v0.5.0
162
+ - **Fire Weather Data**: Cached for 2 hours (gridpoint data updates ~hourly) - v0.5.0
163
+ - **Weather Alerts**: Cached for 5 minutes (alerts can change rapidly)
164
+ - **Forecasts**: Cached for 2 hours (updated approximately hourly)
165
+ - **Current Conditions**: Cached for 15 minutes (observations update every 20-60 minutes)
166
+ - **Historical Data (>1 day old)**: Cached indefinitely (finalized data never changes)
167
+ - **Recent Historical (<1 day)**: Cached for 1 hour (may still be updated)
168
+ - **Grid Coordinates**: Cached indefinitely (geographic mappings are static)
169
+
170
+ ### Configuration
171
+
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:
177
+
178
+ ```bash
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)
191
+
192
+ All settings have sensible defaults and can be omitted entirely.
193
+
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
+ }
240
+ ```
241
+
242
+ **Note on Climate Normals (v1.2.0):**
243
+ - By default, climate normals use Open-Meteo's computed 30-year averages (completely free, global coverage, zero setup)
244
+ - Optionally, you can configure a free NCEI API token to use official NOAA climate normals for US locations
245
+ - Get a free token at: https://www.ncdc.noaa.gov/cdo-web/token
246
+ - If NCEI token is configured but unavailable, the system automatically falls back to Open-Meteo
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
+
267
+ ### Monitoring
268
+
269
+ Use the `check_service_status` tool to view cache statistics including:
270
+ - Hit rate percentage
271
+ - Cache size and utilization
272
+ - API call reduction metrics
273
+
274
+ For detailed information about caching architecture and configuration, see [.github/CACHING.md](./.github/CACHING.md).
275
+
276
+ ## Installation
277
+
278
+ ### Quick Install (Recommended)
279
+
280
+ **Via npm:**
281
+ ```bash
282
+ npm install -g @dangahagan/weather-mcp
283
+ ```
284
+
285
+ **Via npx (no installation, always uses latest):**
286
+ ```bash
287
+ npx -y @dangahagan/weather-mcp@latest
288
+ ```
289
+
290
+ Then configure in your MCP client using:
291
+ ```json
292
+ {
293
+ "mcpServers": {
294
+ "weather": {
295
+ "command": "npx",
296
+ "args": ["-y", "@dangahagan/weather-mcp@latest"]
297
+ }
298
+ }
299
+ }
300
+ ```
301
+
302
+ ### From Source
303
+
304
+ If you prefer to build from source:
305
+
306
+ **Prerequisites:**
307
+ - Node.js 18 or higher
308
+ - npm or yarn
309
+ - **No API keys or tokens required**
310
+
311
+ **Setup:**
312
+
313
+ 1. Clone the repository:
314
+ ```bash
315
+ git clone https://github.com/weather-mcp/weather-mcp.git
316
+ cd weather-mcp
317
+ ```
318
+
319
+ 2. Install dependencies:
320
+ ```bash
321
+ npm install
322
+ ```
323
+
324
+ 3. Build the project:
325
+ ```bash
326
+ npm run build
327
+ ```
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
+
337
+ ## Upgrading to Latest Version
338
+
339
+ ### Upgrading npm Installation
340
+
341
+ If you installed via npm globally:
342
+
343
+ ```bash
344
+ # Check your current version
345
+ npm list -g @dangahagan/weather-mcp
346
+
347
+ # Update to latest version
348
+ npm update -g @dangahagan/weather-mcp
349
+
350
+ # Or reinstall to ensure latest version
351
+ npm install -g @dangahagan/weather-mcp@latest
352
+ ```
353
+
354
+ **For npx users:** If you're using `@latest` (recommended), no upgrade needed! The `npx -y @dangahagan/weather-mcp@latest` command always fetches the newest version.
355
+
356
+ ### Upgrading from Source
357
+
358
+ If you cloned the repository:
359
+
360
+ ```bash
361
+ # Navigate to your installation directory
362
+ cd /path/to/weather-mcp
363
+
364
+ # Fetch latest changes
365
+ git fetch origin
366
+
367
+ # Check current version
368
+ git describe --tags
369
+
370
+ # Update to latest release
371
+ git checkout main
372
+ git pull origin main
373
+
374
+ # Reinstall dependencies and rebuild
375
+ npm install
376
+ npm run build
377
+ ```
378
+
379
+ **After upgrading:**
380
+ - Restart your MCP client (Claude Desktop, Claude Code, etc.)
381
+ - Check the changelog at [CHANGELOG.md](./CHANGELOG.md) for breaking changes
382
+ - Verify the new version with the latest features
383
+
384
+ **Version Check:**
385
+ You can verify your installed version by checking:
386
+ - npm: `npm list -g @dangahagan/weather-mcp`
387
+ - Source: `git describe --tags` or check `package.json`
388
+ - Latest release: https://github.com/weather-mcp/weather-mcp/releases
389
+
390
+ ## Usage with AI Assistants
391
+
392
+ This MCP server works with any client that supports the Model Context Protocol, including:
393
+
394
+ - **Claude Desktop** - Official Claude desktop application
395
+ - **Claude Code** - Official Claude CLI tool
396
+ - **Cline** - VS Code extension for AI-assisted coding
397
+ - **Cursor** - AI-powered code editor
398
+ - **Zed** - High-performance code editor with AI features
399
+ - **VS Code (GitHub Copilot)** - With MCP support enabled
400
+ - **LM Studio** - Local AI model interface
401
+ - **Postman** - API platform with MCP integration
402
+
403
+ For detailed setup instructions for each client, see **[CLIENT_SETUP.md](./docs/CLIENT_SETUP.md)**.
404
+
405
+ ### Quick Start: Claude Code
406
+
407
+ Edit `~/.config/claude-code/mcp_settings.json` (macOS/Linux) or `%APPDATA%\claude-code\mcp_settings.json` (Windows):
408
+
409
+ **Recommended (npx, always latest):**
410
+ ```json
411
+ {
412
+ "mcpServers": {
413
+ "weather": {
414
+ "command": "npx",
415
+ "args": ["-y", "@dangahagan/weather-mcp@latest"]
416
+ }
417
+ }
418
+ }
419
+ ```
420
+
421
+ **Alternative (from source):**
422
+ ```json
423
+ {
424
+ "mcpServers": {
425
+ "weather": {
426
+ "command": "node",
427
+ "args": ["/absolute/path/to/weather-mcp/dist/index.js"]
428
+ }
429
+ }
430
+ }
431
+ ```
432
+
433
+ Restart Claude Code and the weather tools will be available.
434
+
435
+ ## Finding Coordinates
436
+
437
+ **NEW in v0.4.0**: Use the built-in `search_location` tool to find coordinates automatically!
438
+
439
+ ```
440
+ "What's the weather in Paris?"
441
+ → Uses search_location to find Paris coordinates (48.8534°, 2.3488°)
442
+ → Then gets the forecast for those coordinates
443
+ ```
444
+
445
+ You can also find coordinates manually:
446
+ - Using Google Maps: Right-click a location and select the coordinates
447
+ - Using a geocoding service like geocode.maps.co or nominatim.org
448
+
449
+ ### Common City Coordinates (For Reference)
450
+
451
+ | City | Latitude | Longitude |
452
+ |------|----------|-----------|
453
+ | Paris, France | 48.8534 | 2.3488 |
454
+ | Tokyo, Japan | 35.6895 | 139.6917 |
455
+ | London, UK | 51.5085 | -0.1257 |
456
+ | New York, NY | 40.7128 | -74.0060 |
457
+ | San Francisco, CA | 37.7749 | -122.4194 |
458
+ | Sydney, Australia | -33.8688 | 151.2093 |
459
+ | Berlin, Germany | 52.5200 | 13.4050 |
460
+ | Dubai, UAE | 25.2048 | 55.2708 |
461
+
462
+ ## Available Tools
463
+
464
+ ### 1. get_forecast (ENHANCED in v0.4.0, v1.2.0)
465
+ Get weather forecast for any location worldwide.
466
+
467
+ **Parameters:**
468
+ - `latitude` (optional): Latitude coordinate (-90 to 90). Not required if `location_name` or `city_name` is provided.
469
+ - `longitude` (optional): Longitude coordinate (-180 to 180). Not required if `location_name` or `city_name` is provided.
470
+ - `location_name` (optional): Saved location alias (e.g., `"home"`). See saved locations below.
471
+ - `city_name` (optional): City or place name to geocode (e.g., `"Paris, France"`). For cities in China, use pinyin only (e.g., `"Beijing"`, not `"北京"`). Uses the same geocoding as `search_location`.
472
+ - `days` (optional): Number of days in forecast (1-16, default: 7)
473
+ - `granularity` (optional): "daily" or "hourly" (default: "daily")
474
+ - `include_precipitation_probability` (optional): Include rain chances (default: true)
475
+ - `include_normals` (optional): Include climate normals for comparison (default: false, NEW in v1.2.0)
476
+ - `source` (optional): "auto" (default), "noaa" (US only), or "openmeteo" (global)
477
+
478
+ **Description:**
479
+ Automatically selects the best data source: NOAA for US locations (more detailed) or Open-Meteo for international locations. Supports extended forecasts up to 16 days. Includes sunrise/sunset times, daylight duration, temperature, precipitation, wind, and UV index.
480
+
481
+ **Examples:**
482
+ ```
483
+ "Get a 7-day forecast for Paris (48.8534, 2.3488)"
484
+ "Hourly forecast for Tokyo for the next 3 days"
485
+ "16-day extended forecast for Sydney, Australia"
486
+ ```
487
+
488
+ **Returns:**
489
+ - Temperature (high/low, feels like)
490
+ - Sunrise and sunset times with daylight duration (NEW in v0.4.0)
491
+ - Precipitation chances and amounts
492
+ - Wind speed, direction, and gusts
493
+ - Weather conditions and descriptions
494
+ - UV index (for international locations)
495
+ - Humidity and atmospheric conditions
496
+ - Climate normals comparison (when `include_normals=true`, NEW in v1.2.0)
497
+ - Snow and ice accumulation forecasts (when available, NEW in v1.2.0)
498
+ - All timestamps in local timezone (NEW in v1.2.0)
499
+
500
+ ### 2. search_location (NEW in v0.4.0)
501
+ Find coordinates for any location worldwide by name.
502
+
503
+ **Parameters:**
504
+ - `query` (required): Location name to search for (e.g., "Paris", "New York, NY", "Tokyo")
505
+ - `limit` (optional): Maximum number of results to return (1-100, default: 5)
506
+
507
+ **Description:**
508
+ Converts location names to coordinates using the Open-Meteo Geocoding API. Returns multiple matches with detailed metadata including coordinates, timezone, elevation, population, and administrative regions. Enables natural language weather queries by finding coordinates automatically.
509
+
510
+ **Examples:**
511
+ ```
512
+ "Find coordinates for Paris"
513
+ "Search for Tokyo, Japan"
514
+ "Where is San Francisco, CA?"
515
+ ```
516
+
517
+ **Returns:**
518
+ - Location name and full administrative hierarchy
519
+ - Latitude and longitude coordinates
520
+ - Timezone and elevation
521
+ - Population (when available)
522
+ - Country and region information
523
+ - Feature type (capital, city, airport, etc.)
524
+
525
+ ### 3. get_alerts
526
+ Get active weather alerts, watches, warnings, and advisories for US locations.
527
+
528
+ **Parameters:**
529
+ - `latitude` (required): Latitude coordinate (-90 to 90)
530
+ - `longitude` (required): Longitude coordinate (-180 to 180)
531
+ - `active_only` (optional): Show only active alerts (default: true)
532
+
533
+ **Description:**
534
+ Retrieves current weather alerts from the NOAA API for safety-critical weather information. Returns severity levels (Extreme, Severe, Moderate, Minor), urgency indicators, effective/expiration times, and affected areas. Alerts are automatically sorted by severity with the most critical first.
535
+
536
+ **Examples:**
537
+ ```
538
+ "Are there any weather alerts for Miami, Florida?"
539
+ "Check for severe weather warnings in Oklahoma City"
540
+ "What weather watches are active in my area?" (latitude: 40.7128, longitude: -74.0060)
541
+ ```
542
+
543
+ **Returns:**
544
+ - Alert type and severity (Extreme → Severe → Moderate → Minor)
545
+ - Urgency, certainty, and response type
546
+ - Event description and instructions
547
+ - Effective and expiration times
548
+ - Affected geographic areas
549
+ - Recommended actions and safety information
550
+
551
+ ### 4. get_historical_weather
552
+ Get historical weather observations for a location.
553
+
554
+ **Parameters:**
555
+ - `latitude` (required): Latitude coordinate (-90 to 90)
556
+ - `longitude` (required): Longitude coordinate (-180 to 180)
557
+ - `start_date` (required): Start date in ISO format (YYYY-MM-DD)
558
+ - `end_date` (required): End date in ISO format (YYYY-MM-DD)
559
+ - `limit` (optional): Max observations to return (1-500, default: 168)
560
+
561
+ **Data Source Selection:**
562
+ The server automatically chooses the best data source based on your date range:
563
+
564
+ - **Last 7 days**: Uses NOAA real-time API
565
+ - ✓ Detailed hourly observations from weather stations
566
+ - ✓ Includes: temperature, conditions, wind speed, humidity, pressure
567
+ - ✓ High reliability and availability
568
+ - ⚠️ US locations only
569
+
570
+ - **Older than 7 days**: Uses Open-Meteo Historical Weather API
571
+ - ✓ No API token required
572
+ - ✓ Global coverage (worldwide)
573
+ - ✓ Historical data from 1940 to present
574
+ - ✓ Hourly data for ranges up to 31 days
575
+ - ✓ Daily summaries for longer periods
576
+ - ✓ Includes: temperature, precipitation, wind, humidity, pressure, cloud cover
577
+ - ✓ High resolution reanalysis data (9-25km grid)
578
+ - ⚠️ 5-day delay for most recent data
579
+
580
+ **Examples:**
581
+
582
+ Recent data (US locations, detailed observations):
583
+ ```
584
+ "What was the weather like in Chicago 3 days ago?"
585
+ Coordinates: latitude: 41.8781, longitude: -87.6298
586
+ Date range: 3 days ago to 2 days ago
587
+ ```
588
+
589
+ Historical data (global coverage):
590
+ ```
591
+ "What was the weather in Paris on January 15, 2024?"
592
+ Coordinates: latitude: 48.8566, longitude: 2.3522
593
+ Date range: 2024-01-15 to 2024-01-15
594
+ ```
595
+
596
+ Long-term historical analysis:
597
+ ```
598
+ "Show me weather data for Tokyo from January 1, 2020 to December 31, 2020"
599
+ Coordinates: latitude: 35.6762, longitude: 139.6503
600
+ Date range: 2020-01-01 to 2020-12-31
601
+ ```
602
+
603
+ **Troubleshooting:**
604
+ If you get "No historical data available":
605
+ - For recent dates (last 7 days): Ensure you're using US coordinates
606
+ - For older dates: Data should be available globally back to 1940
607
+ - Note: Most recent data has a 5-day delay
608
+ - Very recent dates (last 5 days) may not be available in archival data yet
609
+
610
+ ### 5. get_air_quality (NEW in v0.5.0)
611
+ Get comprehensive air quality data for any location worldwide.
612
+
613
+ **Parameters:**
614
+ - `latitude` (required): Latitude coordinate (-90 to 90)
615
+ - `longitude` (required): Longitude coordinate (-180 to 180)
616
+ - `forecast` (optional): Include hourly forecast for next 5 days (default: false)
617
+
618
+ **Description:**
619
+ Provides current air quality conditions using the Open-Meteo Air Quality API with automatic AQI scale selection (US AQI for US locations, European EAQI elsewhere). Includes health recommendations, pollutant concentrations, and UV index.
620
+
621
+ **Examples:**
622
+ ```
623
+ "What's the air quality in Los Angeles?"
624
+ "Check pollution levels in Beijing"
625
+ "Get air quality forecast for Paris for the next 5 days"
626
+ ```
627
+
628
+ **Returns:**
629
+ - Air Quality Index (AQI) with appropriate scale (US or European)
630
+ - Health risk category and recommendations
631
+ - Pollutant concentrations (PM2.5, PM10, O₃, NO₂, SO₂, CO, NH₃)
632
+ - UV Index with sun protection guidance
633
+ - Activity recommendations for sensitive groups
634
+ - Optional 5-day hourly forecast
635
+
636
+ ### 6. check_service_status
637
+ Check the operational status of weather APIs and cache performance.
638
+
639
+ **Parameters:** None
640
+
641
+ **Description:**
642
+ Performs health checks on both NOAA and Open-Meteo APIs to verify they are operational. Use this tool when experiencing errors or to proactively verify service availability before making weather data requests. Returns current status, helpful messages, links to official status pages, and cache statistics.
643
+
644
+ **Example:**
645
+ ```
646
+ Check if the weather services are operational
647
+ ```
648
+
649
+ **Returns:**
650
+ - Operational status for NOAA API (forecasts & current conditions)
651
+ - Operational status for Open-Meteo API (historical data & forecasts)
652
+ - Cache statistics (hit rate, size, API call reduction)
653
+ - Status page links and recommended actions if issues are detected
654
+ - Overall service availability summary
655
+
656
+ ### 7. get_marine_conditions (NEW in v0.6.0, Enhanced in v1.1.0)
657
+ Get marine weather conditions including wave height, swell, ocean currents, and sea state with automatic source selection for Great Lakes and coastal bays.
658
+
659
+ **Parameters:**
660
+ - `latitude` (required): Latitude coordinate (-90 to 90)
661
+ - `longitude` (required): Longitude coordinate (-180 to 180)
662
+ - `forecast` (optional): Include 5-day marine forecast (default: false)
663
+
664
+ **Description:**
665
+ Provides comprehensive marine weather data with intelligent dual-source support:
666
+ - **Great Lakes & Coastal Bays (NEW in v1.1.0)**: Automatically uses NOAA gridpoint data for all 5 Great Lakes (Superior, Michigan, Huron, Erie, Ontario) and major US coastal bays (Chesapeake Bay, San Francisco Bay, Tampa Bay, Puget Sound, Lake Okeechobee). Provides wave height, wave period, wave direction, and wind conditions.
667
+ - **Ocean Coverage**: Uses Open-Meteo Marine API for global ocean coverage, including significant wave height with Douglas Sea Scale categorization, wind waves vs swell separation, wave period/direction, ocean currents, and safety assessment for maritime activities.
668
+ - **Automatic Selection**: Intelligent geographic detection automatically selects the best data source with zero configuration required.
669
+
670
+ **Important:** Data has limited accuracy in coastal areas and is NOT suitable for coastal navigation - always consult official marine forecasts.
671
+
672
+ **Examples:**
673
+ ```
674
+ "What are the ocean conditions off the coast of California?"
675
+ "Get wave height and swell for surfing in Hawaii"
676
+ "Check marine conditions in the Atlantic Ocean" (latitude: 30.0, longitude: -60.0)
677
+ ```
678
+
679
+ **Returns:**
680
+ - Significant wave height (meters/feet) with safety category
681
+ - Wind waves (locally generated) height and direction
682
+ - Swell height, period, and direction (from distant systems)
683
+ - Ocean current velocity and direction
684
+ - Sea state interpretation (Calm → Phenomenal based on Douglas Sea Scale)
685
+ - Safety assessment for maritime activities
686
+ - Wave period for planning and safety
687
+ - Optional 5-day forecast with daily summaries
688
+
689
+ ### 8. get_weather_imagery (NEW in v1.5.0)
690
+ Get weather radar and precipitation imagery for visual weather analysis.
691
+
692
+ **Parameters:**
693
+ - `latitude` (required): Latitude coordinate (-90 to 90)
694
+ - `longitude` (required): Longitude coordinate (-180 to 180)
695
+ - `type` (required): Imagery type - "precipitation", "radar", or "satellite" (Note: satellite not yet implemented)
696
+ - `animated` (optional): Return animated loop vs static image (default: false)
697
+ - `layers` (optional): Additional map layers (reserved for future use)
698
+
699
+ **Description:**
700
+ 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.
701
+
702
+ **Examples:**
703
+ ```
704
+ "Show me the current radar for New York"
705
+ "Get animated precipitation radar for London for the last 2 hours"
706
+ "Is there any precipitation showing on radar near me?"
707
+ ```
708
+
709
+ **Returns:**
710
+ - Precipitation radar imagery (static or animated)
711
+ - Tile URLs for efficient rendering
712
+ - Frame timestamps for animated sequences
713
+ - Coverage area and resolution information
714
+ - Automatic coordinate-to-tile calculation
715
+ - Up to 2 hours of historical radar frames when animated
716
+
717
+ **Note:** Satellite imagery is planned for a future release. Precipitation radar provides global coverage via the free RainViewer API.
718
+
719
+ ### 9. get_lightning_activity (NEW in v1.5.0)
720
+ Get real-time lightning strike detection and safety assessment for outdoor activity planning.
721
+
722
+ **Parameters:**
723
+ - `latitude` (required): Latitude coordinate (-90 to 90)
724
+ - `longitude` (required): Longitude coordinate (-180 to 180)
725
+ - `radius` (optional): Search radius in kilometers (1-500, default: 100)
726
+ - `timeWindow` (optional): Historical time window in minutes (1-180, default: 60)
727
+
728
+ **Description:**
729
+ 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.
730
+
731
+ **Examples:**
732
+ ```
733
+ "Are there any lightning strikes near Miami?"
734
+ "Check for lightning activity within 50km"
735
+ "Is it safe to be outside based on lightning?"
736
+ "Show me recent lightning strikes in the last hour"
737
+ ```
738
+
739
+ **Returns:**
740
+ - Real-time lightning strikes within specified radius
741
+ - 4-level safety assessment:
742
+ - **Safe** (>50km): No immediate lightning threat
743
+ - **Elevated** (16-50km): Monitor conditions, plan indoor access
744
+ - **High** (8-16km): Seek shelter immediately
745
+ - **Extreme** (<8km): Active thunderstorm, dangerous conditions
746
+ - Comprehensive statistics:
747
+ - Total strikes and strike density (per sq km)
748
+ - Strikes per minute rate
749
+ - Distance to nearest strike
750
+ - Average distance of all strikes
751
+ - Strike details:
752
+ - Polarity (cloud-to-ground vs intra-cloud)
753
+ - Amplitude in kiloamperes (kA)
754
+ - Precise timestamp and location
755
+ - Safety recommendations based on proximity
756
+ - Geographic region-optimized data retrieval
757
+
758
+ **Note:** Data provided by Blitzortung.org, a free community-operated lightning detection network. May have regional coverage variations.
759
+
760
+ ### 10. get_river_conditions (NEW in v1.6.0)
761
+ Monitor river levels and flood status using NOAA and USGS data sources.
762
+
763
+ **Parameters:**
764
+ - `latitude` (required): Latitude coordinate (-90 to 90)
765
+ - `longitude` (required): Longitude coordinate (-180 to 180)
766
+ - `radius` (optional): Search radius in kilometers (1-500, default: 50)
767
+
768
+ **Description:**
769
+ 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.
770
+
771
+ **Examples:**
772
+ ```
773
+ "What are the river conditions near St. Louis?" (latitude: 38.6270, longitude: -90.1994)
774
+ "Check for flooding on the Mississippi River"
775
+ "Is the river level safe for kayaking?"
776
+ "Show me nearby river gauge readings"
777
+ ```
778
+
779
+ **Returns:**
780
+ - Nearest river gauges with current water levels
781
+ - Flood stage thresholds (action, minor, moderate, major)
782
+ - Current flood status and forecast
783
+ - Streamflow data (cubic feet per second)
784
+ - Distance to each gauge from query location
785
+ - River and location names
786
+ - Safety assessment for recreation
787
+ - Historical context (flood crests if available)
788
+
789
+ **Note:** US coverage only. Data provided by NOAA National Water Prediction Service and USGS Water Services.
790
+
791
+ ### 11. get_wildfire_info (NEW in v1.6.0)
792
+ Monitor active wildfires and fire perimeters for safety and evacuation planning.
793
+
794
+ **Parameters:**
795
+ - `latitude` (required): Latitude coordinate (-90 to 90)
796
+ - `longitude` (required): Longitude coordinate (-180 to 180)
797
+ - `radius` (optional): Search radius in kilometers (1-500, default: 100)
798
+
799
+ **Description:**
800
+ 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.
801
+
802
+ **Examples:**
803
+ ```
804
+ "Are there any wildfires near Los Angeles?" (latitude: 34.0522, longitude: -118.2437)
805
+ "Check for active fires in Colorado"
806
+ "How close is the nearest wildfire?"
807
+ "Show me fire perimeters and containment status"
808
+ ```
809
+
810
+ **Returns:**
811
+ - Active wildfire locations within search radius
812
+ - Fire size in acres and hectares
813
+ - Containment percentage with visual indicator
814
+ - Distance from query location to each fire
815
+ - Discovery date and days active
816
+ - Fire type (Wildfire vs Prescribed Fire)
817
+ - Location details (state, county, city)
818
+ - 4-level safety assessment:
819
+ - **EXTREME DANGER** (<5km): Evacuate if advised
820
+ - **HIGH ALERT** (5-25km): Prepare for evacuation
821
+ - **CAUTION** (25-50km): Monitor conditions
822
+ - **AWARENESS** (>50km): Stay informed
823
+ - Evacuation recommendations and safety guidance
824
+
825
+ **Note:** Data from NIFC WFIGS (Wildland Fire Interagency Geospatial Services). Always consult official sources for evacuation orders at https://inciweb.nwcg.gov/
826
+
827
+ ### 12. save_location (NEW in v1.7.0)
828
+ Save a location with an alias for easy reuse in weather queries.
829
+
830
+ **Parameters:**
831
+ - `alias` (required): Short name for the location (e.g., "home", "work", "cabin"). Max 50 characters.
832
+ - `location_query` (optional): Location to geocode and save (e.g., "Seattle, WA", "Paris, France"). Not required if latitude/longitude provided.
833
+ - `latitude` (optional): Latitude if providing coordinates directly. Not required if location_query provided.
834
+ - `longitude` (optional): Longitude if providing coordinates directly. Not required if location_query provided.
835
+ - `name` (optional): Display name (required when using latitude/longitude directly)
836
+ - `activities` (optional): Activities you do at this location (e.g., ["boating", "fishing"]). Helps AI provide relevant weather information. Each activity max 50 characters.
837
+
838
+ **Description:**
839
+ 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.
840
+
841
+ **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.
842
+
843
+ **Examples:**
844
+ ```
845
+ "Save my home location in Seattle, WA"
846
+ → save_location(alias="home", location_query="Seattle, WA")
847
+
848
+ "Save the cabin at Lake Tahoe"
849
+ → save_location(alias="cabin", location_query="Lake Tahoe, CA")
850
+
851
+ "Save coordinates 47.6062, -122.3321 as my office"
852
+ → save_location(alias="office", latitude=47.6062, longitude=-122.3321, name="Seattle Office")
853
+
854
+ "Save the lake house where we go boating and fishing"
855
+ → save_location(alias="lake_house", location_query="Lake Tahoe, CA", activities=["boating", "fishing"])
856
+
857
+ "Save my favorite hiking spot"
858
+ → save_location(alias="trail", location_query="Mt. Rainier, WA", activities=["hiking", "camping", "photography"])
859
+
860
+ "Add more activities to the cabin" (smart update - no location needed)
861
+ → save_location(alias="cabin", activities=["boating", "fishing", "hiking", "swimming"])
862
+
863
+ "Rename my campsite" (smart update - no location needed)
864
+ → save_location(alias="campsite", name="Yosemite Valley Campground")
865
+ ```
866
+
867
+ **Returns:**
868
+ - Confirmation of save with location details
869
+ - Coordinates, timezone, and administrative region
870
+ - Usage examples showing how to use with weather tools
871
+
872
+ ### 13. list_saved_locations (NEW in v1.7.0)
873
+ View all saved locations.
874
+
875
+ **Parameters:** None
876
+
877
+ **Description:**
878
+ 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.
879
+
880
+ **Examples:**
881
+ ```
882
+ "Show my saved locations"
883
+ "What locations do I have saved?"
884
+ "List all my saved places"
885
+ ```
886
+
887
+ **Returns:**
888
+ - List of all saved locations with full details
889
+ - Usage examples for each location
890
+ - Total count of saved locations
891
+
892
+ ### 14. get_saved_location (NEW in v1.7.0)
893
+ Get details for a specific saved location.
894
+
895
+ **Parameters:**
896
+ - `alias` (required): The name of the saved location to retrieve (e.g., "home", "work")
897
+
898
+ **Description:**
899
+ Retrieves detailed information about a specific saved location, including coordinates, timezone, region information, and save/update timestamps.
900
+
901
+ **Examples:**
902
+ ```
903
+ "Show details for my home location"
904
+ "What are the coordinates for my cabin?"
905
+ "Get info about my work location"
906
+ ```
907
+
908
+ **Returns:**
909
+ - Location name and coordinates
910
+ - Timezone and administrative regions
911
+ - Save and update timestamps
912
+ - Usage examples
913
+
914
+ ### 15. remove_saved_location (NEW in v1.7.0)
915
+ Remove a saved location.
916
+
917
+ **Parameters:**
918
+ - `alias` (required): The name of the saved location to remove (e.g., "home", "work")
919
+
920
+ **Description:**
921
+ Permanently removes a saved location from storage. The location data is deleted and can no longer be used with weather tools unless saved again.
922
+
923
+ **Examples:**
924
+ ```
925
+ "Remove my work location"
926
+ "Delete the cabin from saved locations"
927
+ "Remove home"
928
+ ```
929
+
930
+ **Returns:**
931
+ - Confirmation of removal
932
+ - Count of remaining saved locations
933
+
934
+ ## Using Saved Locations with Weather Tools
935
+
936
+ Once you've saved locations, you can use them with any weather tool by providing `location_name` instead of coordinates:
937
+
938
+ **Examples:**
939
+ ```
940
+ # Instead of:
941
+ get_forecast(latitude=47.6062, longitude=-122.3321)
942
+
943
+ # You can use:
944
+ get_forecast(location_name="home")
945
+
946
+ # Or geocode a city/place name directly:
947
+ get_forecast(city_name="Paris, France")
948
+
949
+ # Natural language queries work too:
950
+ "What's the weather forecast at home?"
951
+ "How's the air quality at my cabin?"
952
+ "Are there any weather alerts for my work location?"
953
+ ```
954
+
955
+ **Currently Supported Tools:**
956
+ - `get_forecast` - Weather forecasts using saved locations
957
+
958
+ **Coming Soon:** Support for saved locations in all weather tools (current conditions, alerts, air quality, marine conditions, etc.)
959
+
960
+ ## Error Handling & Service Status
961
+
962
+ ### Enhanced Error Messages
963
+
964
+ This MCP server provides detailed, actionable error messages when issues occur. All error messages include:
965
+
966
+ - **Clear problem description** - What went wrong and why
967
+ - **Contextual help** - Specific guidance based on the error type
968
+ - **Status page links** - Direct links to official service status pages
969
+ - **Recommended actions** - Concrete steps to resolve or investigate the issue
970
+
971
+ **Example Error Messages:**
972
+
973
+ When a service is down:
974
+ ```
975
+ NOAA API server error: Service temporarily unavailable
976
+
977
+ The NOAA Weather API may be experiencing an outage.
978
+
979
+ Check service status:
980
+ - Planned outages: https://weather-gov.github.io/api/planned-outages
981
+ - Service notices: https://www.weather.gov/notification
982
+ - Report issues: nco.ops@noaa.gov or (301) 683-1518
983
+ ```
984
+
985
+ When rate limited:
986
+ ```
987
+ Open-Meteo API rate limit exceeded (10,000 requests/day for non-commercial use).
988
+
989
+ Please retry later or consider:
990
+ - Reducing request frequency
991
+ - Using daily instead of hourly data for longer periods
992
+ - Upgrading to a commercial plan for higher limits
993
+
994
+ More info: https://open-meteo.com/en/pricing
995
+ ```
996
+
997
+ ### Service Status Checking
998
+
999
+ Use the `check_service_status` tool to proactively verify API availability:
1000
+
1001
+ ```
1002
+ # Query example
1003
+ "Check if the weather services are working"
1004
+
1005
+ # Returns:
1006
+ - ✅/❌ Status for NOAA API (US forecasts & current conditions)
1007
+ - ✅/❌ Status for Open-Meteo API (global historical data)
1008
+ - Links to official status pages
1009
+ - Recommended actions if issues detected
1010
+ - Overall service availability summary
1011
+ ```
1012
+
1013
+ **When to use:**
1014
+ - Before making multiple weather requests
1015
+ - When experiencing errors or timeouts
1016
+ - To verify service availability after an outage
1017
+ - For monitoring and alerting purposes
1018
+
1019
+ **Status Page Links:**
1020
+ - **NOAA API:**
1021
+ - Planned outages: https://weather-gov.github.io/api/planned-outages
1022
+ - Service notices: https://www.weather.gov/notification
1023
+ - Report issues: https://weather-gov.github.io/api/reporting-issues
1024
+
1025
+ - **Open-Meteo API:**
1026
+ - Production status: https://open-meteo.com/en/docs/model-updates
1027
+ - GitHub issues: https://github.com/open-meteo/open-meteo/issues
1028
+ - Documentation: https://open-meteo.com/en/docs
1029
+
1030
+ ## Testing
1031
+
1032
+ ### Automated Test Suite
1033
+
1034
+ This project includes a comprehensive test suite with 1,042 automated tests:
1035
+
1036
+ ```bash
1037
+ # Run all tests
1038
+ npm test
1039
+
1040
+ # Run tests with coverage report
1041
+ npm run test:coverage
1042
+
1043
+ # Run tests in watch mode (during development)
1044
+ npm run test:watch
1045
+
1046
+ # Run tests with interactive UI
1047
+ npm run test:ui
1048
+ ```
1049
+
1050
+ **Test Coverage:**
1051
+ - **1,042 tests** across unit and integration test suites (111 new tests in v1.6.0)
1052
+ - **100% coverage** on critical utilities (cache, validation, units, errors, normals, snow, timezone, distance, geohash, security)
1053
+ - **100% pass rate** with comprehensive security and boundary validation
1054
+ - All tests execute in ~2 seconds
1055
+
1056
+ **Test Categories:**
1057
+ - **Unit Tests** (965 tests) - Cache, validation, units, errors, config, retry logic, normals, snow, timezone, distance, security, geohash
1058
+ - **Integration Tests** (77 tests) - Error recovery, service status checks, safety & hazards features
1059
+
1060
+ ### Quick API Connectivity Test
1061
+
1062
+ Verify NOAA API connectivity with a quick integration test:
1063
+ ```bash
1064
+ npx tsx tests/test_noaa_api.ts
1065
+ ```
1066
+
1067
+ ### Manual Testing with Claude Code
1068
+
1069
+ See [TESTING_GUIDE.md](./docs/testing/TESTING_GUIDE.md) for comprehensive manual testing instructions including:
1070
+ - Setup steps for MCP clients
1071
+ - Test cases for all tools
1072
+ - Error handling verification
1073
+ - Performance testing
1074
+ - Debugging tips
1075
+
1076
+ ## Development
1077
+
1078
+ ### Available Scripts
1079
+
1080
+ **Build & Run:**
1081
+ - `npm run build` - Compile TypeScript to JavaScript
1082
+ - `npm run dev` - Run the server in development mode with tsx
1083
+ - `npm start` - Run the compiled server
1084
+
1085
+ **Testing:**
1086
+ - `npm test` - Run all automated tests
1087
+ - `npm run test:coverage` - Run tests with coverage report
1088
+ - `npm run test:watch` - Run tests in watch mode
1089
+ - `npm run test:ui` - Run tests with interactive UI
1090
+ - `npx tsx tests/test_noaa_api.ts` - Quick API connectivity test
1091
+
1092
+ **Security & Maintenance:**
1093
+ - `npm run audit` - Check for dependency vulnerabilities
1094
+ - `npm run audit:fix` - Automatically fix dependency vulnerabilities
1095
+
1096
+ ### Project Structure
1097
+
1098
+ ```
1099
+ weather-mcp/
1100
+ ├── src/
1101
+ │ ├── index.ts # Main MCP server
1102
+ │ ├── config/
1103
+ │ │ ├── api.ts # API configuration (NCEI token) - NEW in v1.2.0
1104
+ │ │ ├── cache.ts # Cache configuration and TTL strategies
1105
+ │ │ └── displayThresholds.ts # Display thresholds for weather conditions
1106
+ │ ├── errors/
1107
+ │ │ └── ApiError.ts # Custom error class hierarchy
1108
+ │ ├── handlers/
1109
+ │ │ ├── alertsHandler.ts # Weather alerts tool handler
1110
+ │ │ ├── forecastHandler.ts # Forecast tool handler
1111
+ │ │ ├── historicalWeatherHandler.ts # Historical weather handler
1112
+ │ │ ├── airQualityHandler.ts # Air quality handler
1113
+ │ │ ├── marineConditionsHandler.ts # Marine conditions handler
1114
+ │ │ ├── locationHandler.ts # Location search handler
1115
+ │ │ └── statusHandler.ts # Service status handler
1116
+ │ ├── services/
1117
+ │ │ ├── noaa.ts # NOAA API service
1118
+ │ │ ├── openmeteo.ts # Open-Meteo API service
1119
+ │ │ └── ncei.ts # NCEI climate normals service - NEW in v1.2.0
1120
+ │ ├── types/
1121
+ │ │ ├── noaa.ts # NOAA TypeScript type definitions
1122
+ │ │ └── openmeteo.ts # Open-Meteo TypeScript type definitions
1123
+ │ └── utils/
1124
+ │ ├── cache.ts # LRU cache implementation
1125
+ │ ├── logger.ts # Structured logging utilities
1126
+ │ ├── temperatureConversion.ts # Temperature conversion helpers
1127
+ │ ├── units.ts # Unit conversion utilities
1128
+ │ ├── validation.ts # Input validation functions
1129
+ │ ├── normals.ts # Climate normals utilities - NEW in v1.2.0
1130
+ │ ├── snow.ts # Snow and ice data utilities - NEW in v1.2.0
1131
+ │ └── timezone.ts # Timezone-aware formatting - NEW in v1.2.0
1132
+ ├── tests/
1133
+ │ ├── unit/ # Unit tests (427 tests) - 93 new tests in v1.2.0
1134
+ │ └── integration/ # Integration tests (19 tests)
1135
+ ├── dist/ # Compiled JavaScript (generated)
1136
+ ├── docs/ # Documentation
1137
+ └── package.json
1138
+ ```
1139
+
1140
+ ## API Information
1141
+
1142
+ This server uses three weather APIs:
1143
+
1144
+ ### NOAA Weather API (Real-time, US)
1145
+ - **Base URL**: https://api.weather.gov
1146
+ - **Authentication**: None required (User-Agent header only)
1147
+ - **Rate Limits**: Enforced with 5-second retry window
1148
+ - **Coverage**: United States locations only
1149
+ - **Use cases**: US forecasts (detailed), current conditions, recent observations (last 7 days)
1150
+ - **Data**: Detailed hourly observations from weather stations
1151
+
1152
+ ### Open-Meteo Forecast API (Global) - NEW in v0.4.0
1153
+ - **Base URL**: https://api.open-meteo.com/v1
1154
+ - **Authentication**: None required (no API token needed)
1155
+ - **Rate Limits**: 10,000 requests/day for non-commercial use
1156
+ - **Coverage**: Global (worldwide locations)
1157
+ - **Use cases**: International forecasts, extended forecasts (up to 16 days)
1158
+ - **Data**: Temperature, precipitation, wind, humidity, UV index, sunrise/sunset
1159
+ - **Resolution**: 11km global grid resolution
1160
+
1161
+ ### Open-Meteo Geocoding API (Global) - NEW in v0.4.0
1162
+ - **Base URL**: https://geocoding-api.open-meteo.com/v1
1163
+ - **Authentication**: None required (no API token needed)
1164
+ - **Coverage**: Global (worldwide locations)
1165
+ - **Use cases**: Location name to coordinates conversion
1166
+ - **Data**: Coordinates, timezone, elevation, population, administrative regions
1167
+ - **Cache**: 30-day TTL (locations don't move)
1168
+
1169
+ ### Open-Meteo Historical Weather API (Global, Archival)
1170
+ - **Base URL**: https://archive-api.open-meteo.com/v1
1171
+ - **Authentication**: None required (no API token needed)
1172
+ - **Rate Limits**: 10,000 requests/day for non-commercial use
1173
+ - **Coverage**: Global (worldwide locations)
1174
+ - **Use cases**: Historical weather data from 1940 to present
1175
+ - **Data**: Hourly or daily temperature, precipitation, wind, humidity, pressure, cloud cover
1176
+ - **Resolution**: 9-25km grid resolution from reanalysis models
1177
+ - **Delay**: 5-day delay for most recent data
1178
+
1179
+ For more details on NOAA APIs, see [NOAA_API_RESEARCH.md](./docs/NOAA_API_RESEARCH.md).
1180
+
1181
+ ## Limitations
1182
+
1183
+ ### Geographic Coverage
1184
+
1185
+ **Forecasts:** (UPDATED in v0.4.0)
1186
+ - **Global coverage** via automatic source selection
1187
+ - US locations: Uses NOAA API (more detailed, includes narratives)
1188
+ - International locations: Uses Open-Meteo API (reliable global forecasts)
1189
+ - Extended forecasts (>7 days, up to 16 days): Open-Meteo only
1190
+
1191
+ **Current Conditions:**
1192
+ - **US locations only** (NOAA API)
1193
+ - International real-time conditions not yet supported
1194
+
1195
+ **Historical Data:**
1196
+ - Recent data (last 7 days): **US locations only** (NOAA API)
1197
+ - Archival data (>7 days old): **Global coverage** (Open-Meteo API)
1198
+
1199
+ ### Historical Data (get_historical_weather)
1200
+
1201
+ **Recent Data (Last 7 Days)** - US Only, High Detail:
1202
+ - ✓ Detailed hourly observations from weather stations
1203
+ - ✓ No API token required
1204
+ - ⚠️ US locations only
1205
+ - ⚠️ May have occasional gaps depending on weather station
1206
+ - ⚠️ Observations may be delayed up to 20 minutes
1207
+
1208
+ **Archival Data (Older than 7 Days)** - Global, Reanalysis-Based:
1209
+ - ✓ Global coverage (any location worldwide)
1210
+ - ✓ No API token required
1211
+ - ✓ Reliable data from 1940 to present
1212
+ - ✓ Hourly data for date ranges up to 31 days
1213
+ - ✓ Daily summaries for longer periods
1214
+ - ⚠️ Most recent data has a 5-day delay
1215
+ - ⚠️ Reanalysis-based (grid model, not direct station observations)
1216
+
1217
+ ### Rate Limits
1218
+ - **NOAA Weather API**: Automatic retry with exponential backoff on rate limit errors
1219
+ - **Open-Meteo API**: 10,000 requests/day for non-commercial use
1220
+
1221
+ ### Recommendations
1222
+ - **For recent US weather**: Use dates within the last 7 days for detailed station observations
1223
+ - **For historical analysis**: Open-Meteo provides reliable global coverage back to 1940
1224
+ - **For international locations**: Only historical data (>7 days old) is supported
1225
+
1226
+ ## Security
1227
+
1228
+ This project takes security seriously and implements multiple layers of protection:
1229
+
1230
+ ### Security Features
1231
+
1232
+ **Input Validation:**
1233
+ - Comprehensive runtime validation for all user inputs
1234
+ - NaN and Infinity checks for numeric coordinates
1235
+ - Range validation for latitude (-90 to 90) and longitude (-180 to 180)
1236
+ - Type checking with TypeScript strict mode
1237
+
1238
+ **Error Handling:**
1239
+ - Custom error class hierarchy with typed errors
1240
+ - Error message sanitization to prevent information leakage
1241
+ - Retryable errors clearly identified for graceful recovery
1242
+ - Network errors sanitized before display
1243
+
1244
+ **Dependency Security:**
1245
+ - Automated dependency scanning via `npm audit`
1246
+ - GitHub Dependabot configured for weekly security updates
1247
+ - Minimal dependency footprint (3 runtime dependencies)
1248
+ - Zero known vulnerabilities in current dependencies
1249
+
1250
+ **Reliability:**
1251
+ - Exponential backoff with jitter prevents thundering herd problems
1252
+ - Comprehensive test suite (247 tests) with 100% coverage on critical utilities
1253
+ - Memory-safe cache with automatic cleanup
1254
+ - Graceful shutdown handling
1255
+
1256
+ ### Security Audit
1257
+
1258
+ The project has undergone a comprehensive security audit:
1259
+ - **Overall Security Posture:** B+ (Good)
1260
+ - **Risk Level:** LOW
1261
+ - **Vulnerabilities:** Zero critical or high-severity issues
1262
+ - See [SECURITY_AUDIT.md](./docs/development/SECURITY_AUDIT.md) for full audit report
1263
+
1264
+ ### Reporting Security Issues
1265
+
1266
+ To report a security vulnerability, please see our [Security Policy](./SECURITY.md) which includes:
1267
+ - Vulnerability reporting procedures
1268
+ - Response timeline commitments (48hr acknowledgment, 7-day assessment)
1269
+ - Security best practices for users and developers
1270
+
1271
+ ## Documentation
1272
+
1273
+ 📚 **[Complete Documentation Index](./docs/README.md)** - Comprehensive navigation guide to all project documentation
1274
+
1275
+ ### Quick Links
1276
+
1277
+ **For Users:**
1278
+ - [Client Setup Guide](./docs/CLIENT_SETUP.md) - Setup instructions for 8 different MCP clients
1279
+ - [Testing Guide](./docs/testing/TESTING_GUIDE.md) - Manual testing procedures
1280
+ - [Error Handling](./docs/ERROR_HANDLING.md) - Enhanced error handling features
1281
+
1282
+ **For Developers:**
1283
+ - [Contributing Guidelines](./CONTRIBUTING.md) - How to contribute
1284
+ - [Development Guide](./CLAUDE.md) - AI assistant development guide
1285
+ - [Code Review](./docs/development/CODE_REVIEW.md) - Code quality analysis
1286
+ - [Security Audit](./docs/development/SECURITY_AUDIT_V1.6.md) - Security assessment
1287
+
1288
+ **Planning & Roadmap:**
1289
+ - [Implementation Plan](./docs/planning/IMPLEMENTATION_PLAN.md) - Project roadmap
1290
+ - [Future Enhancements](./docs/planning/FUTURE_ENHANCEMENTS.md) - Planned features
1291
+ - [Roadmap](./docs/planning/ROADMAP.md) - Long-term plans
1292
+
1293
+ **Testing & Quality:**
1294
+ - [Test Suite](./docs/testing/TEST_SUITE_README.md) - Test overview
1295
+ - [Test Coverage](./docs/testing/TEST_COVERAGE_ANALYSIS_2025.md) - Latest coverage analysis
1296
+ - [Test Recommendations](./docs/testing/TEST_RECOMMENDATIONS.md) - Improvement suggestions
1297
+
1298
+ **Analytics (Optional):**
1299
+ - [Analytics Plan](./docs/analytics/ANALYTICS_MCP_PLAN.md) - Privacy-first analytics
1300
+ - [Analytics Security](./docs/analytics/MCP_ANALYTICS_SECURITY_GUIDE.md) - Security implementation guide
1301
+ - [Local Analytics](./docs/analytics/LOCAL_ANALYTICS_GUIDE.md) - Setup guide
1302
+
1303
+ **Technical Documentation:**
1304
+ - [NOAA API Research](./docs/NOAA_API_RESEARCH.md) - NOAA API integration details
1305
+ - [Historical Data Plan](./docs/HISTORICAL_DATA_PLAN.md) - Historical weather implementation
1306
+ - [MCP Best Practices](./docs/MCP_BEST_PRACTICES.md) - MCP protocol guidelines
1307
+
1308
+ ## License
1309
+
1310
+ MIT
1311
+
1312
+ ## Contributing
1313
+
1314
+ Contributions are welcome! Please feel free to submit a Pull Request.
1315
+
1316
+ For information about code quality, security considerations, and development best practices, see:
1317
+ - [CODE_REVIEW.md](./docs/development/CODE_REVIEW.md) - Comprehensive code quality analysis
1318
+ - [CONTRIBUTING.md](./CONTRIBUTING.md) - Contribution guidelines
1319
+ - [SECURITY.md](./SECURITY.md) - Security policy and vulnerability reporting