Skip to main content
Glama
Efrat-Fr

Weather-MCP

by Efrat-Fr

🌤️ — Weather Forecast in Israel

A learning project in MCP (Model Context Protocol) development: an LLM-based Agent that can fetch weather forecasts for cities in Israel and the US, and answer in free language in a terminal chat.


🎯 Project Goal

Build a dedicated MCP server that "teaches" the LLM to perform a task it can't do on its own — fetching a weather forecast from an Israeli site that has no API.

The agent does this in two ways:

  1. Israel server (weather-Israel) — automates a real browser with Playwright: opens weather2day.co.il/forecast, searches for a city, selects it, then extracts the forecast page content and feeds it to the LLM so it can answer on its own (RAG approach).

  2. US server (weather-USA) — fetches forecast and alerts via the official NWS (National Weather Service) API.

The Host connects all servers to the LLM (Gemini, via the OpenAI-compatible API), automatically collects all their Tools, and runs a chat loop in which the LLM chooses which tool to use and activates them one by one until an answer is obtained.


Related MCP server: mcp-playwright-weather-israel

🏗️ Project Structure

project-template/
├── host.py            # צ'אט בטרמינל שמחבר את ה-LLM לכל שרתי ה-MCP
├── client.py          # MCP Client גנרי (מתחבר לשרת, מריץ Tools)
├── weather_USA.py     # שרת MCP לארה"ב — דרך NWS API
├── weather_Israel.py  # שרת MCP לישראל — דרך אטמוט דפדפן (Playwright)
├── pyproject.toml     # תלויות הפרויקט
└── README.md

Tools of the Israel server

#

Tool

Role

1

open_weather_forecast_israel

Opens a Chromium browser and navigates to the forecast site

2

enter_weather_forecast_city_israel

Types a city name in the search field

3

select_weather_forecast_city_israel

Selects the first city from the suggestions list

4

get_weather_forecast_content_israel

Extracts the forecast page content (including iframes) and returns it to the LLM

💡 The first three share the same browser via a global state (_page), because they all run in the same server process. The fourth iterates over all frames on the page, because the forecast itself loads inside an <iframe> that the main body doesn't see.


⚙️ Installation and Running

Prerequisites

  • Python ≥ 3.13

  • uv (environment and dependency manager)

  • Gemini API key (get a free key)

Steps

# 1. התקנת התלויות והקמת סביבת העבודה
uv sync

# 2. התקנת דפדפן Chromium עבור Playwright
uv run playwright install chromium

Setting environment variables

Create a .env file in the project folder:

GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.0-flash

Running

uv run host.py

After launch, a Query: prompt appears — type a question (or quit to exit).


💬 Example questions the agent can answer

Forecast in Israel (Playwright)

A browser window opens showing the forecast page, and the LLM also answers in chat.

  • "What's the forecast in Tel Aviv?"

  • "How many degrees are expected tomorrow in Jerusalem?"

  • "How's the weather in Haifa today?"

  • "Open the forecast for Be'er Sheva for me"

Forecast and alerts in the US (NWS API)

  • "What's the weather forecast for San Francisco?" (latitude/longitude)

  • "Are there any weather alerts in California?"

  • "Show me active weather alerts for NY"


🧩 How it works (flow diagram)

משתמש → "מה התחזית בתל אביב?"
   │
   ▼
 Host  ──►  LLM (Gemini) בוחר Tools להפעיל
   │
   ▼  (שרת ישראל, בזה אחר זה)
 open → enter("תל אביב") → select → get_content
   │
   ▼
 תוכן התחזית חוזר ל-LLM (RAG)
   │
   ▼
 LLM כותב תשובה בשפה חופשית בצ'אט ✨

📝 Notes

  • The LLM is the one that decides which Tools to activate and in what order — we didn't write hard-coded logic.

  • Two server files = two separate processes, so any shared state (like the open browser) lives in one server only.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • Hosted MCP server to manage a restaurant menu from AI agents - 39 tools over the DuckHub API.

View all MCP Connectors

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/Efrat-Fr/Weather-MCP'

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