Fetch Weather Data with OpenWeatherMap
Get current weather and a 5-day forecast for any city via OpenWeatherMap, with configurable units and language.
Maintainer of this project? Claim this page to edit the listing.
1.0.0Add to Favorites
Why it matters
Integrate with the OpenWeatherMap API to retrieve current weather conditions and 5-day forecasts. This asset supports customizable units and multiple languages, making it easy to embed weather data into your applications.
Outcomes
What it gets done
Get current weather for any city.
Retrieve 5-day weather forecasts.
Customize units (Celsius, Fahrenheit, Kelvin).
Support for multiple languages.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-openweather | bash Capabilities
Tools your agent gets
Retrieves current weather conditions and 5-day forecast for a specified city with customizable units and language support.
Overview
OpenWeather MCP Server
MCP Weather Service fetches current weather and a 5-day forecast from the free OpenWeatherMap API for a given city, with configurable temperature units and response language. Use it when an AI assistant needs current weather or forecast data for a city. Requires an OpenWeatherMap API key set via OWM_API_KEY.
What it does
MCP Weather Service is a simple Go-based MCP server that fetches current weather conditions and a 5-day forecast from the free OpenWeatherMap API, with configurable temperature units and response language.
When to use - and when NOT to
Use it when you want an AI assistant to answer weather questions for a specific city - current conditions (temperature, pressure, humidity, wind, sunrise/sunset) and a multi-day forecast broken into 3-hour intervals. Units can be set to Celsius, Fahrenheit, or Kelvin, and responses can be localized (e.g. German condition names alongside English). Do not use it without an OpenWeatherMap API key set via OWM_API_KEY - the server fails fast with a fatal error if that variable is missing.
Capabilities
weather: get current weather and a 5-day forecast for a givencity(required), with optionalunits(c/f/k) andlang(e.g.en,de,fr) parameters.
Example response includes current conditions (temperature, high/low, pressure, humidity, feels-like, wind speed/degree, sunrise/sunset as Unix timestamps) followed by a forecast broken into 3-hour blocks with date/time, conditions, and temperature.
How to install
Requires Go 1.20+ and a free OpenWeatherMap API key (openweathermap.org/api):
git clone https://github.com/mschneider82/mcp-openweather.git
cd mcp-openweather
go build -o mcp-weather
Or install automatically for Claude Desktop via Smithery:
npx -y @smithery/cli install @mschneider82/mcp-openweather --client claude
Set the API key and register the server:
export OWM_API_KEY="your_api_key_here"
{
"mcpServers": {
"mcp-openweather": {
"command": "/home/YOURUSER/git/mcp-openweather/mcp-openweather",
"env": { "OWM_API_KEY": "PUT_API_KEY_HERE" }
}
}
}
Who it's for
Anyone who wants Claude to answer weather questions - current conditions and forecasts for any city - directly in conversation instead of checking a separate weather app.
Source README
MCP Weather Service
A simple MCP service that provides current weather and 5-day forecast using the free OpenWeatherMap API.
Features
- Current weather conditions
- 5-day weather forecast
- Configurable units (Celsius/Fahrenheit/Kelvin)
- Multi-language support
- Simple MCP integration
Prerequisites
- Go 1.20+
- OpenWeatherMap API key
Installation
Get OpenWeatherMap API key from https://openweathermap.org/api
Clone repository:
git clone https://github.com/mschneider82/mcp-openweather.git cd mcp-openweatherBuild:
go build -o mcp-weather
Installing via Smithery
To install MCP Weather Service for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mschneider82/mcp-openweather --client claude
Configuration
Set required environment variable:
export OWM_API_KEY="your_api_key_here"
Usage
"mcpServers": {
"mcp-openweather": {
"command": "/home/YOURUSER/git/mcp-openweather/mcp-openweather",
"env": {
"OWM_API_KEY": "PUT_API_KEY_HERE"
}
}
}
MCP Parameters
{
"tool": "weather",
"params": {
"city": "Berlin", // Required
"units": "c", // Optional (c|f|k)
"lang": "en" // Optional (en|de|fr|...)
}
}
Example Response
Current weather for München:
Conditions: Klarer Himmel
Now: 17.78 metric
High: 18.66 metric
Low: 17.36 metric
Pressure: 1017
Humidity: 40
FeelsLike: 16.66
Wind Speed: 1.79
Wind Degree: 61
Sunrise: 1747107429 Unixtime
Sunset: 1747161784 Unixtime
Weather Forecast for München:
Date & Time: 2025-05-13 12:00:00 +0000 UTC
Conditions: Clear Klarer Himmel
Temp: 17.78
High: 18.93
Low: 17.78
Date & Time: 2025-05-13 15:00:00 +0000 UTC
Conditions: Clear Klarer Himmel
Temp: 18.33
High: 19.44
Low: 18.33
Date & Time: 2025-05-13 18:00:00 +0000 UTC
Conditions: Clear Klarer Himmel
Temp: 16.32
High: 16.32
Low: 15.59
Date & Time: 2025-05-13 21:00:00 +0000 UTC
Conditions: Clear Klarer Himmel
Temp: 9.18
High: 9.18
Low: 9.18
...
Error Handling
Common error scenarios:
Missing API key: FATAL: OWM_API_KEY environment variable not set
Invalid city: current weather error: failed to fetch current weather: city not found
Network issues: failed to fetch forecast: context deadline exceeded
Development
Contributions welcome! Please follow these steps:
Fork the repository
Create a feature branch
Commit changes
Push to the branch
Create a Pull Request
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.