home / mcp / weather mcp server
Weather MCP server which returns 7 days of detailed weather forecasts anywhere in the world
Configuration
View docs{
"mcpServers": {
"rossshannon-weekly-weather-mcp": {
"command": "python",
"args": [
"weather_mcp_server.py"
],
"env": {
"OPENWEATHER_API_KEY": "YOUR_API_KEY"
}
}
}
}You run a weather data MCP server that delivers 8-day global forecasts and current conditions from OpenWeatherMap One Call API 3.0. It’s useful for planning outdoor activities, gardening, travel, or any app that needs reliable weather insights with time-of-day granularity and timezone handling.
You will run the weather MCP server locally or in your environment and connect MCP clients to it. The server exposes two endpoints named get_weather and get_current_weather. Use get_current_weather for quick, present conditions and get_weather for a full week forecast with morning, afternoon, and evening data points.
To use it, provide your OpenWeatherMap API key via the environment variable OPENWEATHER_API_KEY or ensure your client passes the key when invoking the tools. Then start the server and configure your MCP client to call the available tools with the location you want to query. Include a timezone_offset to ensure times align with your local zone.
Common scenarios you can handle with the server include planning outdoor chores for the week, deciding when to mow the lawn, assessing wind for outdoor activities, and determining if rain will affect your garden plans.
Prerequisites you need before installation:
- Python 3.x installed on your system
- A Python virtual environment tool (recommended) without conflicting packages
- Git for cloning the repository
- Internet access to fetch dependencies and the OpenWeatherMap data
Follow these concrete steps to set up the server and dependencies.
# Clone the repository
git clone https://github.com/rossshannon/weekly-weather-mcp.git
cd weekly-weather-mcp
# Create a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # Linux/Mac
# OR
venv\Scripts\activate # Windows
# Install dependencies
pip3 install -r requirements.txtProvide your API key by setting an environment variable or by supplying it when you invoke the tool. The recommended approach is to set the variable in your environment and then start the server.
# Method 1: Environment variable
export OPENWEATHER_API_KEY="your_api_key" # Linux/Mac
set OPENWEATHER_API_KEY=your_api_key # Windows
# Start the server
python weather_mcp_server.pyIf you prefer not to set a persistent environment variable, you can start the server and provide the API key during invocation.
# Run directly with API key provided via environment at runtime (if supported by your setup)
OPENWEATHER_API_KEY="your_api_key" python weather_mcp_server.pyConfigure your MCP client to call the weather tools. The client should point to the local server executable and pass the OPENWEATHER_API_KEY in the environment for the running process.
Example client configuration (conceptual). Use the exact tools and paths shown in your MCP client interface.
Fetches current conditions, hourly forecasts for 48 hours, and 8-day daily forecasts with morning, afternoon, and evening data points, plus weather summaries and precipitation probabilities for a given location.
Returns only the current weather information for a specified location, including temperature, humidity, wind, and condition.