- Home
- MCP servers
- Weather
Weather
- python
9
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"saintdoresh-weather-mcp-claudedesktop": {
"command": "py",
"args": [
"-3.13",
"C:\\Path\\To\\Your\\Weather-MCP-ClaudeDesktop\\main.py"
],
"env": {
"OPENWEATHER_API_KEY": "YOUR_OPENWEATHERMAP_API_KEY"
}
}
}
}You can access real-time weather data, forecasts, historical conditions, air quality, and alerts by running a Weather MCP Server locally and connecting it to your MCP client. This enables you to query weather information for any location directly from Claude Desktop or other compatible clients, with up-to-date data and convenient tooling.
How to use
Start the Weather MCP Server locally and connect it to your MCP client. You will interact with it through the client’s MCP configuration, which lets you request current weather, forecasts, air quality, historical data, and alerts for any location. Use the client to ask questions like current conditions in a city, a 5-day forecast, or whether there are any active weather alerts.
How to install
Prerequisites you need before starting are Python 3.10 or higher and access to install Python dependencies.
pip install -r requirements.txt
Obtain an API key from OpenWeatherMap. A free tier is available, but new keys may require up to 24 hours to activate.
Create environment variables for your API key to keep credentials secure. In your project directory, create a file named ".env" with the following content:
OPENWEATHER_API_KEY=your_openweathermap_api_key
Make sure the ".env" file is ignored by version control to avoid exposing sensitive data.
Load the environment variables in your Python startup script, replacing the direct API key with the environment reference:
# Add these imports at the top
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Replace the API_KEY line with
API_KEY = os.getenv("OPENWEATHER_API_KEY")
MCP integration configuration
Configure the Weather MCP Server in your MCP client by adding a stdio-based server entry that runs the Weather script locally.
{
"mcpServers": {
"weather": {
"type": "stdio",
"name": "weather",
"command": "py",
"args": ["-3.13", "C:\\Path\\To\\Your\\Weather-MCP-ClaudeDesktop\\main.py"]
}
}
}
To start the server from the command line, run the following in the same environment where Python is available:
py -3.13 main.py
Troubleshooting and notes
If the MCP server does not start, ensure you are using a full, absolute path to main.py in the configuration and that Python 3.10+ is installed and available in your system PATH.
Verify that the OpenWeatherMap API key is valid and active. If you receive an authentication error, re-check the key in your ".env" file and reload the environment variables.
Available tools
get_current_weather
Fetches real-time weather conditions for a specified location, returning temperature, humidity, wind, and condition data.
get_weather_forecast
Provides a multi-step forecast for a location including hourly/daily data, temperatures, wind, and conditions.
get_air_quality
Returns air quality index and component breakdowns (e.g., PM2.5, PM10, CO, NO2) for a location.
get_historical_weather
Retrieves weather data for a specific past date, including temperature and conditions.
search_location
Searches for locations by name and returns coordinates and basic metadata.
get_weather_alerts
Retrieves active weather alerts for a location, including event type, timing, and descriptions.