Skip to main content
Glama
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

Disambiguation5/5

Each tool represents a distinct step in a clear browser workflow: open the site, enter a city, select a city, and extract text. Even though enter and select both relate to city input, their descriptions clearly distinguish typing into a search field from choosing from a dropdown.

Naming Consistency4/5

All tool names use snake_case with a verb-noun structure, but the object naming is slightly inconsistent: three names end with 'city_israel' or 'israel', while the extract tool uses 'weather_data_from_page' and drops the location marker. Overall the pattern is readable and predictable.

Tool Count5/5

With only 4 tools, the server is tightly scoped to a single weather-forecast retrieval workflow. Each tool earns its place as a necessary step, and the count is well within the ideal range for a focused server.

Completeness4/5

The tools cover the core lifecycle of opening the forecast page, entering and selecting a city, and extracting the forecast text for the model. Minor gaps exist, such as no explicit retry, reset, or alternate navigation tool, but the primary user journey is fully supported.