@pipeworx/mcp-open-meteo 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,18 +2,18 @@
2
2
 
3
3
  Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs
4
4
 
5
- Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 250+ live data sources.
5
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1339+ live data sources.
6
6
 
7
7
  ## Tools
8
8
 
9
9
  | Tool | Description |
10
10
  |------|-------------|
11
- | `forecast` | Weather forecast up to 16 days, hourly or daily. |
12
- | `historical` | ERA5 reanalysis 1940-present. Date range required. |
13
- | `geocode` | Resolve a place name to coordinates. |
14
- | `air_quality` | PM2.5, PM10, O3, NO2, SO2, CO, dust, pollen. |
15
- | `marine` | Wave height + period + direction (forecast). |
16
- | `flood` | Daily river discharge forecast (GloFAS model). |
11
+ | `forecast` | "What\'s the weather in [city]" / "weather forecast for [location]" / "will it rain tomorrow", "rain chance / probability this week" / "temperature in [place] this week" / "wind / precipitation / humidity forecast" — global weather forecast up to 16 days ahead, hourly or daily, at any lat/lng. Returns temperature, precipitation, wind, humidity, cloud cover, weather codes by default; pass hourly/daily arg for custom variables. Free, keyless, no signup (Open-Meteo / ECMWF + national weather services). Pair with geocode to convert "Paris" → lat/lng first. |
12
+ | `historical` | "What was the weather on [date]" / "historical weather for [location]" / "temperature in [city] last summer" / "rainfall during [period]" / "past weather data" — ERA5 reanalysis covering 1940-present at any global lat/lng. Returns hourly or daily temperature, precipitation, wind, humidity etc. for any date range. Use for climate analysis, retrospective event weather, or training data. |
13
+ | `geocode` | "What are the coordinates of [city]" / "lat lng for [place]" / "find [town] location" — resolve a place name (city, village, region) to lat/lng so the other Open-Meteo tools can use them. Free, keyless, multilingual; returns up to 100 matches ranked by population. Use before forecast / historical / air_quality / marine / flood when you only have a place name. |
14
+ | `air_quality` | "Air quality / AQI in [city]" / "is the air safe to breathe in [location]" / "pollution levels for [place]" / "smoke / smog / wildfire-smoke forecast" / "pollen forecast" — global air quality and pollen forecast at any lat/lng. Returns PM2.5, PM10, ozone (O3), NO2, SO2, CO, dust, and pollen (alder/birch/grass/mugwort/olive/ragweed) up to 5 days ahead, plus European AQI / US AQI. Free, keyless. |
15
+ | `marine` | "Wave / swell / surf forecast for [beach]" / "sea conditions in [bay]" / "wave height at [coordinates]" / "is it safe to sail" — global marine weather forecast (wave height, wave period, wave direction, wind waves, swell waves) at any ocean lat/lng. Free, keyless. Use for surf reports, sailing prep, fishing conditions, coastal planning. |
16
+ | `flood` | "Flood risk for [river]" / "river discharge forecast" / "will [river] flood" / "water levels at [location]" — daily river discharge forecast from the GloFAS global flood model. Returns predicted m³/s discharge up to 30 days ahead for any river-bearing lat/lng worldwide. Use for flood risk assessment, agriculture planning, hydrology research. |
17
17
 
18
18
  ## Quick Start
19
19
 
@@ -29,7 +29,7 @@ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
29
29
  }
30
30
  ```
31
31
 
32
- Or connect to the full Pipeworx gateway for access to all 250+ data sources:
32
+ Or connect to the full Pipeworx gateway for access to all 1339+ data sources:
33
33
 
34
34
  ```json
35
35
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipeworx/mcp-open-meteo",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.pipeworx-io/open-meteo",
4
4
  "title": "Open Meteo",
5
5
  "description": "Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs",
6
- "version": "0.1.0",
6
+ "version": "0.1.1",
7
7
  "websiteUrl": "https://pipeworx.io/packs/open-meteo",
8
8
  "repository": {
9
9
  "url": "https://github.com/pipeworx-io/mcp-open-meteo",
package/src/index.ts CHANGED
@@ -31,13 +31,16 @@ const AIR = 'https://air-quality-api.open-meteo.com/v1/air-quality';
31
31
  const MARINE = 'https://marine-api.open-meteo.com/v1/marine';
32
32
  const FLOOD = 'https://flood-api.open-meteo.com/v1/flood';
33
33
 
34
- const DEFAULT_HOURLY = 'temperature_2m,relative_humidity_2m,precipitation,wind_speed_10m,cloud_cover,weather_code';
35
- const DEFAULT_DAILY = 'temperature_2m_max,temperature_2m_min,precipitation_sum,wind_speed_10m_max,weather_code';
34
+ const DEFAULT_HOURLY = 'temperature_2m,relative_humidity_2m,precipitation,precipitation_probability,wind_speed_10m,cloud_cover,weather_code';
35
+ // precipitation_probability_max (rain CHANCE %) is included alongside
36
+ // precipitation_sum (rain AMOUNT mm) so "will it rain" / "which day has the
37
+ // lowest rain probability" (e.g. crop-spraying planning) is answerable by default.
38
+ const DEFAULT_DAILY = 'temperature_2m_max,temperature_2m_min,precipitation_sum,precipitation_probability_max,wind_speed_10m_max,weather_code';
36
39
 
37
40
  const tools: McpToolExport['tools'] = [
38
41
  {
39
42
  name: 'forecast',
40
- description: 'Weather forecast up to 16 days, hourly or daily.',
43
+ description: '"What\'s the weather in [city]" / "weather forecast for [location]" / "will it rain tomorrow", "rain chance / probability this week" / "temperature in [place] this week" / "wind / precipitation / humidity forecast" — global weather forecast up to 16 days ahead, hourly or daily, at any lat/lng. Returns temperature, precipitation, wind, humidity, cloud cover, weather codes by default; pass hourly/daily arg for custom variables. Free, keyless, no signup (Open-Meteo / ECMWF + national weather services). Pair with geocode to convert "Paris" → lat/lng first.',
41
44
  inputSchema: {
42
45
  type: 'object',
43
46
  properties: {
@@ -56,7 +59,7 @@ const tools: McpToolExport['tools'] = [
56
59
  },
57
60
  {
58
61
  name: 'historical',
59
- description: 'ERA5 reanalysis 1940-present. Date range required.',
62
+ description: '"What was the weather on [date]" / "historical weather for [location]" / "temperature in [city] last summer" / "rainfall during [period]" / "past weather data" — ERA5 reanalysis covering 1940-present at any global lat/lng. Returns hourly or daily temperature, precipitation, wind, humidity etc. for any date range. Use for climate analysis, retrospective event weather, or training data.',
60
63
  inputSchema: {
61
64
  type: 'object',
62
65
  properties: {
@@ -73,7 +76,7 @@ const tools: McpToolExport['tools'] = [
73
76
  },
74
77
  {
75
78
  name: 'geocode',
76
- description: 'Resolve a place name to coordinates.',
79
+ description: '"What are the coordinates of [city]" / "lat lng for [place]" / "find [town] location" — resolve a place name (city, village, region) to lat/lng so the other Open-Meteo tools can use them. Free, keyless, multilingual; returns up to 100 matches ranked by population. Use before forecast / historical / air_quality / marine / flood when you only have a place name.',
77
80
  inputSchema: {
78
81
  type: 'object',
79
82
  properties: {
@@ -86,7 +89,7 @@ const tools: McpToolExport['tools'] = [
86
89
  },
87
90
  {
88
91
  name: 'air_quality',
89
- description: 'PM2.5, PM10, O3, NO2, SO2, CO, dust, pollen.',
92
+ description: '"Air quality / AQI in [city]" / "is the air safe to breathe in [location]" / "pollution levels for [place]" / "smoke / smog / wildfire-smoke forecast" / "pollen forecast" — global air quality and pollen forecast at any lat/lng. Returns PM2.5, PM10, ozone (O3), NO2, SO2, CO, dust, and pollen (alder/birch/grass/mugwort/olive/ragweed) up to 5 days ahead, plus European AQI / US AQI. Free, keyless.',
90
93
  inputSchema: {
91
94
  type: 'object',
92
95
  properties: {
@@ -100,7 +103,7 @@ const tools: McpToolExport['tools'] = [
100
103
  },
101
104
  {
102
105
  name: 'marine',
103
- description: 'Wave height + period + direction (forecast).',
106
+ description: '"Wave / swell / surf forecast for [beach]" / "sea conditions in [bay]" / "wave height at [coordinates]" / "is it safe to sail" — global marine weather forecast (wave height, wave period, wave direction, wind waves, swell waves) at any ocean lat/lng. Free, keyless. Use for surf reports, sailing prep, fishing conditions, coastal planning.',
104
107
  inputSchema: {
105
108
  type: 'object',
106
109
  properties: {
@@ -114,7 +117,7 @@ const tools: McpToolExport['tools'] = [
114
117
  },
115
118
  {
116
119
  name: 'flood',
117
- description: 'Daily river discharge forecast (GloFAS model).',
120
+ description: '"Flood risk for [river]" / "river discharge forecast" / "will [river] flood" / "water levels at [location]" — daily river discharge forecast from the GloFAS global flood model. Returns predicted m³/s discharge up to 30 days ahead for any river-bearing lat/lng worldwide. Use for flood risk assessment, agriculture planning, hydrology research.',
118
121
  inputSchema: {
119
122
  type: 'object',
120
123
  properties: {
@@ -170,13 +173,23 @@ async function historical(args: Record<string, unknown>) {
170
173
  }
171
174
 
172
175
  async function geocode(args: Record<string, unknown>) {
173
- const params = new URLSearchParams({
174
- name: reqStr(args, 'name', '"Tokyo"'),
175
- count: String(Math.min(100, Math.max(1, (args.count as number) ?? 10))),
176
- language: String(args.language ?? 'en'),
177
- format: 'json',
178
- });
179
- return meteoGet(GEO, params);
176
+ const name = reqStr(args, 'name', '"Tokyo"');
177
+ const count = String(Math.min(100, Math.max(1, (args.count as number) ?? 10)));
178
+ const language = String(args.language ?? 'en');
179
+ const search = (n: string) =>
180
+ meteoGet(GEO, new URLSearchParams({ name: n, count, language, format: 'json' })) as Promise<{ results?: unknown[] }>;
181
+
182
+ let result = await search(name);
183
+ // Open-Meteo's geocoder matches on the bare place name and returns 0 results for
184
+ // "City, ST" / "City, State" — but the router routinely produces exactly that.
185
+ // Retry with the city part so "Fresno, CA" resolves like "Fresno".
186
+ if ((!result.results || result.results.length === 0) && name.includes(',')) {
187
+ const city = name.split(',')[0].trim();
188
+ if (city && city.toLowerCase() !== name.toLowerCase()) {
189
+ result = await search(city);
190
+ }
191
+ }
192
+ return result;
180
193
  }
181
194
 
182
195
  async function airQuality(args: Record<string, unknown>) {