Skip to main content
Glama
Sh4960

Weather Israel MCP Server

by Sh4960
README.md
# Weather Israel MCP Server ๐ŸŒค๏ธ

A Python and Playwright-based MCP (Model Context Protocol) server that enables Large Language Models (LLMs) to retrieve up-to-date weather forecasts for various cities in Israel from [weather2day.co.il](https://www.weather2day.co.il).

## ๐Ÿš€ Key Features

* **Full MCP Integration:** Provides a structured set of tools for executing search and data extraction workflows.
* **Efficient Browser Management (Singleton Pattern):** Maintains a single active Playwright session across all search steps.
* **Built-in Hebrew Support:** Explicit prompts instruct the LLM to pass city names in Hebrew for accurate search results.
* **Targeted Content Extraction (RAG):** Extracts and cleans text from the forecast page, delivering a focused context payload to the language model.

---

## ๐Ÿ› ๏ธ Available Tools

The server provides the following tools, designed to be called in sequential order:

1. `open_weather_forecast_israel`  
   Opens the browser and navigates to the main Israeli weather forecast homepage.

2. `enter_weather_forecast_city_israel(city_name: str)`  
   Types the requested city name (in Hebrew) into the site's search field.

3. `select_weather_forecast_city_israel`  
   Selects the first suggestion from the autocomplete dropdown list and navigates to the corresponding forecast page.

4. `get_weather_forecast_content_israel`  
   Extracts text content from the forecast page, cleans whitespace and empty lines, and returns up to 3,000 characters to the LLM.

---

## ๐Ÿ’ฌ Example Queries

Here are examples of questions you can ask the Agent:
* "What is the weather forecast in Jerusalem today?"
* "Is it going to rain in Tel Aviv?"
* "What is the temperature in Haifa right now?"
* "ืžื” ื”ืชื—ื–ื™ืช ื‘ื‘ื ื™ ื‘ืจืง ืœื”ื™ื•ื?"

---

## ๐Ÿ“ฆ Prerequisites and Installation

### Prerequisites
* Python 3.10 or higher
* `uv` package manager (recommended)

### Installing Dependencies
Install the required packages and Playwright browser binaries:

```bash
uv pip install mcp playwright
uv run playwright install chromium

๐Ÿ’ป Running the Server
Run the server directly using uv:


uv run weather_Israel.py
Configuration in Host Client (e.g., Claude Desktop / MCP Client)
{
  "mcpServers": {
    "weather-israel": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp",
        "--with",
        "playwright",
        "path/to/weather_Israel.py"
      ]
    }
  }
}

๐Ÿ“ System Architecture

User Query ("What's the weather in Bnei Brak?")
       โ”‚
       โ–ผ
  LLM / Host
       โ”‚
       โ”œโ”€โ–บ 1. open_weather_forecast_israel()
       โ”œโ”€โ–บ 2. enter_weather_forecast_city_israel(city_name="ื‘ื ื™ ื‘ืจืง")
       โ”œโ”€โ–บ 3. select_weather_forecast_city_israel()
       โ””โ”€โ–บ 4. get_weather_forecast_content_israel()
       โ”‚
       โ–ผ
  LLM Processes Context & Answers User

TDQS

A4.2/5.0

Scored across 4 tools

Disambiguation4/5

Each tool is a distinct step in a sequential flowโ€”open, enter, select, getโ€”and the step numbers in descriptions make boundaries clear. The two city-related tools (enter and select) are slightly similar in name but their action verbs and descriptions differentiate them well.

Naming Consistency4/5

All tools follow a snake_case verb-first pattern and share a weather_forecast_israel domain prefix. Minor inconsistencies exist: open_weather_forecast_israel omits 'city,' and get_weather_forecast_content_israel uses 'content' instead of 'city,' but the pattern remains predictable.

Tool Count5/5

Four tools map directly to the four required browser-automation steps, and none feel redundant. This is a well-scoped size for a simple weather lookup workflow.

Completeness4/5

The tool set covers the full flow from opening the weather site to extracting the city forecast text, so agents can complete a basic lookup. It lacks structured forecast data or alternate input formats, but these are not core to the described workflow.

Maintenance

ActivityStale
ResponsivenessNo issues