A Model Context Protocol (MCP) server that provides weather data using the Open-Meteo API. This server allows AI assistants to retrieve current weather conditions and forecasts for any location on Earth.
- Current Weather: Get real-time temperature, wind speed, humidity, and weather conditions
- Weather Forecast: Retrieve hourly forecasts for up to 7 days
- Weather Summary: Get a comprehensive summary including current conditions and daily min/max temperatures
- Global Coverage: Works with any latitude/longitude coordinates worldwide
- No API Key Required: Uses the free Open-Meteo API
- Clone or download this repository
- Install dependencies:
npm install
Start the MCP server:
npm startFor development with auto-restart:
npm run devThe server provides three main tools:
Get current weather data for a specific location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the location
Example:
{
"name": "get_current_weather",
"arguments": {
"latitude": 52.52,
"longitude": 13.41
}
}Get hourly weather forecast for a specific location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the locationdays(number, optional): Number of days to forecast (default: 7)
Example:
{
"name": "get_weather_forecast",
"arguments": {
"latitude": 52.52,
"longitude": 13.41,
"days": 3
}
}Get a summary of current weather and today's forecast for a location.
Parameters:
latitude(number): Latitude of the locationlongitude(number): Longitude of the location
Example:
{
"name": "get_weather_summary",
"arguments": {
"latitude": 52.52,
"longitude": 13.41
}
}This server uses the Open-Meteo API, which provides:
- Temperature: 2-meter temperature in Celsius
- Wind Speed: 10-meter wind speed in km/h
- Humidity: Relative humidity percentage
- Weather Codes: WMO weather codes for conditions
- 0: Clear sky
- 1-3: Partly cloudy
- 45, 48: Foggy
- 51-55: Drizzle
- 61-65: Rain
- 71-75: Snow
- 95: Thunderstorm
The server is configured to use the Open-Meteo API base URL: https://api.open-meteo.com/v1/forecast
No API key is required as Open-Meteo is a free service.
The server includes comprehensive error handling for:
- Missing required parameters
- Invalid API responses
- Network connectivity issues
- API rate limiting
To modify the server:
- Edit
server.jsto add new tools or modify existing ones - Update the tool schemas in the
tools/listhandler - Test your changes with
npm run dev
MIT License - feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit issues and pull requests.