SiddiqshaA/weather_mcp_server
3.2
If you are the rightful owner of weather_mcp_server 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.
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API.
Tools
1
Resources
0
Prompts
0
Weather MCP Server
A Model Context Protocol (MCP) server that provides weather information using the Open-Meteo API.
Features
- Get current weather for any location worldwide
- Supports city names via geocoding
- Returns temperature, wind speed, and timestamp
- Built with FastMCP framework
Installation
- Clone the repository:
git clone https://github.com/SiddiqshaA/weather_mcp_server.git
cd weather_mcp_server
- Create and activate a virtual environment:
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
Usage
Run the MCP server:
python weather.py
The server will start and expose a get_weather
tool that accepts a location parameter.
API
get_weather(location: str)
Fetches current weather information for a specified location.
Parameters:
location
(str): City name or location to get weather for
Returns:
- Dictionary containing:
location
: The queried locationlatitude
: Latitude coordinatelongitude
: Longitude coordinatetemperature
: Current temperature in Celsiuswindspeed
: Wind speed in km/htime
: Timestamp of the weather data
Example Response:
{
"location": "London",
"latitude": 51.5074,
"longitude": -0.1278,
"temperature": "15.5 °C",
"windspeed": "12.3 km/h",
"time": "2025-10-15T12:00"
}
Dependencies
fastmcp
: FastMCP framework for building MCP servershttpx
: Async HTTP client for API requests
Data Source
This project uses the Open-Meteo API, a free weather API that doesn't require authentication.
License
MIT License