# OpenWeather MCP

> OpenWeather MCP delivers comprehensive global weather data straight from your AI client. Get real-time temperature readings, 16-day forecasts, severe weather alerts, and air quality indexes for any location on Earth. It handles everything from converting city names to coordinates to pulling historical climate records.

## Overview
- **Category:** iot-hardware
- **Price:** Free
- **Tags:** weather-forecast, air-quality, real-time-data, meteorology, climate-data

## Description

This MCP connects your agent directly to global weather APIs, giving you far more than a simple forecast. You can ask about current conditions—temperature, wind speed, pressure, and visibility—for specific locations right now. Need to plan an outdoor event? Request the daily or hourly forecasts that include min/max temperatures, precipitation probability, and UV indexes for up to 16 days out. The MCP also tracks air quality over four days, listing key pollutants like PM2.5 and ozone levels. Beyond predictions, you can check historical weather data for any past date or pull detailed sun times. If your workflow requires converting a city name into precise coordinates, this MCP handles that first step. Because Vinkius hosts all these tools in one place, you don't need to connect separate services; you just use your AI client to ask the question and get the full data set back.

## Tools

### geocode
Takes a city name and returns the top five matching locations with their coordinates, country codes, and state names.

### get_air_quality
Gets the current air quality index for a location using required latitude/longitude coordinates.

### get_air_quality_forecast
Pulls a four-day outlook on air pollution, including AQI levels and concentrations of major pollutants like PM2.5 and ozone.

### get_forecast
Retrieves a 5-day weather forecast with temperature, humidity, wind, and pressure using either a city name or coordinates.

### get_historical_weather
Returns detailed historical weather data for a specific past date, requiring both latitude/longitude and the YYYY-MM-DD format.

### get_current_weather
Delivers the immediate weather conditions (temperature, wind, etc.) for any city or given coordinates.

### get_daily_forecast
Provides a daily weather summary for up to 16 days, including min/max temperatures and UV index, requiring latitude/longitude.

### get_hourly_forecast
Outputs an hourly weather breakdown with temperature, humidity, wind, and precipitation probability using the One Call API.

### get_sun_times
Calculates the exact times and elevation angles for sunrise and sunset at a given location's coordinates.

### get_weather_alerts
Returns active severe weather warnings, including alert type, severity, and start/end times, requiring latitude/longitude.

### reverse_geocode
Converts given coordinates back into a readable city name, state, country, and postal code.

## Prompt Examples

**Prompt:** 
```
What's the current weather in São Paulo?
```

**Response:** 
```
São Paulo is currently 24°C (75°F), partly cloudy. Humidity: 65%, Wind: 12 km/h SE, Pressure: 1013 hPa, Visibility: 10 km. Feels like 25°C. Sunrise at 6:12 AM, sunset at 6:45 PM.
```

**Prompt:** 
```
What's the 7-day forecast for Tokyo?
```

**Response:** 
```
7-day forecast for Tokyo: Mon 22°C/15°C (rain), Tue 19°C/14°C (cloudy), Wed 21°C/16°C (partly cloudy), Thu 23°C/17°C (sunny), Fri 24°C/18°C (sunny), Sat 22°C/17°C (light rain), Sun 20°C/15°C (overcast).
```

**Prompt:** 
```
Is the air quality good in Beijing right now?
```

**Response:** 
```
Beijing's current AQI is 4 (Poor). PM2.5 is 75 μg/m³ (3x WHO guideline), PM10 is 120 μg/m³. Ozone and NO2 levels are moderate. Sensitive groups should reduce outdoor exposure.
```

## Capabilities

### Get current conditions
Retrieve real-time data, including temperature, wind, humidity, and visibility for a specific location.

### Predict future weather patterns
Generate multi-day forecasts, offering both high-level daily summaries (up to 16 days) and detailed hourly breakdowns with precipitation chance.

### Monitor air quality indexes
Check the current Air Quality Index (AQI) or get a four-day forecast detailing pollutant concentrations for any spot.

### Research past climate data
Pull specific weather metrics, like temperature and wind speed, for any date in history.

### Handle location mapping
Convert a city name into precise latitude/longitude coordinates, or vice versa, to target the right data set.

## Use Cases

### Planning a multi-day outdoor conference
The event manager asks their agent: 'What's the weather outlook for downtown Chicago over the next two weeks, including air quality and UV index?' The MCP runs get_daily_forecast and get_air_quality_forecast to provide comprehensive planning data.

### Assessing site viability for construction
A project lead needs to know if a remote piece of land is safe for work. They ask the agent using coordinates, which triggers get_weather_alerts and get_current_weather to confirm there are no active severe warnings.

### Analyzing historical climate records
A researcher needs data on how pollution changed in a factory town. They ask for the air quality forecast using get_historical_weather, specifying the exact date range required.

### Optimizing travel routes mid-trip
While traveling, you need to know if your next destination is safe. You use the agent with a city name, which runs geocode first, then uses get_current_weather and get_sun_times to provide immediate context.

## Benefits

- Never manually check multiple sites for weather. You can ask your agent for the 4-day air quality forecast and current conditions simultaneously, consolidating all data points into one answer.
- Planning long trips? Use the daily forecast to see up to 16 days of temperature ranges and precipitation chances, eliminating guesswork when booking outdoor activities.
- Need precise location context? The ability to run reverse geocode converts raw coordinates back into a usable city name, letting your agent know exactly where you are without extra steps.
- For emergency planning, the weather alerts tool pulls active severe warnings instantly. You don't have to search multiple government sites; just ask for 'active alerts in [city]' and get an immediate report.
- It saves time on data prep. If your task requires knowing coordinates but you only have a city name, simply run geocode first before asking for the hourly forecast.

## How It Works

The bottom line is, you ask for complex weather information in plain English, and this MCP handles all the necessary API calls behind the scenes.

1. First, subscribe to this MCP and input your unique OpenWeather API Key.
2. Next, tell your AI client exactly what you need—like 'What was the air quality in London last Tuesday?'
3. The MCP executes the request using its tools and delivers structured data directly to your agent.

## Frequently Asked Questions

**How do I get an OpenWeather API key?**
Visit [**openweathermap.org/api**](https://openweathermap.org/api), click **Sign Up** for a free account, go to **API Keys** in your account settings, and create a new key. Copy it — it's a 32-character hex string. Free tier includes 60 calls/minute.

**Can I get weather alerts for my location?**
Yes! Use `get_weather_alerts` with lat/lon coordinates. Returns active alerts with sender name, event type, severity, description and start/end times. Useful for monitoring severe weather, floods, heat waves and other dangerous conditions.

**Can I get historical weather data?**
Yes! Use `get_historical_weather` with lat/lon and a date in YYYY-MM-DD format. Returns the weather conditions for that specific day including temperature, humidity, wind and pressure.

**How do I find coordinates for a city?**
Use `geocode` with the city name (e.g. 'London', 'São Paulo', 'Tokyo'). Returns the top 5 matching locations with their latitude, longitude, country code and state. Use these coordinates with other weather tools.