npm package: @fazorboy/weather-mcp-server
Description: MCP server for Open-Meteo weather API — forecasts, historical data, air quality, marine, geocoding, elevation, climate projections
Latest version: 0.1.0

# 🌦️ Weather MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](../../LICENSE)
[![npm version](https://img.shields.io/npm/v/@fazorboy/weather-mcp-server.svg)](https://www.npmjs.com/package/@fazorboy/weather-mcp-server)
[![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-green.svg)](https://nodejs.org/)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue.svg)](https://www.typescriptlang.org/)

A **Model Context Protocol (MCP)** server that provides AI assistants with comprehensive access to the [Open-Meteo](https://open-meteo.com/) weather API — forecasts, historical data, air quality, marine conditions, geocoding, elevation, and climate projections.

> **No API key required** for non-commercial use. Combines data from 15+ national weather services (DWD, NOAA, ECMWF, Météo-France, UK Met Office, and more).

---

## ✨ Features

| Tool | Description |
|------|-------------|
| `weather_get_forecast` | Hourly/daily forecasts up to 16 days for any location |
| `weather_get_current` | Real-time temperature, precipitation, wind, cloud cover |
| `weather_get_historical` | 80+ years of weather archive (1940–present) |
| `weather_get_air_quality` | PM2.5, PM10, ozone, NO₂, SO₂, dust, pollen forecasts |
| `weather_get_marine` | Wave height, period, direction for ocean locations |
| `weather_geocode_search` | Search locations by name, get coordinates and metadata |
| `weather_geocode_reverse` | Reverse geocode coordinates to location names |
| `weather_get_elevation` | Get elevation for any coordinate (90m DEM) |
| `weather_get_climate_projection` | Climate change projections using CMIP6 models |
| `weather_compare_locations` | Compare weather across 2–5 locations side by side |

---

## 📦 Installation

### npm (global)

```bash
npm install -g @fazorboy/weather-mcp-server
```

### npm (local)

```bash
npm install @fazorboy/weather-mcp-server
```

### From source

```bash
git clone https://github.com/bhayanak/weather-mcp-server.git
cd weather-mcp-server/packages/weather-mcp-server
pnpm install
pnpm run build
```

---

## 🚀 Usage

### As a standalone MCP server (stdio)

```bash
npx @fazorboy/weather-mcp-server
```

### With Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "@fazorboy/weather-mcp-server"]
    }
  }
}
```

### With VS Code (GitHub Copilot)

Install the [Weather MCP Server extension](../weather-mcp-vscode-extension/README.md) — it bundles this server and registers it automatically.

Or add to your VS Code `settings.json`:

```json
{
  "mcp": {
    "servers": {
      "weather": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@fazorboy/weather-mcp-server"]
      }
    }
  }
}
```

---

## ⚙️ Configuration

All settings are optional and configured via environment variables:

| Variable | Default | Description |
|----------|---------|-------------|
| `OPENMETEO_MCP_BASE_URL` | `https://api.open-meteo.com` | Forecast API base URL |
| `OPENMETEO_MCP_GEOCODING_URL` | `https://geocoding-api.open-meteo.com` | Geocoding API base URL |
| `OPENMETEO_MCP_CACHE_TTL_MS` | `900000` (15 min) | Cache TTL for forecast data |
| `OPENMETEO_MCP_HIST_CACHE_TTL_MS` | `86400000` (24 hr) | Cache TTL for historical data |
| `OPENMETEO_MCP_TIMEOUT_MS` | `15000` | HTTP request timeout |
| `OPENMETEO_MCP_DEFAULT_TIMEZONE` | `auto` | Default timezone |
| `OPENMETEO_MCP_TEMP_UNIT` | `celsius` | Temperature unit (`celsius` / `fahrenheit`) |
| `OPENMETEO_MCP_WIND_UNIT` | `kmh` | Wind unit (`kmh` / `ms` / `mph` / `kn`) |
| `OPENMETEO_MCP_PRECIP_UNIT` | `mm` | Precipitation unit (`mm` / `inch`) |
| `OPENMETEO_MCP_FORECAST_DAYS` | `7` | Default forecast days (1–16) |
| `OPENMETEO_MCP_API_KEY` | — | API key for commercial use |

---

## 📊 Example Output

```
Weather Forecast — Berlin, Germany (52.52°N, 13.41°E)
Timezone: Europe/Berlin | Elevation: 38m

Today (Mar 28) — ⛅ Partly cloudy
  🌡️ High: 12°C | Low: 4°C
  🌧️ Precipitation: 0.2mm
  💨 Wind: 18 km/h NW

Tomorrow (Mar 29) — 🌧️ Moderate rain
  🌡️ High: 9°C | Low: 5°C
  🌧️ Precipitation: 8.4mm
  💨 Wind: 22 km/h W
```

---

## 📄 License

[MIT](../../LICENSE) © bhayanak