@dangahagan/weather-mcp 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -1229
- package/package.json +16 -4
package/README.md
CHANGED
|
@@ -3,291 +3,117 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@dangahagan/weather-mcp)
|
|
4
4
|
[](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.dgahagan/weather-mcp)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](./docs/testing/TEST_SUITE_README.md)
|
|
7
|
+
[](https://nodejs.org)
|
|
6
8
|
|
|
7
|
-
|
|
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:
|
|
9
|
+
**Give your AI assistant real weather data — 16 tools, zero API keys, zero signup, zero cost.**
|
|
177
10
|
|
|
178
|
-
|
|
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:**
|
|
11
|
+
Weather MCP is a [Model Context Protocol](https://modelcontextprotocol.io) server that connects AI assistants (Claude, Cursor, Cline, Zed, and any other MCP client) to live weather data: forecasts, current conditions, alerts, air quality, marine conditions, lightning, radar, rivers, wildfires, and 85+ years of historical weather. It's built entirely on free public data sources — NOAA, Open-Meteo, USGS, NIFC, RainViewer, and Blitzortung.org — so there is nothing to sign up for and no key to paste in.
|
|
205
12
|
|
|
206
13
|
```bash
|
|
207
|
-
|
|
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
|
|
14
|
+
claude mcp add weather -- npx -y @dangahagan/weather-mcp@latest
|
|
212
15
|
```
|
|
213
16
|
|
|
214
|
-
|
|
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:
|
|
17
|
+
That's the whole install for Claude Code. For any other MCP client, add this to its MCP config:
|
|
225
18
|
|
|
226
19
|
```json
|
|
227
20
|
{
|
|
228
21
|
"mcpServers": {
|
|
229
22
|
"weather": {
|
|
230
23
|
"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
|
-
}
|
|
24
|
+
"args": ["-y", "@dangahagan/weather-mcp@latest"]
|
|
237
25
|
}
|
|
238
26
|
}
|
|
239
27
|
}
|
|
240
28
|
```
|
|
241
29
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
30
|
+
Then just ask:
|
|
31
|
+
|
|
32
|
+
> *"What's the weather in Tokyo this weekend?"*
|
|
33
|
+
> *"Is there any lightning near the lake right now?"*
|
|
34
|
+
> *"How does today compare to normal for this time of year?"*
|
|
35
|
+
> *"Are there wildfires within 50 miles of my cabin?"*
|
|
36
|
+
> *"What was the weather in Paris on June 6, 1944?"*
|
|
37
|
+
|
|
38
|
+
📦 Listed in the [Official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.dgahagan/weather-mcp) as `io.github.dgahagan/weather-mcp`.
|
|
39
|
+
|
|
40
|
+
## Why this server?
|
|
41
|
+
|
|
42
|
+
There are excellent commercial weather MCPs backed by paid APIs and full-time teams. If you need SLA-backed data, minute-level nowcasting, or premium global station coverage, they're worth a look — this project won't pretend otherwise.
|
|
43
|
+
|
|
44
|
+
Choose this one if you want:
|
|
45
|
+
|
|
46
|
+
- **Genuinely free** — every data source is a free public API. No trial that expires, no credit card, no rate-limited "free tier" bait.
|
|
47
|
+
- **No API keys** — install to first forecast in under a minute. Nothing to configure, nothing to leak into a repo.
|
|
48
|
+
- **Fully open source** — MIT licensed, readable TypeScript, 1,084 tests. Audit it, fork it, fix it.
|
|
49
|
+
- **Privacy-respecting** — your queries go directly from your machine to public weather APIs. No middleman server, no telemetry.
|
|
50
|
+
- **Breadth** — 16 tools covering weather, safety hazards (lightning, floods, wildfires), marine conditions, air quality, and historical data back to 1940. Most weather MCPs stop at forecasts.
|
|
247
51
|
|
|
248
|
-
|
|
52
|
+
The tradeoff is honest: US data (NOAA) is richer than international data (Open-Meteo), some tools are US-only, and free APIs come with fair-use rate limits. See [Coverage & Limitations](#coverage--limitations).
|
|
249
53
|
|
|
250
|
-
|
|
54
|
+
## Tools
|
|
251
55
|
|
|
252
|
-
**
|
|
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)
|
|
56
|
+
All 16 tools, documented in detail in **[docs/TOOLS.md](./docs/TOOLS.md)**:
|
|
256
57
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
-
|
|
261
|
-
|
|
58
|
+
| Tool | What it does | Coverage |
|
|
59
|
+
|------|-------------|----------|
|
|
60
|
+
| `get_forecast` | Daily/hourly forecasts up to 16 days, sunrise/sunset, UV, precipitation probability, optional climate-normals comparison | 🌍 Global |
|
|
61
|
+
| `get_current_conditions` | Real-time observations: temperature, wind, heat index/wind chill, snow depth, optional fire-weather indices | 🇺🇸 US |
|
|
62
|
+
| `get_alerts` | Active watches, warnings, and advisories sorted by severity | 🇺🇸 US |
|
|
63
|
+
| `get_historical_weather` | Hourly/daily observations from 1940 to present | 🌍 Global |
|
|
64
|
+
| `search_location` | Geocode place names to coordinates ("Paris" → 48.85, 2.35) | 🌍 Global |
|
|
65
|
+
| `get_air_quality` | AQI (US/European scales), pollutants, UV index, health guidance | 🌍 Global |
|
|
66
|
+
| `get_marine_conditions` | Wave height, swell, ocean currents, Douglas Sea Scale — includes Great Lakes and major US bays | 🌍 Global |
|
|
67
|
+
| `get_weather_imagery` | Precipitation radar (static or 2-hour animated loops) + GOES satellite imagery | 🌍 Global |
|
|
68
|
+
| `get_lightning_activity` | Real-time strike detection with 4-level proximity safety assessment | 🌍 Global |
|
|
69
|
+
| `get_river_conditions` | River gauge levels, flood stages, streamflow | 🇺🇸 US |
|
|
70
|
+
| `get_wildfire_info` | Active fires, containment, size, proximity-based safety guidance | 🇺🇸 US |
|
|
71
|
+
| `check_service_status` | Health checks for all upstream APIs plus cache statistics | — |
|
|
72
|
+
| `save_location` | Save places as aliases ("home", "cabin") with optional activity tags | — |
|
|
73
|
+
| `list_saved_locations` | List all saved locations | — |
|
|
74
|
+
| `get_saved_location` | Details for one saved location | — |
|
|
75
|
+
| `remove_saved_location` | Delete a saved location | — |
|
|
262
76
|
|
|
263
|
-
**
|
|
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
|
|
77
|
+
> **Default preset:** to keep your AI's context lean, the server exposes 5 essential tools by default (`forecast`, `current_conditions`, `alerts`, `search_location`, `check_service_status`). Enable everything with one environment variable — see [Tool Selection](#tool-selection).
|
|
266
78
|
|
|
267
|
-
|
|
79
|
+
## Feature highlights
|
|
268
80
|
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
81
|
+
- **Smart source selection** — US queries use NOAA (detailed, includes forecaster narratives); everywhere else uses Open-Meteo. You never pick; it just works.
|
|
82
|
+
- **Saved locations** — save "home", "work", or "cabin" once, then ask *"what's the weather at home?"* Locations persist in `~/.weather-mcp/locations.json` and can be tagged with activities ("boating", "skiing") so the AI highlights what matters to you.
|
|
83
|
+
- **Climate context** — optional 30-year climate normals show how today compares: *"10°F warmer than normal for this date."*
|
|
84
|
+
- **Safety-aware output** — lightning, wildfire, flood, and marine tools include graded safety assessments and plain-language recommendations, not just raw numbers.
|
|
85
|
+
- **Winter weather** — snow depth, snowfall accumulation, and ice accumulation forecasts with sensible trace-amount filtering.
|
|
86
|
+
- **Timezone-aware** — every timestamp is rendered in the location's local time with DST handled correctly.
|
|
87
|
+
- **Built-in caching** — an LRU cache with per-data-type TTLs (5 minutes for alerts, 2 hours for forecasts, forever for finalized historical data) makes repeat queries return in <10ms and cuts upstream API calls by 50–80%.
|
|
88
|
+
- **Actionable errors** — failures explain what happened and link to the upstream status page instead of dumping a stack trace.
|
|
273
89
|
|
|
274
|
-
|
|
90
|
+
## Data sources
|
|
91
|
+
|
|
92
|
+
All free, all public, no authentication required:
|
|
93
|
+
|
|
94
|
+
| Source | Provides | Coverage |
|
|
95
|
+
|--------|----------|----------|
|
|
96
|
+
| [NOAA Weather API](https://www.weather.gov/documentation/services-web-api) | US forecasts, current conditions, alerts, fire weather | US |
|
|
97
|
+
| [Open-Meteo](https://open-meteo.com/) | Global forecasts, historical data (1940+), air quality, marine, geocoding, climate normals | Global |
|
|
98
|
+
| [USGS Water Services](https://waterservices.usgs.gov/) + [NOAA NWPS](https://water.noaa.gov/) | River levels, streamflow, flood stages | US |
|
|
99
|
+
| [NIFC WFIGS](https://data-nifc.opendata.arcgis.com/) | Active wildfire perimeters and incidents | US |
|
|
100
|
+
| [RainViewer](https://www.rainviewer.com/api.html) | Precipitation radar imagery | Global |
|
|
101
|
+
| [NASA GIBS](https://www.earthdata.nasa.gov/engage/open-data-services-software/earthdata-developer-portal/gibs-api) | GOES GeoColor satellite imagery | Western Hemisphere |
|
|
102
|
+
| [Blitzortung.org](https://www.blitzortung.org/) | Community lightning detection network | Global |
|
|
103
|
+
|
|
104
|
+
Open-Meteo allows 10,000 requests/day for non-commercial use; caching keeps typical AI usage far below that. Please respect the upstream providers' fair-use terms.
|
|
275
105
|
|
|
276
106
|
## Installation
|
|
277
107
|
|
|
278
|
-
|
|
108
|
+
**Recommended — npx (always latest, nothing to manage):**
|
|
279
109
|
|
|
280
|
-
**Via npm:**
|
|
281
110
|
```bash
|
|
282
|
-
|
|
111
|
+
# Claude Code
|
|
112
|
+
claude mcp add weather -- npx -y @dangahagan/weather-mcp@latest
|
|
283
113
|
```
|
|
284
114
|
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
npx -y @dangahagan/weather-mcp@latest
|
|
288
|
-
```
|
|
115
|
+
Or in any MCP client's configuration:
|
|
289
116
|
|
|
290
|
-
Then configure in your MCP client using:
|
|
291
117
|
```json
|
|
292
118
|
{
|
|
293
119
|
"mcpServers": {
|
|
@@ -299,1042 +125,154 @@ Then configure in your MCP client using:
|
|
|
299
125
|
}
|
|
300
126
|
```
|
|
301
127
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
If you prefer to build from source:
|
|
128
|
+
**Global install:**
|
|
305
129
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
- **No API keys or tokens required**
|
|
130
|
+
```bash
|
|
131
|
+
npm install -g @dangahagan/weather-mcp
|
|
132
|
+
```
|
|
310
133
|
|
|
311
|
-
**
|
|
134
|
+
**From source:**
|
|
312
135
|
|
|
313
|
-
1. Clone the repository:
|
|
314
136
|
```bash
|
|
315
137
|
git clone https://github.com/weather-mcp/weather-mcp.git
|
|
316
138
|
cd weather-mcp
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
2. Install dependencies:
|
|
320
|
-
```bash
|
|
321
139
|
npm install
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
3. Build the project:
|
|
325
|
-
```bash
|
|
326
140
|
npm run build
|
|
327
141
|
```
|
|
328
142
|
|
|
329
|
-
|
|
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.
|
|
143
|
+
Then point your MCP client at `node /absolute/path/to/weather-mcp/dist/index.js`.
|
|
336
144
|
|
|
337
|
-
|
|
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
|
-
```
|
|
145
|
+
Requires Node.js 18+. No API keys, tokens, or accounts needed.
|
|
378
146
|
|
|
379
|
-
|
|
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
|
|
147
|
+
### Works with
|
|
383
148
|
|
|
384
|
-
**
|
|
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
|
|
149
|
+
Claude Desktop, Claude Code, Cline, Cursor, Zed, VS Code (GitHub Copilot), LM Studio, Postman — any client that speaks MCP. Per-client setup instructions: **[docs/CLIENT_SETUP.md](./docs/CLIENT_SETUP.md)**.
|
|
389
150
|
|
|
390
|
-
|
|
151
|
+
### Upgrading
|
|
391
152
|
|
|
392
|
-
|
|
153
|
+
- **npx users:** nothing to do — `@latest` always fetches the newest version.
|
|
154
|
+
- **Global install:** `npm install -g @dangahagan/weather-mcp@latest`
|
|
155
|
+
- **From source:** `git pull && npm install && npm run build`
|
|
393
156
|
|
|
394
|
-
|
|
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
|
|
157
|
+
Restart your MCP client after upgrading. See [CHANGELOG.md](./CHANGELOG.md) for release notes.
|
|
402
158
|
|
|
403
|
-
|
|
159
|
+
## Configuration
|
|
404
160
|
|
|
405
|
-
|
|
161
|
+
**Most users need zero configuration.** Everything below is optional.
|
|
406
162
|
|
|
407
|
-
|
|
163
|
+
Settings can go in a `.env` file (see [`.env.example`](./.env.example)) or directly in your MCP client config:
|
|
408
164
|
|
|
409
|
-
**Recommended (npx, always latest):**
|
|
410
165
|
```json
|
|
411
166
|
{
|
|
412
167
|
"mcpServers": {
|
|
413
168
|
"weather": {
|
|
414
169
|
"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"]
|
|
170
|
+
"args": ["-y", "@dangahagan/weather-mcp@latest"],
|
|
171
|
+
"env": {
|
|
172
|
+
"ENABLED_TOOLS": "all",
|
|
173
|
+
"CACHE_MAX_SIZE": "2000",
|
|
174
|
+
"LOG_LEVEL": "1"
|
|
175
|
+
}
|
|
428
176
|
}
|
|
429
177
|
}
|
|
430
178
|
}
|
|
431
179
|
```
|
|
432
180
|
|
|
433
|
-
|
|
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` (required): Latitude coordinate (-90 to 90)
|
|
469
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
470
|
-
- `days` (optional): Number of days in forecast (1-16, default: 7)
|
|
471
|
-
- `granularity` (optional): "daily" or "hourly" (default: "daily")
|
|
472
|
-
- `include_precipitation_probability` (optional): Include rain chances (default: true)
|
|
473
|
-
- `include_normals` (optional): Include climate normals for comparison (default: false, NEW in v1.2.0)
|
|
474
|
-
- `source` (optional): "auto" (default), "noaa" (US only), or "openmeteo" (global)
|
|
475
|
-
|
|
476
|
-
**Description:**
|
|
477
|
-
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.
|
|
478
|
-
|
|
479
|
-
**Examples:**
|
|
480
|
-
```
|
|
481
|
-
"Get a 7-day forecast for Paris (48.8534, 2.3488)"
|
|
482
|
-
"Hourly forecast for Tokyo for the next 3 days"
|
|
483
|
-
"16-day extended forecast for Sydney, Australia"
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
**Returns:**
|
|
487
|
-
- Temperature (high/low, feels like)
|
|
488
|
-
- Sunrise and sunset times with daylight duration (NEW in v0.4.0)
|
|
489
|
-
- Precipitation chances and amounts
|
|
490
|
-
- Wind speed, direction, and gusts
|
|
491
|
-
- Weather conditions and descriptions
|
|
492
|
-
- UV index (for international locations)
|
|
493
|
-
- Humidity and atmospheric conditions
|
|
494
|
-
- Climate normals comparison (when `include_normals=true`, NEW in v1.2.0)
|
|
495
|
-
- Snow and ice accumulation forecasts (when available, NEW in v1.2.0)
|
|
496
|
-
- All timestamps in local timezone (NEW in v1.2.0)
|
|
497
|
-
|
|
498
|
-
### 2. get_current_conditions (ENHANCED in v1.2.0)
|
|
499
|
-
Get current weather conditions for a location (US only).
|
|
500
|
-
|
|
501
|
-
**Parameters:**
|
|
502
|
-
- `latitude` (required): Latitude coordinate (-90 to 90)
|
|
503
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
504
|
-
- `include_fire_weather` (optional): Include fire weather indices (default: false)
|
|
505
|
-
- `include_normals` (optional): Include climate normals for comparison (default: false, NEW in v1.2.0)
|
|
506
|
-
|
|
507
|
-
**Example:**
|
|
508
|
-
```
|
|
509
|
-
What are the current weather conditions in New York? (latitude: 40.7128, longitude: -74.0060)
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
**Returns:**
|
|
513
|
-
- Current temperature, humidity, wind, pressure
|
|
514
|
-
- Heat index or wind chill (when applicable)
|
|
515
|
-
- 24-hour temperature range
|
|
516
|
-
- Recent precipitation
|
|
517
|
-
- Cloud cover and visibility
|
|
518
|
-
- Snow depth on ground (when available, NEW in v1.2.0)
|
|
519
|
-
- Climate normals comparison (when `include_normals=true`, NEW in v1.2.0)
|
|
520
|
-
- Fire weather indices (when `include_fire_weather=true`)
|
|
521
|
-
- All timestamps in local timezone (NEW in v1.2.0)
|
|
522
|
-
|
|
523
|
-
### 3. search_location (NEW in v0.4.0)
|
|
524
|
-
Find coordinates for any location worldwide by name.
|
|
525
|
-
|
|
526
|
-
**Parameters:**
|
|
527
|
-
- `query` (required): Location name to search for (e.g., "Paris", "New York, NY", "Tokyo")
|
|
528
|
-
- `limit` (optional): Maximum number of results to return (1-100, default: 5)
|
|
529
|
-
|
|
530
|
-
**Description:**
|
|
531
|
-
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.
|
|
532
|
-
|
|
533
|
-
**Examples:**
|
|
534
|
-
```
|
|
535
|
-
"Find coordinates for Paris"
|
|
536
|
-
"Search for Tokyo, Japan"
|
|
537
|
-
"Where is San Francisco, CA?"
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
**Returns:**
|
|
541
|
-
- Location name and full administrative hierarchy
|
|
542
|
-
- Latitude and longitude coordinates
|
|
543
|
-
- Timezone and elevation
|
|
544
|
-
- Population (when available)
|
|
545
|
-
- Country and region information
|
|
546
|
-
- Feature type (capital, city, airport, etc.)
|
|
547
|
-
|
|
548
|
-
### 4. get_alerts
|
|
549
|
-
Get active weather alerts, watches, warnings, and advisories for US locations.
|
|
550
|
-
|
|
551
|
-
**Parameters:**
|
|
552
|
-
- `latitude` (required): Latitude coordinate (-90 to 90)
|
|
553
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
554
|
-
- `active_only` (optional): Show only active alerts (default: true)
|
|
555
|
-
|
|
556
|
-
**Description:**
|
|
557
|
-
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.
|
|
558
|
-
|
|
559
|
-
**Examples:**
|
|
560
|
-
```
|
|
561
|
-
"Are there any weather alerts for Miami, Florida?"
|
|
562
|
-
"Check for severe weather warnings in Oklahoma City"
|
|
563
|
-
"What weather watches are active in my area?" (latitude: 40.7128, longitude: -74.0060)
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
**Returns:**
|
|
567
|
-
- Alert type and severity (Extreme → Severe → Moderate → Minor)
|
|
568
|
-
- Urgency, certainty, and response type
|
|
569
|
-
- Event description and instructions
|
|
570
|
-
- Effective and expiration times
|
|
571
|
-
- Affected geographic areas
|
|
572
|
-
- Recommended actions and safety information
|
|
573
|
-
|
|
574
|
-
### 5. get_historical_weather
|
|
575
|
-
Get historical weather observations for a location.
|
|
576
|
-
|
|
577
|
-
**Parameters:**
|
|
578
|
-
- `latitude` (required): Latitude coordinate (-90 to 90)
|
|
579
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
580
|
-
- `start_date` (required): Start date in ISO format (YYYY-MM-DD)
|
|
581
|
-
- `end_date` (required): End date in ISO format (YYYY-MM-DD)
|
|
582
|
-
- `limit` (optional): Max observations to return (1-500, default: 168)
|
|
583
|
-
|
|
584
|
-
**Data Source Selection:**
|
|
585
|
-
The server automatically chooses the best data source based on your date range:
|
|
586
|
-
|
|
587
|
-
- **Last 7 days**: Uses NOAA real-time API
|
|
588
|
-
- ✓ Detailed hourly observations from weather stations
|
|
589
|
-
- ✓ Includes: temperature, conditions, wind speed, humidity, pressure
|
|
590
|
-
- ✓ High reliability and availability
|
|
591
|
-
- ⚠️ US locations only
|
|
592
|
-
|
|
593
|
-
- **Older than 7 days**: Uses Open-Meteo Historical Weather API
|
|
594
|
-
- ✓ No API token required
|
|
595
|
-
- ✓ Global coverage (worldwide)
|
|
596
|
-
- ✓ Historical data from 1940 to present
|
|
597
|
-
- ✓ Hourly data for ranges up to 31 days
|
|
598
|
-
- ✓ Daily summaries for longer periods
|
|
599
|
-
- ✓ Includes: temperature, precipitation, wind, humidity, pressure, cloud cover
|
|
600
|
-
- ✓ High resolution reanalysis data (9-25km grid)
|
|
601
|
-
- ⚠️ 5-day delay for most recent data
|
|
602
|
-
|
|
603
|
-
**Examples:**
|
|
604
|
-
|
|
605
|
-
Recent data (US locations, detailed observations):
|
|
606
|
-
```
|
|
607
|
-
"What was the weather like in Chicago 3 days ago?"
|
|
608
|
-
Coordinates: latitude: 41.8781, longitude: -87.6298
|
|
609
|
-
Date range: 3 days ago to 2 days ago
|
|
610
|
-
```
|
|
611
|
-
|
|
612
|
-
Historical data (global coverage):
|
|
613
|
-
```
|
|
614
|
-
"What was the weather in Paris on January 15, 2024?"
|
|
615
|
-
Coordinates: latitude: 48.8566, longitude: 2.3522
|
|
616
|
-
Date range: 2024-01-15 to 2024-01-15
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
Long-term historical analysis:
|
|
620
|
-
```
|
|
621
|
-
"Show me weather data for Tokyo from January 1, 2020 to December 31, 2020"
|
|
622
|
-
Coordinates: latitude: 35.6762, longitude: 139.6503
|
|
623
|
-
Date range: 2020-01-01 to 2020-12-31
|
|
624
|
-
```
|
|
625
|
-
|
|
626
|
-
**Troubleshooting:**
|
|
627
|
-
If you get "No historical data available":
|
|
628
|
-
- For recent dates (last 7 days): Ensure you're using US coordinates
|
|
629
|
-
- For older dates: Data should be available globally back to 1940
|
|
630
|
-
- Note: Most recent data has a 5-day delay
|
|
631
|
-
- Very recent dates (last 5 days) may not be available in archival data yet
|
|
632
|
-
|
|
633
|
-
### 6. get_air_quality (NEW in v0.5.0)
|
|
634
|
-
Get comprehensive air quality data for any location worldwide.
|
|
635
|
-
|
|
636
|
-
**Parameters:**
|
|
637
|
-
- `latitude` (required): Latitude coordinate (-90 to 90)
|
|
638
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
639
|
-
- `forecast` (optional): Include hourly forecast for next 5 days (default: false)
|
|
640
|
-
|
|
641
|
-
**Description:**
|
|
642
|
-
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.
|
|
643
|
-
|
|
644
|
-
**Examples:**
|
|
645
|
-
```
|
|
646
|
-
"What's the air quality in Los Angeles?"
|
|
647
|
-
"Check pollution levels in Beijing"
|
|
648
|
-
"Get air quality forecast for Paris for the next 5 days"
|
|
649
|
-
```
|
|
650
|
-
|
|
651
|
-
**Returns:**
|
|
652
|
-
- Air Quality Index (AQI) with appropriate scale (US or European)
|
|
653
|
-
- Health risk category and recommendations
|
|
654
|
-
- Pollutant concentrations (PM2.5, PM10, O₃, NO₂, SO₂, CO, NH₃)
|
|
655
|
-
- UV Index with sun protection guidance
|
|
656
|
-
- Activity recommendations for sensitive groups
|
|
657
|
-
- Optional 5-day hourly forecast
|
|
658
|
-
|
|
659
|
-
### 7. check_service_status
|
|
660
|
-
Check the operational status of weather APIs and cache performance.
|
|
661
|
-
|
|
662
|
-
**Parameters:** None
|
|
663
|
-
|
|
664
|
-
**Description:**
|
|
665
|
-
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.
|
|
666
|
-
|
|
667
|
-
**Example:**
|
|
668
|
-
```
|
|
669
|
-
Check if the weather services are operational
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
**Returns:**
|
|
673
|
-
- Operational status for NOAA API (forecasts & current conditions)
|
|
674
|
-
- Operational status for Open-Meteo API (historical data & forecasts)
|
|
675
|
-
- Cache statistics (hit rate, size, API call reduction)
|
|
676
|
-
- Status page links and recommended actions if issues are detected
|
|
677
|
-
- Overall service availability summary
|
|
678
|
-
|
|
679
|
-
### 8. get_marine_conditions (NEW in v0.6.0, Enhanced in v1.1.0)
|
|
680
|
-
Get marine weather conditions including wave height, swell, ocean currents, and sea state with automatic source selection for Great Lakes and coastal bays.
|
|
681
|
-
|
|
682
|
-
**Parameters:**
|
|
683
|
-
- `latitude` (required): Latitude coordinate (-90 to 90)
|
|
684
|
-
- `longitude` (required): Longitude coordinate (-180 to 180)
|
|
685
|
-
- `forecast` (optional): Include 5-day marine forecast (default: false)
|
|
686
|
-
|
|
687
|
-
**Description:**
|
|
688
|
-
Provides comprehensive marine weather data with intelligent dual-source support:
|
|
689
|
-
- **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.
|
|
690
|
-
- **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.
|
|
691
|
-
- **Automatic Selection**: Intelligent geographic detection automatically selects the best data source with zero configuration required.
|
|
692
|
-
|
|
693
|
-
**Important:** Data has limited accuracy in coastal areas and is NOT suitable for coastal navigation - always consult official marine forecasts.
|
|
694
|
-
|
|
695
|
-
**Examples:**
|
|
696
|
-
```
|
|
697
|
-
"What are the ocean conditions off the coast of California?"
|
|
698
|
-
"Get wave height and swell for surfing in Hawaii"
|
|
699
|
-
"Check marine conditions in the Atlantic Ocean" (latitude: 30.0, longitude: -60.0)
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
**Returns:**
|
|
703
|
-
- Significant wave height (meters/feet) with safety category
|
|
704
|
-
- Wind waves (locally generated) height and direction
|
|
705
|
-
- Swell height, period, and direction (from distant systems)
|
|
706
|
-
- Ocean current velocity and direction
|
|
707
|
-
- Sea state interpretation (Calm → Phenomenal based on Douglas Sea Scale)
|
|
708
|
-
- Safety assessment for maritime activities
|
|
709
|
-
- Wave period for planning and safety
|
|
710
|
-
- Optional 5-day forecast with daily summaries
|
|
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
|
-
```
|
|
181
|
+
### Tool Selection
|
|
952
182
|
|
|
953
|
-
|
|
954
|
-
- Confirmation of removal
|
|
955
|
-
- Count of remaining saved locations
|
|
183
|
+
Control which tools are exposed to reduce context overhead:
|
|
956
184
|
|
|
957
|
-
|
|
185
|
+
| Preset | Tools |
|
|
186
|
+
|--------|-------|
|
|
187
|
+
| `basic` (default) | forecast, current_conditions, alerts, search_location, check_service_status |
|
|
188
|
+
| `standard` | basic + historical_weather |
|
|
189
|
+
| `full` | standard + air_quality |
|
|
190
|
+
| `all` | everything — all 16 tools including marine, imagery, lightning, rivers, wildfire, and saved locations |
|
|
958
191
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
#
|
|
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
|
-
|
|
980
|
-
## Error Handling & Service Status
|
|
981
|
-
|
|
982
|
-
### Enhanced Error Messages
|
|
983
|
-
|
|
984
|
-
This MCP server provides detailed, actionable error messages when issues occur. All error messages include:
|
|
985
|
-
|
|
986
|
-
- **Clear problem description** - What went wrong and why
|
|
987
|
-
- **Contextual help** - Specific guidance based on the error type
|
|
988
|
-
- **Status page links** - Direct links to official service status pages
|
|
989
|
-
- **Recommended actions** - Concrete steps to resolve or investigate the issue
|
|
990
|
-
|
|
991
|
-
**Example Error Messages:**
|
|
992
|
-
|
|
993
|
-
When a service is down:
|
|
994
|
-
```
|
|
995
|
-
NOAA API server error: Service temporarily unavailable
|
|
996
|
-
|
|
997
|
-
The NOAA Weather API may be experiencing an outage.
|
|
998
|
-
|
|
999
|
-
Check service status:
|
|
1000
|
-
- Planned outages: https://weather-gov.github.io/api/planned-outages
|
|
1001
|
-
- Service notices: https://www.weather.gov/notification
|
|
1002
|
-
- Report issues: nco.ops@noaa.gov or (301) 683-1518
|
|
1003
|
-
```
|
|
1004
|
-
|
|
1005
|
-
When rate limited:
|
|
1006
|
-
```
|
|
1007
|
-
Open-Meteo API rate limit exceeded (10,000 requests/day for non-commercial use).
|
|
1008
|
-
|
|
1009
|
-
Please retry later or consider:
|
|
1010
|
-
- Reducing request frequency
|
|
1011
|
-
- Using daily instead of hourly data for longer periods
|
|
1012
|
-
- Upgrading to a commercial plan for higher limits
|
|
1013
|
-
|
|
1014
|
-
More info: https://open-meteo.com/en/pricing
|
|
1015
|
-
```
|
|
1016
|
-
|
|
1017
|
-
### Service Status Checking
|
|
1018
|
-
|
|
1019
|
-
Use the `check_service_status` tool to proactively verify API availability:
|
|
1020
|
-
|
|
1021
|
-
```
|
|
1022
|
-
# Query example
|
|
1023
|
-
"Check if the weather services are working"
|
|
1024
|
-
|
|
1025
|
-
# Returns:
|
|
1026
|
-
- ✅/❌ Status for NOAA API (US forecasts & current conditions)
|
|
1027
|
-
- ✅/❌ Status for Open-Meteo API (global historical data)
|
|
1028
|
-
- Links to official status pages
|
|
1029
|
-
- Recommended actions if issues detected
|
|
1030
|
-
- Overall service availability summary
|
|
192
|
+
```bash
|
|
193
|
+
ENABLED_TOOLS=all # Use a preset
|
|
194
|
+
ENABLED_TOOLS=forecast,current,alerts,aqi # Specific tools only
|
|
195
|
+
ENABLED_TOOLS=basic,+historical,+air_quality # Add to a preset
|
|
196
|
+
ENABLED_TOOLS=all,-marine # Remove from a preset
|
|
1031
197
|
```
|
|
1032
198
|
|
|
1033
|
-
|
|
1034
|
-
- Before making multiple weather requests
|
|
1035
|
-
- When experiencing errors or timeouts
|
|
1036
|
-
- To verify service availability after an outage
|
|
1037
|
-
- For monitoring and alerting purposes
|
|
199
|
+
Short aliases are supported: `forecast`, `current`, `alerts`, `historical`, `status`, `search`, `aqi`, `marine`, `radar`, `lightning`, and more.
|
|
1038
200
|
|
|
1039
|
-
|
|
1040
|
-
- **NOAA API:**
|
|
1041
|
-
- Planned outages: https://weather-gov.github.io/api/planned-outages
|
|
1042
|
-
- Service notices: https://www.weather.gov/notification
|
|
1043
|
-
- Report issues: https://weather-gov.github.io/api/reporting-issues
|
|
201
|
+
### Other settings
|
|
1044
202
|
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
203
|
+
| Variable | Default | Purpose |
|
|
204
|
+
|----------|---------|---------|
|
|
205
|
+
| `ENABLED_TOOLS` | `basic` | Tool preset or list (see above) |
|
|
206
|
+
| `CACHE_ENABLED` | `true` | Enable/disable response caching |
|
|
207
|
+
| `CACHE_MAX_SIZE` | `1000` | Max cache entries (100–10000) |
|
|
208
|
+
| `API_TIMEOUT_MS` | `30000` | Upstream API timeout (5000–120000) |
|
|
209
|
+
| `LOG_LEVEL` | `1` | 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR (logs go to stderr) |
|
|
210
|
+
| `NCEI_API_TOKEN` | — | Optional [free NCEI token](https://www.ncdc.noaa.gov/cdo-web/token) for official NOAA climate normals (US); falls back to Open-Meteo automatically |
|
|
1049
211
|
|
|
1050
|
-
|
|
212
|
+
For caching architecture details, see [.github/CACHING.md](./.github/CACHING.md).
|
|
1051
213
|
|
|
1052
|
-
|
|
214
|
+
## Coverage & Limitations
|
|
1053
215
|
|
|
1054
|
-
|
|
216
|
+
Being honest about what free public data can and can't do:
|
|
1055
217
|
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
218
|
+
| Capability | Global | US-only |
|
|
219
|
+
|-----------|--------|---------|
|
|
220
|
+
| Forecasts (up to 16 days) | ✅ | Richer detail via NOAA |
|
|
221
|
+
| Historical weather (1940+) | ✅ (>7 days old) | Station-level detail for last 7 days |
|
|
222
|
+
| Air quality, marine, radar, lightning | ✅ | — |
|
|
223
|
+
| Current conditions | ❌ | ✅ |
|
|
224
|
+
| Weather alerts | ❌ | ✅ |
|
|
225
|
+
| River conditions, wildfires | ❌ | ✅ |
|
|
1059
226
|
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
npm run test:watch
|
|
1065
|
-
|
|
1066
|
-
# Run tests with interactive UI
|
|
1067
|
-
npm run test:ui
|
|
1068
|
-
```
|
|
227
|
+
- Historical data older than 7 days comes from reanalysis models (9–25km grid), not direct station observations, and trails real time by ~5 days.
|
|
228
|
+
- Marine data has limited coastal accuracy and is **not suitable for navigation**.
|
|
229
|
+
- Lightning coverage varies by region (community-operated detector network).
|
|
230
|
+
- Open-Meteo's fair-use limit is 10,000 requests/day; the built-in cache makes this hard to hit in normal use.
|
|
1069
231
|
|
|
1070
|
-
|
|
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
|
|
1075
|
-
|
|
1076
|
-
**Test Categories:**
|
|
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
|
|
1079
|
-
|
|
1080
|
-
### Quick API Connectivity Test
|
|
232
|
+
## Development
|
|
1081
233
|
|
|
1082
|
-
Verify NOAA API connectivity with a quick integration test:
|
|
1083
234
|
```bash
|
|
1084
|
-
|
|
235
|
+
npm run build # Compile TypeScript
|
|
236
|
+
npm run dev # Run in development mode
|
|
237
|
+
npm test # Run all 1,084 tests (~2 seconds)
|
|
238
|
+
npm run test:coverage # Coverage report
|
|
239
|
+
npm run audit # Dependency vulnerability scan
|
|
1085
240
|
```
|
|
1086
241
|
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
See [TESTING_GUIDE.md](./docs/testing/TESTING_GUIDE.md) for comprehensive manual testing instructions including:
|
|
1090
|
-
- Setup steps for MCP clients
|
|
1091
|
-
- Test cases for all tools
|
|
1092
|
-
- Error handling verification
|
|
1093
|
-
- Performance testing
|
|
1094
|
-
- Debugging tips
|
|
1095
|
-
|
|
1096
|
-
## Development
|
|
1097
|
-
|
|
1098
|
-
### Available Scripts
|
|
1099
|
-
|
|
1100
|
-
**Build & Run:**
|
|
1101
|
-
- `npm run build` - Compile TypeScript to JavaScript
|
|
1102
|
-
- `npm run dev` - Run the server in development mode with tsx
|
|
1103
|
-
- `npm start` - Run the compiled server
|
|
242
|
+
**Quality bar:** TypeScript strict mode, no `any` types, 100% test coverage on critical utilities (cache, validation, unit conversion, errors), 100% pass rate, minimal runtime dependencies.
|
|
1104
243
|
|
|
1105
|
-
|
|
1106
|
-
-
|
|
1107
|
-
-
|
|
1108
|
-
-
|
|
1109
|
-
- `npm run test:ui` - Run tests with interactive UI
|
|
1110
|
-
- `npx tsx tests/test_noaa_api.ts` - Quick API connectivity test
|
|
1111
|
-
|
|
1112
|
-
**Security & Maintenance:**
|
|
1113
|
-
- `npm run audit` - Check for dependency vulnerabilities
|
|
1114
|
-
- `npm run audit:fix` - Automatically fix dependency vulnerabilities
|
|
1115
|
-
|
|
1116
|
-
### Project Structure
|
|
1117
|
-
|
|
1118
|
-
```
|
|
1119
|
-
weather-mcp/
|
|
1120
|
-
├── src/
|
|
1121
|
-
│ ├── index.ts # Main MCP server
|
|
1122
|
-
│ ├── config/
|
|
1123
|
-
│ │ ├── api.ts # API configuration (NCEI token) - NEW in v1.2.0
|
|
1124
|
-
│ │ ├── cache.ts # Cache configuration and TTL strategies
|
|
1125
|
-
│ │ └── displayThresholds.ts # Display thresholds for weather conditions
|
|
1126
|
-
│ ├── errors/
|
|
1127
|
-
│ │ └── ApiError.ts # Custom error class hierarchy
|
|
1128
|
-
│ ├── handlers/
|
|
1129
|
-
│ │ ├── alertsHandler.ts # Weather alerts tool handler
|
|
1130
|
-
│ │ ├── currentConditionsHandler.ts # Current conditions handler
|
|
1131
|
-
│ │ ├── forecastHandler.ts # Forecast tool handler
|
|
1132
|
-
│ │ ├── historicalWeatherHandler.ts # Historical weather handler
|
|
1133
|
-
│ │ ├── airQualityHandler.ts # Air quality handler
|
|
1134
|
-
│ │ ├── marineConditionsHandler.ts # Marine conditions handler
|
|
1135
|
-
│ │ ├── locationHandler.ts # Location search handler
|
|
1136
|
-
│ │ └── statusHandler.ts # Service status handler
|
|
1137
|
-
│ ├── services/
|
|
1138
|
-
│ │ ├── noaa.ts # NOAA API service
|
|
1139
|
-
│ │ ├── openmeteo.ts # Open-Meteo API service
|
|
1140
|
-
│ │ └── ncei.ts # NCEI climate normals service - NEW in v1.2.0
|
|
1141
|
-
│ ├── types/
|
|
1142
|
-
│ │ ├── noaa.ts # NOAA TypeScript type definitions
|
|
1143
|
-
│ │ └── openmeteo.ts # Open-Meteo TypeScript type definitions
|
|
1144
|
-
│ └── utils/
|
|
1145
|
-
│ ├── cache.ts # LRU cache implementation
|
|
1146
|
-
│ ├── logger.ts # Structured logging utilities
|
|
1147
|
-
│ ├── temperatureConversion.ts # Temperature conversion helpers
|
|
1148
|
-
│ ├── units.ts # Unit conversion utilities
|
|
1149
|
-
│ ├── validation.ts # Input validation functions
|
|
1150
|
-
│ ├── normals.ts # Climate normals utilities - NEW in v1.2.0
|
|
1151
|
-
│ ├── snow.ts # Snow and ice data utilities - NEW in v1.2.0
|
|
1152
|
-
│ └── timezone.ts # Timezone-aware formatting - NEW in v1.2.0
|
|
1153
|
-
├── tests/
|
|
1154
|
-
│ ├── unit/ # Unit tests (427 tests) - 93 new tests in v1.2.0
|
|
1155
|
-
│ └── integration/ # Integration tests (19 tests)
|
|
1156
|
-
├── dist/ # Compiled JavaScript (generated)
|
|
1157
|
-
├── docs/ # Documentation
|
|
1158
|
-
└── package.json
|
|
1159
|
-
```
|
|
1160
|
-
|
|
1161
|
-
## API Information
|
|
1162
|
-
|
|
1163
|
-
This server uses three weather APIs:
|
|
1164
|
-
|
|
1165
|
-
### NOAA Weather API (Real-time, US)
|
|
1166
|
-
- **Base URL**: https://api.weather.gov
|
|
1167
|
-
- **Authentication**: None required (User-Agent header only)
|
|
1168
|
-
- **Rate Limits**: Enforced with 5-second retry window
|
|
1169
|
-
- **Coverage**: United States locations only
|
|
1170
|
-
- **Use cases**: US forecasts (detailed), current conditions, recent observations (last 7 days)
|
|
1171
|
-
- **Data**: Detailed hourly observations from weather stations
|
|
1172
|
-
|
|
1173
|
-
### Open-Meteo Forecast API (Global) - NEW in v0.4.0
|
|
1174
|
-
- **Base URL**: https://api.open-meteo.com/v1
|
|
1175
|
-
- **Authentication**: None required (no API token needed)
|
|
1176
|
-
- **Rate Limits**: 10,000 requests/day for non-commercial use
|
|
1177
|
-
- **Coverage**: Global (worldwide locations)
|
|
1178
|
-
- **Use cases**: International forecasts, extended forecasts (up to 16 days)
|
|
1179
|
-
- **Data**: Temperature, precipitation, wind, humidity, UV index, sunrise/sunset
|
|
1180
|
-
- **Resolution**: 11km global grid resolution
|
|
1181
|
-
|
|
1182
|
-
### Open-Meteo Geocoding API (Global) - NEW in v0.4.0
|
|
1183
|
-
- **Base URL**: https://geocoding-api.open-meteo.com/v1
|
|
1184
|
-
- **Authentication**: None required (no API token needed)
|
|
1185
|
-
- **Coverage**: Global (worldwide locations)
|
|
1186
|
-
- **Use cases**: Location name to coordinates conversion
|
|
1187
|
-
- **Data**: Coordinates, timezone, elevation, population, administrative regions
|
|
1188
|
-
- **Cache**: 30-day TTL (locations don't move)
|
|
1189
|
-
|
|
1190
|
-
### Open-Meteo Historical Weather API (Global, Archival)
|
|
1191
|
-
- **Base URL**: https://archive-api.open-meteo.com/v1
|
|
1192
|
-
- **Authentication**: None required (no API token needed)
|
|
1193
|
-
- **Rate Limits**: 10,000 requests/day for non-commercial use
|
|
1194
|
-
- **Coverage**: Global (worldwide locations)
|
|
1195
|
-
- **Use cases**: Historical weather data from 1940 to present
|
|
1196
|
-
- **Data**: Hourly or daily temperature, precipitation, wind, humidity, pressure, cloud cover
|
|
1197
|
-
- **Resolution**: 9-25km grid resolution from reanalysis models
|
|
1198
|
-
- **Delay**: 5-day delay for most recent data
|
|
1199
|
-
|
|
1200
|
-
For more details on NOAA APIs, see [NOAA_API_RESEARCH.md](./docs/NOAA_API_RESEARCH.md).
|
|
1201
|
-
|
|
1202
|
-
## Limitations
|
|
1203
|
-
|
|
1204
|
-
### Geographic Coverage
|
|
1205
|
-
|
|
1206
|
-
**Forecasts:** (UPDATED in v0.4.0)
|
|
1207
|
-
- **Global coverage** via automatic source selection
|
|
1208
|
-
- US locations: Uses NOAA API (more detailed, includes narratives)
|
|
1209
|
-
- International locations: Uses Open-Meteo API (reliable global forecasts)
|
|
1210
|
-
- Extended forecasts (>7 days, up to 16 days): Open-Meteo only
|
|
1211
|
-
|
|
1212
|
-
**Current Conditions:**
|
|
1213
|
-
- **US locations only** (NOAA API)
|
|
1214
|
-
- International real-time conditions not yet supported
|
|
1215
|
-
|
|
1216
|
-
**Historical Data:**
|
|
1217
|
-
- Recent data (last 7 days): **US locations only** (NOAA API)
|
|
1218
|
-
- Archival data (>7 days old): **Global coverage** (Open-Meteo API)
|
|
1219
|
-
|
|
1220
|
-
### Historical Data (get_historical_weather)
|
|
1221
|
-
|
|
1222
|
-
**Recent Data (Last 7 Days)** - US Only, High Detail:
|
|
1223
|
-
- ✓ Detailed hourly observations from weather stations
|
|
1224
|
-
- ✓ No API token required
|
|
1225
|
-
- ⚠️ US locations only
|
|
1226
|
-
- ⚠️ May have occasional gaps depending on weather station
|
|
1227
|
-
- ⚠️ Observations may be delayed up to 20 minutes
|
|
1228
|
-
|
|
1229
|
-
**Archival Data (Older than 7 Days)** - Global, Reanalysis-Based:
|
|
1230
|
-
- ✓ Global coverage (any location worldwide)
|
|
1231
|
-
- ✓ No API token required
|
|
1232
|
-
- ✓ Reliable data from 1940 to present
|
|
1233
|
-
- ✓ Hourly data for date ranges up to 31 days
|
|
1234
|
-
- ✓ Daily summaries for longer periods
|
|
1235
|
-
- ⚠️ Most recent data has a 5-day delay
|
|
1236
|
-
- ⚠️ Reanalysis-based (grid model, not direct station observations)
|
|
1237
|
-
|
|
1238
|
-
### Rate Limits
|
|
1239
|
-
- **NOAA Weather API**: Automatic retry with exponential backoff on rate limit errors
|
|
1240
|
-
- **Open-Meteo API**: 10,000 requests/day for non-commercial use
|
|
1241
|
-
|
|
1242
|
-
### Recommendations
|
|
1243
|
-
- **For recent US weather**: Use dates within the last 7 days for detailed station observations
|
|
1244
|
-
- **For historical analysis**: Open-Meteo provides reliable global coverage back to 1940
|
|
1245
|
-
- **For international locations**: Only historical data (>7 days old) is supported
|
|
244
|
+
Project structure, patterns, and contribution guidance:
|
|
245
|
+
- [CONTRIBUTING.md](./CONTRIBUTING.md) — how to contribute
|
|
246
|
+
- [CLAUDE.md](./CLAUDE.md) — architecture and development guide
|
|
247
|
+
- [docs/README.md](./docs/README.md) — complete documentation index
|
|
1246
248
|
|
|
1247
249
|
## Security
|
|
1248
250
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
251
|
+
- All inputs validated (coordinates, dates, ranges) before any API call
|
|
252
|
+
- Error messages sanitized — no internal details leak to output
|
|
253
|
+
- Zero secrets by design: no keys means nothing to steal or misconfigure
|
|
254
|
+
- Automated dependency scanning (npm audit + Dependabot), minimal dependency footprint
|
|
255
|
+
- Independent security audit: see [docs/development/SECURITY_AUDIT.md](./docs/development/SECURITY_AUDIT.md)
|
|
1252
256
|
|
|
1253
|
-
|
|
1254
|
-
- Comprehensive runtime validation for all user inputs
|
|
1255
|
-
- NaN and Infinity checks for numeric coordinates
|
|
1256
|
-
- Range validation for latitude (-90 to 90) and longitude (-180 to 180)
|
|
1257
|
-
- Type checking with TypeScript strict mode
|
|
1258
|
-
|
|
1259
|
-
**Error Handling:**
|
|
1260
|
-
- Custom error class hierarchy with typed errors
|
|
1261
|
-
- Error message sanitization to prevent information leakage
|
|
1262
|
-
- Retryable errors clearly identified for graceful recovery
|
|
1263
|
-
- Network errors sanitized before display
|
|
1264
|
-
|
|
1265
|
-
**Dependency Security:**
|
|
1266
|
-
- Automated dependency scanning via `npm audit`
|
|
1267
|
-
- GitHub Dependabot configured for weekly security updates
|
|
1268
|
-
- Minimal dependency footprint (3 runtime dependencies)
|
|
1269
|
-
- Zero known vulnerabilities in current dependencies
|
|
1270
|
-
|
|
1271
|
-
**Reliability:**
|
|
1272
|
-
- Exponential backoff with jitter prevents thundering herd problems
|
|
1273
|
-
- Comprehensive test suite (247 tests) with 100% coverage on critical utilities
|
|
1274
|
-
- Memory-safe cache with automatic cleanup
|
|
1275
|
-
- Graceful shutdown handling
|
|
1276
|
-
|
|
1277
|
-
### Security Audit
|
|
1278
|
-
|
|
1279
|
-
The project has undergone a comprehensive security audit:
|
|
1280
|
-
- **Overall Security Posture:** B+ (Good)
|
|
1281
|
-
- **Risk Level:** LOW
|
|
1282
|
-
- **Vulnerabilities:** Zero critical or high-severity issues
|
|
1283
|
-
- See [SECURITY_AUDIT.md](./docs/development/SECURITY_AUDIT.md) for full audit report
|
|
1284
|
-
|
|
1285
|
-
### Reporting Security Issues
|
|
1286
|
-
|
|
1287
|
-
To report a security vulnerability, please see our [Security Policy](./SECURITY.md) which includes:
|
|
1288
|
-
- Vulnerability reporting procedures
|
|
1289
|
-
- Response timeline commitments (48hr acknowledgment, 7-day assessment)
|
|
1290
|
-
- Security best practices for users and developers
|
|
257
|
+
To report a vulnerability, see [SECURITY.md](./SECURITY.md).
|
|
1291
258
|
|
|
1292
259
|
## Documentation
|
|
1293
260
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
261
|
+
- **[Tool Reference](./docs/TOOLS.md)** — all 16 tools: parameters, examples, sample output
|
|
262
|
+
- **[Client Setup](./docs/CLIENT_SETUP.md)** — step-by-step for 8 MCP clients
|
|
263
|
+
- **[Error Handling](./docs/ERROR_HANDLING.md)** — how failures are reported
|
|
264
|
+
- **[Testing Guide](./docs/testing/TESTING_GUIDE.md)** — manual testing procedures
|
|
265
|
+
- **[Changelog](./CHANGELOG.md)** — version history
|
|
266
|
+
- **[Full documentation index](./docs/README.md)**
|
|
1297
267
|
|
|
1298
|
-
|
|
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
|
|
268
|
+
## Contributing
|
|
1323
269
|
|
|
1324
|
-
|
|
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
|
|
270
|
+
Contributions are welcome — this is a single-maintainer project and issues, PRs, and feedback genuinely help. See [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
1328
271
|
|
|
1329
272
|
## License
|
|
1330
273
|
|
|
1331
|
-
MIT
|
|
1332
|
-
|
|
1333
|
-
## Contributing
|
|
274
|
+
[MIT](./LICENSE) — free to use, modify, and distribute.
|
|
1334
275
|
|
|
1335
|
-
|
|
276
|
+
---
|
|
1336
277
|
|
|
1337
|
-
|
|
1338
|
-
- [CODE_REVIEW.md](./docs/development/CODE_REVIEW.md) - Comprehensive code quality analysis
|
|
1339
|
-
- [CONTRIBUTING.md](./CONTRIBUTING.md) - Contribution guidelines
|
|
1340
|
-
- [SECURITY.md](./SECURITY.md) - Security policy and vulnerability reporting
|
|
278
|
+
*Weather data provided by NOAA, Open-Meteo, USGS, NIFC, RainViewer, and Blitzortung.org. This project is not affiliated with or endorsed by any of these providers. Do not rely on this server as your sole source for safety-critical decisions — always consult official warnings and forecasts.*
|