Skip to main content
Glama
Rishitha03reddy

weather-mcp-server

README.md
# šŸŒ¦ļø 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

## 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

```bash
git clone https://github.com/your-username/weather-mcp-server.git
```

2. Create a virtual environment

```bash
python -m venv .venv
```

3. Activate the virtual environment

Windows:

```bash
.venv\Scripts\activate
```

4. Install dependencies

```bash
pip install -r requirements.txt
```

## Run the Server

```bash
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