justinianstefan/mcp-server-weather
If you are the rightful owner of mcp-server-weather 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.
MCP Weather Server is a Python-based weather service built with FastMCP, utilizing the Open-Meteo API to provide current weather conditions and forecasts.
MCP Weather Server
A Python-based weather service built with FastMCP that provides current weather conditions and forecasts using the Open-Meteo API.
Features
- Get current weather conditions for any location
- Retrieve weather forecasts with detailed daily information
- Built on FastMCP for easy integration with MCP-based applications
- Uses Open-Meteo API for reliable weather data
Prerequisites
- Python 3.10 or higher
- pip or uv package manager
Installation
- Clone the repository:
git clone https://github.com/yourusername/mcp-server-weather.git
cd mcp-server-weather
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
- Install dependencies:
pip install -e .
Usage
The server provides two main tools:
Get Current Weather
await get_current_weather(latitude: float, longitude: float)
Returns current weather conditions including:
- Temperature
- Precipitation
- Wind speed and direction
- Cloud cover
- Humidity
- Pressure
- And more
Get Forecast
await get_forecast(latitude: float, longitude: float)
Returns a daily forecast including:
- Maximum and minimum temperatures
- Precipitation
- Weather codes
- Daily summaries
API Integration
The server uses the Open-Meteo API (https://open-meteo.com/) to fetch weather data. No API key is required.
Development
The project uses:
- FastMCP for server implementation
- httpx for async HTTP requests
- Python type hints for better code quality
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.