Weather-MCP
# š¤ļø ā ×Ŗ××××Ŗ ××× ××××ר ××שר××
פר×××§× ××××× ×פ××Ŗ×× **MCP (Model Context Protocol)**: ×”××× (Agent) ××××”×” LLM ש××××¢ ×ש×××£ ×Ŗ××××Ŗ ××× ××××ר ×ער×× ××שר×× ×××ר×"×, ×××¢× ××Ŗ ×¢××× ××©×¤× ××פש××Ŗ ×צ'×× ×©××ר××× ×.
---
## šÆ ××רת ×פר×××§×
××× ××Ŗ שרת MCP ×××¢××× ×©"××××" ××Ŗ ×-LLM ××צע ×ש××× ×©××× ×× ××××¢ ××× ā ×ש×××£ ×Ŗ××××Ŗ ××× ××××ר ××תר ×שר××× ×©××× ×× API.
××”××× ×¢××©× ×××Ŗ ××©×Ŗ× ×ר×××:
1. **שרת ×שר×× (`weather-Israel`)** ā ××××× ×פ××¤× ××××Ŗ× ×¢× **Playwright**: פ××Ŗ× ××Ŗ [weather2day.co.il/forecast](https://www.weather2day.co.il/forecast), ××פש ×¢×ר, ×××ר ×××Ŗ×, ××× **×××ׄ ××Ŗ ×Ŗ××× ××£ ××Ŗ××××Ŗ** ××××× ×××Ŗ× ×-LLM ××× ×©××¢× × ×עצ×× (××שת **RAG**).
2. **שרת ×ר×"× (`weather-USA`)** ā ש×××£ ×Ŗ××××Ŗ ××תרע××Ŗ ××Ø× ×-API ×רש×× ×©× ×-NWS (National Weather Service).
×-**Host** ×××ר ××Ŗ ×× ×שרת×× ×-LLM (Gemini, ××Ø× ×-API ××Ŗ×××-OpenAI), ×××”×£ ××× ××××××××Ŗ ××Ŗ ×× ×-Tools, ××ר×ׄ ×××××Ŗ צ'×× ×©×× ×-LLM ×××ר ××××× ××× ××שת×ש ××פע×× ×××Ŗ× ××× ××ר ×× ×¢× ×©××Ŗ×§×××Ŗ תש×××.
---
## šļø ××× × ×פר×××§×
```
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 ×©× ×©×Ø×Ŗ ×שר××
| # | Tool | תפק×× |
|---|------|-------|
| 1 | `open_weather_forecast_israel` | פ××Ŗ× ×פ××¤× Chromium ××× ××× ××תר ××Ŗ××××Ŗ |
| 2 | `enter_weather_forecast_city_israel` | ××§××× ×©× ×¢×ר ×ש×× ×××פ×ש |
| 3 | `select_weather_forecast_city_israel` | ×××ר ××Ŗ ××¢×ר ×ר×ש×× × ×רש×××Ŗ ××צע××Ŗ |
| 4 | `get_weather_forecast_content_israel` | ×××ׄ ××Ŗ ×Ŗ××× ××£ ××Ŗ××××Ŗ (×××× iframes) ×××××ר ×××Ŗ× ×-LLM |
> š” ש××שת ×ר×ש×× ×× ××××§×× ×××Ŗ× ×פ××¤× ××Ø× ××¦× ×××××× (`_page`), ×× ×××× ×Ø×¦×× ××××Ŗ× ×Ŗ××××-שרת. ×ר×××¢× ×¢××ר ×¢× **×× ×-frames** ×××£, ×× ××Ŗ××××Ŗ עצ×× × ××¢× ×Ŗ ××Ŗ×× `<iframe>` ש×-`body` ×ר××©× ×× ×Ø×××.
---
## āļø ××Ŗ×§× × ××רצ×
### ×ר×ש××Ŗ ××§×××××Ŗ
- Python ā„ 3.13
- [uv](https://docs.astral.sh/uv/) (×× ×× ××”×××× ×××Ŗ×××××Ŗ)
- ××¤×Ŗ× API ×-Gemini ([×§×××Ŗ ××¤×Ŗ× ××× ××](https://aistudio.google.com/apikey))
### ש××××
```bash
# 1. ××Ŗ×§× ×Ŗ ××Ŗ×××××Ŗ ×××§××Ŗ ×”××××Ŗ ××¢××××
uv sync
# 2. ××Ŗ×§× ×Ŗ ×פ××¤× Chromium ×¢××ר Playwright
uv run playwright install chromium
```
### ×××רת ××©×Ŗ× × ×”××××
×¦×Ø× ×§××ׄ `.env` ××Ŗ××§×××Ŗ ×פר×××§×:
```env
GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.0-flash
```
### ×רצ×
```bash
uv run host.py
```
×××ר ××פע×× ×Ŗ×פ××¢ ש×רת `Query:` ā ××§×××× ×©××× (×× `quit` ××צ×××).
---
## š¬ ×××××××Ŗ ×ש××××Ŗ ש××”××× ××××¢ ××¢× ××Ŗ ×¢××××
### ×Ŗ××××Ŗ ××שר×× (Playwright)
> × ×¤×Ŗ× ×××× ×פ××¤× ×©×× ×Ø×××× ××Ŗ ××£ ××Ŗ××××Ŗ, ××-LLM ×× ×¢×× × ×צ'××.
- "×× ××Ŗ××××Ŗ ××Ŗ× ××××?"
- "××× ××¢×××Ŗ צפ××××Ŗ ××ר ××ר×ש×××?"
- "××× ××× ×××××ר ××××¤× ××××?"
- "תפת×× ×× ××Ŗ ××Ŗ××××Ŗ ×××ר ש××¢"
### ×Ŗ××××Ŗ ××תרע××Ŗ ××ר×"× (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"
---
## š§© ××× ×× ×¢××× (תרש×× ×ר×××)
```
×שת×ש ā "×× ××Ŗ××××Ŗ ××Ŗ× ××××?"
ā
ā¼
Host āāāŗ LLM (Gemini) ×××ר Tools ××פע××
ā
ā¼ (שרת ×שר××, ××× ××ר ××)
open ā enter("×Ŗ× ××××") ā select ā get_content
ā
ā¼
×Ŗ××× ××Ŗ××××Ŗ ×××ר ×-LLM (RAG)
ā
ā¼
LLM ×××Ŗ× ×Ŗ×©××× ××©×¤× ××פש××Ŗ ×צ'×× āØ
```
---
## š ×ער××Ŗ
- ×-LLM ××× ×× ×©××××× ×××× Tools ××פע×× ×××××× ×”×ר ā ×× ××Ŗ×× × ×××××§× ×§×©×××.
- ×©× × ×§××¦× ×©×Ø×Ŗ = ×©× × ×Ŗ×××××× × ×¤×Ø×××, ×××× ×× ××¦× ×ש××Ŗ×£ (××× ××פ××¤× ×פת××) ×× ××Ŗ×× ×©×Ø×Ŗ ××× ××××.
TDQS
Scored across 4 tools
Each tool covers a distinct workflow step: opening the page, typing a city, selecting an autocomplete result, and extracting content. The main ambiguity is between open_weather_forecast_israel and get_weather_forecast_content_israel, since both could sound like they return forecast data without reading the descriptions carefully.
All tool names follow the same verb-first snake_case pattern and consistently include weather_forecast and israel context. This makes the order and purpose of the tools predictable.
Four tools is appropriate for the narrow browser-automation workflow this server provides. Each tool contributes one essential step, and the set is neither bloated nor too thin.
The tool surface covers the full workflow from opening the forecast site to retrieving the forecast text for a chosen city. It lacks fallback or reset tools, but those are not essential for the core task.