WeatherAssistantMCP

deoprakash/WeatherAssistantMCP

3.1

If you are the rightful owner of WeatherAssistantMCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Indian Weather Assistant is a beginner-friendly MCP project that connects a Python weather server to Claude, allowing users to ask natural language weather questions for Indian cities.

Tools
2
Resources
0
Prompts
0

🌦️ Indian Weather Assistant (Claude + MCP)

This is a beginner-friendly MCP (Model Context Protocol) project that connects a Python weather server to Claude, allowing you to ask natural language weather questions for Indian cities. It uses the free wttr.in API to fetch real-time conditions and 2-day forecasts.


🚀 Project Highlights

  • 🔗 Connected to Claude via MCP
  • 🧠 Tools callable via natural language
  • 🌐 Live weather data via wttr.in API
  • 🛠️ Built using FastMCP server & inspected using MCP Inspector GUI

📸 Demo Screenshots

✅ Claude Integration Test

Claude Integration

🛠 MCP Inspector Tool Execution

Tool Interface

📋 Forecast Output Validation

Forecast JSON Output


🧰 Tech Stack

ComponentDescription
🧠 ClaudeAI assistant that routes natural prompts to your tools
⚙️ MCPProtocol to connect Claude to external tools
🐍 PythonTool implementation via FastMCP
🌐 wttr.inFree API for weather forecasts in India
🧪 MCP InspectorVisual testing and inspection interface

📂 Folder Structure

weather-assistant-mcp/
│
├── weather.py             # MCP server with tools
├── .venv/                 # Python virtual environment (optional)
├── README.md              # This file
└── ...

🔧 How It Works

Step 1: User Prompt to Claude

“Will it rain in Mumbai tomorrow?”

Step 2: Claude sends the request via MCP

  • Claude identifies the prompt matches your tool get_forecast(city)

Step 3: Your Python tool runs

  • weather.py fetches real-time data from https://wttr.in/mumbai?format=j1

Step 4: Claude responds with result

📍 Mumbai Weather: 🌧️ Rain expected tomorrow with highs of 30°C.


🛠️ Tool Functions

get_forecast(city: str)

Returns current weather and 2-day forecast for a given Indian city.

get_alerts(city: str)

Returns alerts if there's extreme heat, wind, humidity, or rain.


✅ Setup & Run

1. Install dependencies

uv venv
uv pip install mcp[cli] httpx

2. Run MCP Inspector

npx @modelcontextprotocol/inspector \
  uv \
  --directory . \
  run \
  weather.py

3. In Inspector UI

  • Transport Type: STDIO
  • Command: uv
  • Args: run --directory . weather.py
  • Click ▶️ Restart → Connected!

👋 About

This project is my first step in learning Claude + MCP integration.
Built with Python, Claude API, and FastMCP.

Author: DEO PRAKASH
Date: July 2025
Inspired by: ModelContextProtocol (https://modelcontextprotocol.io)


📜 License

MIT License