Skip to main content
Glama
avigail4408

Weather Israel MCP

by avigail4408
README.md
# šŸŒ¦ļø Weather Israel MCP

×¤×Ø×•×™×§×˜ MCP (Model Context Protocol) ×©×ž××¤×©×Ø ל-LLM לשלוף ×Ŗ×—×–×™×Ŗ מזג אוויר ×œ×¢×Ø×™× ×‘×™×©×Ø××œ — ישירות מהדפדפן, ללא API, ×‘××ž×¦×¢×•×Ŗ Playwright.

---

## šŸŽÆ ×ž×˜×Ø×Ŗ ×”×¤×Ø×•×™×§×˜

במקום ×œ×”×”×Ŗ×ž×š על API מובנה, ה-Agent פותח דפדפן ×›×Ø×•×, מנווט לאתר [weather2day.co.il](https://www.weather2day.co.il/forecast), מחפש עיר, בוחר אותה ×ž×”×Ø×©×™×ž×” — ואז קורא את ×Ŗ×•×›×Ÿ הדף ומהפק ×Ŗ×—×–×™×Ŗ מלאה.

---

## šŸ› ļø הטאק טכנולוגי

| כלי | תפקיד |
|-----|--------|
| [MCP SDK](https://github.com/anthropics/mcp) | הגדרת Tools והרצת שרת MCP |
| [Playwright](https://playwright.dev/) | שליטה בדפדפן — ניווט, הקלדה, לחיצה |
| [OpenAI API](https://platform.openai.com/) | מודל השפה שמנהל את השיחה |
| [uv](https://github.com/astral-sh/uv) | ניהול הביבה ×•×Ŗ×œ×•×™×•×Ŗ |

---

## šŸ“ מבנה ×”×¤×Ø×•×™×§×˜

```
project-template/
ā”œā”€ā”€ client.py          # MCP Client גנרי — ×ž×Ŗ×—×‘×Ø ×œ×©×Ø×Ŗ×™ MCP
ā”œā”€ā”€ host.py            # צ'אט ×˜×Ø×ž×™× ×œ ×©×ž×—×‘×Ø את הכל יחד
ā”œā”€ā”€ weather_USA.py     # MCP Server ×œ×Ŗ×—×–×™×Ŗ ארה"ב (×“×Ø×š NWS API)
ā”œā”€ā”€ weather_Israel.py  # MCP Server ×œ×Ŗ×—×–×™×Ŗ ×™×©×Ø××œ (×“×Ø×š Playwright)
ā”œā”€ā”€ .env               # ×ž×¤×Ŗ×— API (לא מועלה ל-Git)
└── pyproject.toml     # ×Ŗ×œ×•×™×•×Ŗ ×”×¤×Ø×•×™×§×˜
```

---

## šŸš€ הרצת ×”×¤×Ø×•×™×§×˜

### 1. ×”×Ŗ×§× ×Ŗ ×Ŗ×œ×•×™×•×Ŗ

```bash
uv sync
```

### 2. ×”×Ŗ×§× ×Ŗ דפדפן ×›×Ø×•× עבור Playwright

```bash
uv run playwright install chromium
```

### 3. הגדרת ×ž×¤×Ŗ×— API

צור קובׄ `.env` בתיקייה:

```
OPENAI_API_KEY=your_openai_api_key_here
```

### 4. הרצה

```bash
uv run host.py
```

---

## šŸ’¬ ×“×•×’×ž××•×Ŗ ×œ×©××œ×•×Ŗ

```
Query: what is the weather in Jerusalem?
Query: מה ×”×Ŗ×—×–×™×Ŗ לתל אביב?
Query: האם גשום היום בחיפה?
Query: what is the weather forecast for Bnei Brak?
Query: what are the weather alerts in NY?
Query: what is the forecast for latitude 40.7, longitude -74.0?
```

---

## 🧩 ה-Tools של weather_Israel MCP

| Tool | תיאור |
|------|--------|
| `open_weather_forecast_israel` | פותח דפדפן ומנווט לאתר מזג האוויר |
| `enter_weather_forecast_city_israel` | מקליד שם עיר בשדה החיפוש |
| `select_weather_forecast_city_israel` | בוחר את העיר ×”×ž×Ŗ××™×ž×” ×ž×”×Ø×©×™×ž×” הנפתחת |
| `extract_weather_data_from_page` | קורא את ×Ŗ×•×›×Ÿ הדף ×•×ž×—×–×™×Ø את ×”×Ŗ×—×–×™×Ŗ ל-LLM (RAG) |

---

## 🧩 ה-Tools של weather_USA MCP

| Tool | תיאור |
|------|--------|
| `get_alerts_in_USA` | ×ž×—×–×™×Ø התראות מזג אוויר לפי קוד מדינה (e.g. `CA`, `NY`) |
| `get_forecast_in_USA` | ×ž×—×–×™×Ø ×Ŗ×—×–×™×Ŗ לפי ×§×•××•×Ø×“×™× ×˜×•×Ŗ גיאוגרפיות |

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation4/5

Each tool maps to a distinct browser step: opening, typing a city, selecting from a dropdown, and extracting page text. The two city-related tools could be confused at first glance, but the descriptions clarify typing vs. selecting.

Naming Consistency4/5

All names are snake_case and verb-first, with most sharing the 'weather_forecast' prefix. 'extract_weather_data_from_page' breaks the pattern slightly, and the first tool omits 'city', but the overall convention is still predictable.

Tool Count4/5

Four tools is a reasonable number for a tightly scoped browser automation flow. Each tool serves a necessary step in the workflow, though the set is on the smaller side.

Completeness4/5

The tools cover the full workflow from opening the site to extracting weather forecast text. Minor gaps like explicit wait/retry or error-handling steps are missing, but the core retrieval process is complete.

Maintenance

ActivityMaintained
ResponsivenessNo issues