AiondaDotCom/mcp-open-meteo
If you are the rightful owner of mcp-open-meteo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Open-Meteo Weather Server provides comprehensive access to weather data using the Open-Meteo API, offering a range of weather-related information including forecasts, historical data, and air quality.
MCP Open-Meteo Weather Server
A comprehensive Model Context Protocol (MCP) server that provides access to weather data from the Open-Meteo API. This server offers current weather, forecasts, historical data, air quality information, and marine weather conditions.
Features
- Weather Forecast: Get current weather and forecast data for any location (up to 16 days)
- Historical Weather: Access historical weather data for any date range
- Air Quality: Current and forecast air quality data including PM2.5, PM10, and other pollutants
- Marine Weather: Wave height, direction, and period for coastal and ocean locations
- Location Search: Search for locations by name to get coordinates
- Comprehensive Data: Access to 100+ weather variables
- Multiple Units: Support for different temperature, wind speed, and precipitation units
- Timezone Support: Automatic or manual timezone specification
- Free to use (Open-Meteo API doesn't require API keys)
Installation
npm install
npm run build
Usage
With MCP Client
Add this server to your MCP client configuration:
{
"servers": {
"open-meteo": {
"command": "node",
"args": ["path/to/mcp-open-meteo/dist/cli/stdio.js"]
}
}
}
Development
Run in development mode:
npm run dev
Run tests:
npm test
Tools
get-weather-forecast
Get current weather and forecast data for a location.
Parameters:
latitude
(number, required): Latitude coordinate (-90 to 90)longitude
(number, required): Longitude coordinate (-180 to 180)forecast_days
(number, optional): Number of forecast days (1-16, default: 7)hourly
(string[], optional): Hourly weather variables to includedaily
(string[], optional): Daily weather variables to includecurrent
(string[], optional): Current weather variables to includetimezone
(string, optional): Timezone (default: auto)temperature_unit
(string, optional): celsius|fahrenheit (default: celsius)wind_speed_unit
(string, optional): kmh|ms|mph|kn (default: kmh)precipitation_unit
(string, optional): mm|inch (default: mm)
Example:
{
"latitude": 52.52,
"longitude": 13.41,
"forecast_days": 3
}
get-historical-weather
Get historical weather data for a specific location and date range.
Parameters:
latitude
(number, required): Latitude coordinate (-90 to 90)longitude
(number, required): Longitude coordinate (-180 to 180)start_date
(string, required): Start date in YYYY-MM-DD formatend_date
(string, required): End date in YYYY-MM-DD formathourly
(string[], optional): Hourly weather variables to includedaily
(string[], optional): Daily weather variables to includetimezone
(string, optional): Timezone (default: auto)temperature_unit
(string, optional): celsius|fahrenheit (default: celsius)wind_speed_unit
(string, optional): kmh|ms|mph|kn (default: kmh)precipitation_unit
(string, optional): mm|inch (default: mm)
Example:
{
"latitude": 52.52,
"longitude": 13.41,
"start_date": "2024-01-01",
"end_date": "2024-01-07"
}
get-air-quality
Get current and forecast air quality data for a specific location.
Parameters:
latitude
(number, required): Latitude coordinate (-90 to 90)longitude
(number, required): Longitude coordinate (-180 to 180)forecast_days
(number, optional): Number of forecast days (1-5, default: 1)hourly
(string[], optional): Air quality variables to includedomains
(string, optional): Air quality forecast domain (auto|cams_global|cams_europe, default: auto)
Example:
{
"latitude": 52.52,
"longitude": 13.41,
"forecast_days": 2
}
get-marine-weather
Get marine weather conditions for coastal and ocean locations.
Parameters:
latitude
(number, required): Latitude coordinate (-90 to 90)longitude
(number, required): Longitude coordinate (-180 to 180)forecast_days
(number, optional): Number of forecast days (1-7, default: 7)hourly
(string[], optional): Marine weather variables to includedaily
(string[], optional): Daily marine weather variables to include
Example:
{
"latitude": 54.0,
"longitude": 6.0,
"forecast_days": 3
}
search-locations
Search for locations by name to get coordinates.
Parameters:
name
(string, required): Location name to search forcount
(number, optional): Maximum number of results (1-100, default: 10)language
(string, optional): Language for results (default: en)
Example:
{
"name": "Berlin",
"count": 5
}
Available Weather Variables
Current Weather
temperature_2m
: Air temperature at 2 metersrelative_humidity_2m
: Relative humidity at 2 metersapparent_temperature
: Feels-like temperatureprecipitation
: Precipitation amountweather_code
: WMO weather interpretation codecloud_cover
: Total cloud coverwind_speed_10m
: Wind speed at 10 meterswind_direction_10m
: Wind direction at 10 meterspressure_msl
: Sea level pressure
Hourly Variables
Includes all current weather variables plus:
dewpoint_2m
: Dew point temperatureprecipitation_probability
: Probability of precipitationrain
: Rain amountshowers
: Shower amountsnowfall
: Snowfall amountvisibility
: Visibility distancewind_gusts_10m
: Wind gusts- And many more...
Daily Variables
temperature_2m_max
: Maximum daily temperaturetemperature_2m_min
: Minimum daily temperatureprecipitation_sum
: Total daily precipitationwind_speed_10m_max
: Maximum daily wind speedsunrise
: Sunrise timesunset
: Sunset timeuv_index_max
: Maximum UV index- And more...
Examples
Get Weather for Berlin
{
"tool": "get-weather-forecast",
"parameters": {
"latitude": 52.52,
"longitude": 13.41,
"forecast_days": 5,
"current": ["temperature_2m", "weather_code", "wind_speed_10m"],
"daily": ["temperature_2m_max", "temperature_2m_min", "precipitation_sum"]
}
}
Search for London
{
"tool": "search-locations",
"parameters": {
"name": "London",
"count": 3
}
}
Data Sources
This server uses the Open-Meteo API, which provides:
- Global weather forecasts up to 16 days
- Historical weather data from 1940
- High-resolution data from multiple weather models
- No API key required
- Free for non-commercial use
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Development
Project Structure
src/
āāā server/
ā āāā tools/ # MCP tools implementation
ā āāā types/ # TypeScript type definitions
ā āāā utils/ # Utility functions
ā āāā config/ # Configuration constants
āāā cli/
ā āāā stdio.ts # CLI entry point
tests/ # Test files
docs/ # Documentation
Adding New Tools
- Create a new tool file in
src/server/tools/
- Export the tool from
src/server/tools/index.ts
- Register the tool in
src/server/index.ts
- Add tests in
tests/unit/tools/
Running Tests
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage