Skip to main content
Glama
Samarth201104

MCP-server-weather

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

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:

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Samarth201104/MCP-server-weather'

If you have feedback or need assistance with the MCP directory API, please join our Discord server