Skip to main content
Glama
Samarth201104

MCP-server-weather

README.md
# Weather Intelligence MCP Server

A simple Weather Intelligence application built using the **Model Context Protocol (MCP)**. This project demonstrates how to expose weather-related functionalities as MCP tools and access them through an MCP client.

## Features

- Current Weather
- Weather Forecast
- Rain Prediction
- Compare Weather Between Cities
- Activity Recommendation
- Natural Language Prompt Routing

## Tech Stack

- Python
- MCP Python SDK (FastMCP)
- OpenWeather API
- python-dotenv

## Project Structure

```
mcp-server/
│── client.py          # MCP Client
│── server.py          # MCP Server
│── weather.py         # Weather API Logic
│── .env               # API Keys
│── requirements.txt
│── README.md
```

## Installation

```bash
git clone <repository-url>
cd mcp-server

python -m venv venv

venv\Scripts\activate

pip install -r requirements.txt
```

## Run the Project

Start the MCP Client:

```bash
python client.py
```

## Example Prompts

- What is the weather in Mumbai?
- Forecast for Delhi
- Will it rain in Pune?
- Compare Mumbai and Chennai
- Recommend activity in Bangalore

## Project Workflow

```
User
   ↓
MCP Client
   ↓
MCP Server
   ↓
Weather Logic
   ↓
OpenWeather API
```

## Author

**Samarth More**