weather_mcp_server

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

  1. Clone the repository:
git clone https://github.com/SiddiqshaA/weather_mcp_server.git
cd weather_mcp_server
  1. Create and activate a virtual environment:
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate
  1. 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 location
    • latitude: Latitude coordinate
    • longitude: Longitude coordinate
    • temperature: Current temperature in Celsius
    • windspeed: Wind speed in km/h
    • time: 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 servers
  • httpx: 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