Israel Weather MCP
# Israel Weather MCP — Playwright browser automation over weather2day.co.il
MCP Server שמאפשר ל‑LLM לשלוף תחזית מזג אוויר **בישראל** על ידי שליטה בדפדפן (Playwright),
במקום API מובנה. המידע נשלף מ־[Weather2Day](https://www.weather2day.co.il/forecast).
## מה בפרויקט
| קובץ | תפקיד |
|------|--------|
| `weather_Israel.py` | MCP Server ישראלי — Tools של Playwright |
| `weather_USA.py` | MCP Server אמריקאי — NWS API (מהתבנית) |
| `client.py` | MCP Client גנרי (stdio) |
| `host.py` | צ'אט טרמינל שמחבר Claude לכל ה‑MCPs |
### Tools ב‑`weather_Israel`
1. `open_weather_forecast_israel` — פותח את דף התחזית
2. `enter_weather_forecast_city_israel(city_name)` — מזין שם עיר בשדה החיפוש
3. `select_weather_forecast_city_israel` — בוחר את ההצעה הראשונה ברשימה
4. `get_weather_page_content` — מחלץ ומנקה את תוכן הדף ל‑LLM (**RAG**)
## התקנה
דרישות: Python 3.13+, [uv](https://github.com/astral-sh/uv), מפתח Anthropic.
```bash
cd weather-israel-mcp
uv sync
uv run playwright install chromium
copy .env.example .env
# ערכי ANTHROPIC_API_KEY ב-.env — מפתח אמיתי שמתחיל ב-sk-ant-
# (לא להשאיר your_anthropic_api_key)
```
## הרצה
```bash
uv run host.py
```
בצ'אט הטרמינל שאלי למשל:
- מה מזג האוויר בירושלים?
- תן לי תחזית לחיפה להיום
- האם צפוי גשם בבני ברק?
- מה הטמפרטורה בתל אביב?
ה‑Host אמור לבחור את `weather_Israel`, להפעיל את ה‑Tools בזה אחר זה, לפתוח דפדפן,
ואז (שלב ב׳) לקרוא ל‑`get_weather_page_content` ולענות בשיחה לפי התוכן.
לעזיבה: `quit`.
## זרימת העבודה
```
שאלה → Claude בוחר Tools
→ open_weather_forecast_israel
→ enter_weather_forecast_city_israel("...")
→ select_weather_forecast_city_israel
→ get_weather_page_content ← RAG לדף
→ תשובה בצ'אט
```
## הערות
- הדפדפן רץ עם `headless=False` כדי שתראי את האוטומציה.
- למשתמשי NetFree: ב‑`host.py` / `weather_USA.py` כבר מוגדר `verify=False` ל‑httpx.
- אל תחפשי תחזית בגוגל דרך Playwright — Captcha. כאן הולכים ישירות ל‑Weather2Day.
## סטאק
MCP SDK (FastMCP) · Playwright · Anthropic · uv
## בונוס מהמטלה — ספרייה נוספת שקיבלה בוסט מ‑AI Agents
כמו Playwright, גם **Selenium** ו‑**Puppeteer** נולדו לפני עידן ה‑GenAI, אבל עם עליית ה‑Agents הן חזרו לקדמת הבמה כשכבת "ידיים לדפדפן".
במקביל, ספריות כמו **LangChain / LlamaIndex** לקחו רכיבים ישנים יותר (retrievers, vector stores, parsers) והפכו אותם לקוביות Lego של Agents.
TDQS
Scored across 4 tools
Each tool represents a distinct step in a clear sequential workflow: open site, enter city, select suggestion, extract content. There is no overlap in functionality, and the dependencies are explicitly described in the tool descriptions.
All names use snake_case, but the pattern is mixed: the first three follow 'verb_weather_forecast_[city_]israel', while the fourth breaks the pattern with 'get_weather_page_content'. The verbs are consistent with their actions, but the structural inconsistency is notable.
Four tools is perfectly scoped for the domain. Each tool covers a necessary step in retrieving weather forecast data from the site, with no extraneous or redundant tools.
The tool set fully covers the intended workflow: open site → enter city → select suggestion → extract content. It allows for multiple city queries by repeating the enter/select steps, and there are no obvious dead ends or missing operations within the stated purpose.