Skip to main content
Glama
Rivka55

Weather Israel MCP Server

by Rivka55

MCP עם Playwright — תחזית מזג אוויר לישראל

פרויקט זה מממש שרת MCP (Model Context Protocol) שמאפשר למודל שפה לגשת לנתוני מזג אוויר עדכניים בישראל באמצעות אוטומציית דפדפן עם Playwright, במקום API סטנדרטי.

בנוסף קיים שרת MCP מקביל לארה״ב (NWS API), והמארח (host.py) מחבר את שני השרתים לסוכן שיחה אחד שיודע לנתב שאילתות בהתאם למדינה.


תיאור הפרויקט

בניגוד לשימוש ב־API קבוע, השרת הישראלי:

  1. פותח דפדפן Chromium (גלוי לעין)

  2. מנווט לאתר Weather2Day

  3. מחפש עיר, בוחר תוצאה מהרשימה

  4. מחלץ את תוכן הדף כטקסט נקי

  5. מעביר את הטקסט למודל השפה כקונטקסט (RAG דינמי)

קבצים עיקריים

קובץ

תפקיד

weather_Israel.py

שרת FastMCP בשם WeatherIsrael + 4 כלי Playwright

weather_USA.py

שרת FastMCP לתחזיות/התראות ארה״ב דרך NWS

client.py

לקוח MCP גנרי (stdio)

host.py

ממשק הצ׳אט שמחבר LLM לכלי ה־MCP

pyproject.toml

תלויות הפרויקט לניהול עם uv

.env

הגדרות ספק ה־LLM (Ollama / Gemini)

כלי השרת הישראלי (4 Tools)

  1. open_weather_forecast_israel — פתיחת דפדפן וניווט לדף התחזית

  2. enter_weather_forecast_city_israel(city_name) — הקלדת שם העיר בתיבת החיפוש

  3. select_weather_forecast_city_israel — בחירת התוצאה הראשונה מה־dropdown

  4. extract_weather_data_israel — חילוץ טקסט נקי מהדף עבור המודל


Related MCP server: Israel Weather MCP Agent

דרישות מקדימות

  • Python 3.13+

  • uv

  • Ollama מותקן ורץ מקומית

  • מודל שתומך ב־tool calling (למשל llama3.2)


התקנה והרצה מקומית עם Ollama ו־uv

1. סנכרון תלויות

uv sync

2. התקנת דפדפן Chromium ל־Playwright

uv run playwright install chromium

3. התקנת מודל ב־Ollama

ollama pull llama3.2

ודאו ש־Ollama רץ (בדרך כלל על http://127.0.0.1:11434).

4. הגדרת קובץ .env

העתיקו את הקובץ לדוגמה:

copy .env.example .env

ערכו את .env כך:

LLM_PROVIDER=ollama
OLLAMA_MODEL=llama3.2
OLLAMA_HOST=http://127.0.0.1:11434

אופציונלי: אפשר גם LLM_PROVIDER=gemini עם מפתח חינמי מ־Google AI Studio.

5. הרצת המארח (Host)

uv run host.py

לאחר ההרצה יופיע ממשק צ׳אט בטרמינל. הקלידו שאלה בעברית או באנגלית, או quit ליציאה.


דוגמה להרצה מוצלחת

שאלה:

What is the weather in Jerusalem?

או בעברית:

מה מזג האוויר בירושלים?

מה שקורה מאחורי הקלעים:

המודל מזהה שמדובר בעיר בישראל ומפעיל את ארבעת הכלים בסדר:

[Calling tool weather_Israel__open_weather_forecast_israel with args {}]
[Calling tool weather_Israel__enter_weather_forecast_city_israel with args {'city_name': 'ירושלים'}]
[Calling tool weather_Israel__select_weather_forecast_city_israel with args {}]
[Calling tool weather_Israel__extract_weather_data_israel with args {}]

תוצאה לדוגמה (מתוך חילוץ חי מהאתר):

Selected city forecast page: https://www.weather2day.co.il/jerusalem

מזג אוויר ירושלים
24.5°
רוח: 13.3 קמ"ש (צפון מערבי)
לחות: 46%
תחזית לשבוע הקרוב: טמפרטורות מקסימום סביב 32–36°

הדפדפן נפתח באופן גלוי (headless=False) כך שניתן לצפות באוטומציה בזמן אמת, והמודל מסכם את הטקסט שחולץ לתשובה קריאה למשתמש.


מבנה הזרימה

משתמש → host.py (Ollama/Gemini)
            ├─ weather_USA.py   (API של NWS)
            └─ weather_Israel.py (Playwright → weather2day.co.il)

המארח אוסף את כל הכלים משני השרתים, מציג אותם למודל, ומנתב קריאות כלים חזרה לשרת הנכון.


שאלת בונוס

שאלה: איזו ספרייה "ישנה" קיבלה דחיפה מחודשת בעידן ה־AI?

תשובה: ספריות כמו BeautifulSoup ו־Scrapy.

בעבר הן שימשו בעיקר לסקראפינג קלאסי של אתרים. בעידן ה־AI הן קיבלו חיים חדשים כחלק מצינורות RAG וסוכנים: לפני שמזינים מסמכי אינטרנט למודל שפה, צריך לחלץ טקסט נקי מ־HTML. BeautifulSoup מאפשרת לפרסר דפים ולנקות רעש (תפריטים, סקריפטים, פרסומות), ו־Scrapy מאפשרת לזחול ולאסוף תוכן בקנה מידה גדול. כך ספריות "ותיקות" הפכו לרכיב מרכזי באיסוף קונטקסט איכותי עבור LLMs — לצד כלים חדשים יותר כמו Playwright, שמתאימים במיוחד לאתרים דינמיים (כמו בפרויקט זה).


הערות טכניות

  • השרת הישראלי שומר מצב גלובלי של Playwright (playwright_context, browser, page) כדי שהדפדפן יישאר פתוח בין קריאות כלים עוקבות.

  • חיפוש ערים באתר Weather2Day עובד בעיקר בעברית; הפרויקט ממיר שמות ערים נפוצים באנגלית (למשל Jerusalemירושלים).

  • להרצות בדיקה אוטומטיות אפשר להגדיר WEATHER_ISRAEL_HEADLESS=1.


רישיון / הגשה

הפרויקט הוגש כחלק ממטלת MCP עם Playwright לתחזית מזג אוויר בישראל.

Available Tools

4 tools
enter_weather_forecast_city_israelC

Type a city name into the weather2day search box.

Args: city_name: City name to search for (Hebrew or English), e.g. ירושלים or Jerusalem.

ParametersJSON Schema
NameRequiredDescriptionDefault
city_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits, such as side effects or state changes. It only describes input format (Hebrew/English) but does not explain what happens after entering the city name (e.g., whether it triggers a search, modifies state, or returns data).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with two sentences and a clear args list. It avoids unnecessary detail, though the first sentence could be merged with the args explanation. Overall, it is well-structured and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has one parameter and an output schema (not described), the description omits what the tool returns or how it fits with siblings. It lacks context about the tool's role in the weather forecast workflow (e.g., input step before opening or selecting).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no description for 'city_name' (0% coverage). The description adds useful semantics: 'City name to search for (Hebrew or English), e.g. ירושלים or Jerusalem.' This clarifies supported languages and provides concrete examples, compensating well for the lack of schema documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description says 'Type a city name into the weather2day search box,' which implies the tool inputs a city name for weather forecast, but it does not explicitly state the tool's function. The purpose is inferred from the name and action, but lacking direct clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus its siblings (e.g., select_weather_forecast_city_israel, open_weather_forecast_israel). The description does not mention alternatives or context for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_weather_data_israelA

Extract clean inner text from the current Israel weather page for LLM context.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must convey behavioral traits. It mentions 'current page' but does not explain if it navigates, modifies state, or requires prior actions. The output schema likely clarifies return format, but behavior is only partially described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads key information. Every word adds value with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and an output schema, the description is minimal. It lacks context about prerequisites (e.g., whether the page must already be loaded) and does not explain how it relates to sibling tools. Adequate but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so schema coverage is 100%. The description adds no parameter info, but none is needed. Baseline is 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb 'extract', the resource 'clean inner text from the current Israel weather page', and the purpose 'for LLM context'. It clearly differentiates from sibling tools that deal with navigating or selecting forecast cities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus siblings like open_weather_forecast_israel or select_weather_forecast_city_israel. It does not mention any prerequisites or when extraction is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

open_weather_forecast_israelA

Launch a persistent Chromium browser and open the Israel weather forecast page.

Opens https://www.weather2day.co.il/forecast in a visible (non-headless) browser so subsequent Israel weather tools can reuse the same session.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that the browser is visible (non-headless) and persistent for session reuse. No annotations, but description covers key behavioral aspects. Does not mention any potential side effects, but launch action is non-destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short paragraphs with clear front-loading of purpose. Could be slightly more concise, but no wasted sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given tool has no parameters and output schema likely describes return, description is complete. It covers the essential context: persistent session for reuse.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters; schema covers 100% of zero params. Description adds value by specifying the exact URL and browser mode, going beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it launches a persistent Chromium browser and opens a specific URL for Israel weather forecast. It distinguishes from sibling tools by indicating this is the setup step for subsequent tools to reuse the session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states to use before subsequent Israel weather tools. While no explicit when-not or alternatives, the context of sibling tools (enter, select, extract) implies this is the prerequisite opener.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

select_weather_forecast_city_israelA

Click the first city suggestion in the dropdown and wait for the forecast page.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description mentions a UI click and wait, but lacks details on prerequisites (e.g., dropdown visibility) or failure handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, directly on point, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With zero parameters and an output schema, the description is complete for this simple UI step; it tells the agent exactly what to do without needing further elaboration.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist; the description fully explains the tool's action, leaving no ambiguity about what it does.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it clicks the first city suggestion and waits for the forecast page, distinguishing it from sibling tools like enter (typing) and extract (data extraction).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use after entering a city and before extracting data, but does not explicitly state when to use or not use it, nor mention alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.8/5.0
Disambiguation5/5

Each tool has a distinct purpose in a sequential workflow: open browser, enter city, select suggestion, extract data. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow the verb_..._israel pattern with snake_case, maintaining a consistent style across the set.

Tool Count5/5

4 tools is appropriate for the simple workflow of opening a browser, searching for a city, selecting, and extracting data. Not over- or under-scoped.

Completeness4/5

Covers the primary workflow well, but lacks a tool to close the browser or handle errors, which is a minor gap for real-world use.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rivka55/Weather-MCP-with-Playwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server