Skip to main content
Glama
Rishitha03reddy

weather-mcp-server

šŸŒ¦ļø Weather MCP Server

A Model Context Protocol (MCP) server built with FastMCP that provides live weather information for any city using the Open-Meteo APIs.

Features

  • Get current weather for any city

  • Uses Open-Meteo Geocoding API

  • Uses Open-Meteo Weather API

  • Built using FastMCP

  • Modular project structure

  • Logging and exception handling

  • Configuration management

Related MCP server: MCP Weather Server Demo

Tech Stack

  • Python 3

  • FastMCP

  • MCP (Model Context Protocol)

  • HTTPX

  • Open-Meteo API

Project Structure

weather-mcp-server/
│
ā”œā”€ā”€ server.py
ā”œā”€ā”€ weather_api.py
ā”œā”€ā”€ config.py
ā”œā”€ā”€ logger.py
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ .gitignore
└── README.md

Installation

  1. Clone the repository

git clone https://github.com/your-username/weather-mcp-server.git
  1. Create a virtual environment

python -m venv .venv
  1. Activate the virtual environment

Windows:

.venv\Scripts\activate
  1. Install dependencies

pip install -r requirements.txt

Run the Server

python server.py

Example Tool

get_weather

Input:

Hyderabad

Output:

šŸ“ Hyderabad, India

🌔 Temperature : 30.2°C
šŸ’Ø Wind Speed  : 18.7 km/h
☁ Condition   : Moderate Drizzle

Future Improvements

  • Weather forecast

  • Air quality information

  • Multiple MCP tools

  • Docker support

  • Unit tests

Author

Rishitha Reddy

Related MCP Connectors

Related MCP Servers