Skip to main content
Glama
Efrat-Fr

Weather-MCP

by Efrat-Fr

šŸŒ¤ļø — Israel Weather Forecast

A learning project in MCP (Model Context Protocol) development: an LLM-based agent that can fetch weather forecasts for cities in Israel and the US, and answer in free language in the terminal chat.


šŸŽÆ Project Goal

Build a dedicated MCP server that "teaches" the LLM to perform a task it can't do on its own — fetch a weather forecast from an Israeli site that has no API.

The agent does this in two ways:

  1. Israel server (weather-Israel) — automates a real browser with Playwright: opens weather2day.co.il/forecast, searches for a city, selects it, and then extracts the forecast page content and feeds it to the LLM to answer on its own (RAG approach).

  2. US server (weather-USA) — fetches forecast and alerts via the official NWS (National Weather Service) API.

The Host connects all servers to the LLM (Gemini, via the OpenAI-compatible API), automatically collects all the Tools from them, and runs a chat loop where the LLM chooses which tool to use and activates them one by one until an answer is received.


Related MCP server: Israeli Weather MCP

šŸ—ļø Project Structure

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

Israel Server Tools

#

Tool

Role

1

open_weather_forecast_israel

Opens a Chromium browser and navigates to the forecast site

2

enter_weather_forecast_city_israel

Types a city name in the search field

3

select_weather_forecast_city_israel

Selects the first city from the suggestions list

4

get_weather_forecast_content_israel

Extracts the forecast page content (including iframes) and returns it to the LLM

šŸ’” The first three share the same browser via a global state (_page), because they all run in the same server process. The fourth iterates over all frames in the page, because the forecast itself loads inside an <iframe> that the main body doesn't see.


āš™ļø Installation and Running

Prerequisites

  • Python ≄ 3.13

  • uv (environment and dependency manager)

  • Gemini API key (get a free key)

Steps

# 1. ×”×Ŗ×§× ×Ŗ ×”×Ŗ×œ×•×™×•×Ŗ ×•×”×§×ž×Ŗ הביבת העבודה
uv sync

# 2. ×”×Ŗ×§× ×Ŗ דפדפן Chromium עבור Playwright
uv run playwright install chromium

Setting Environment Variables

Create a .env file in the project directory:

GEMINI_API_KEY=your_api_key_here
GEMINI_MODEL=gemini-2.0-flash

Running

uv run host.py

After launching, a Query: prompt will appear — type a question (or quit to exit).


šŸ’¬ Example Questions the Agent Can Answer

Israel Forecast (Playwright)

A browser window opens showing the forecast page, and the LLM also answers in the chat.

  • "What's the forecast in Tel Aviv?"

  • "How many degrees are expected tomorrow in Jerusalem?"

  • "How's the weather in Haifa today?"

  • "Open the forecast for Be'er Sheva for me"

US Forecast and Alerts (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"


🧩 How It Works (Flowchart)

×ž×©×Ŗ×ž×© → "מה ×”×Ŗ×—×–×™×Ŗ ×‘×Ŗ×œ אביב?"
   │
   ā–¼
 Host  ──►  LLM (Gemini) בוחר Tools להפעיל
   │
   ā–¼  (שרת ×™×©×Ø××œ, בזה אחר זה)
 open → enter("תל אביב") → select → get_content
   │
   ā–¼
 ×Ŗ×•×›×Ÿ ×”×Ŗ×—×–×™×Ŗ חוזר ל-LLM (RAG)
   │
   ā–¼
 LLM כותב תשובה בשפה חופשית בצ'אט ✨

šŸ“ Notes

  • The LLM is the one that decides which Tools to run and in what order — we didn't write hard-coded logic.

  • Two server files = two separate processes, so any shared state (like the open browser) must live inside only one server.

Available Tools

4 tools
enter_weather_forecast_city_israelB

Type a city name into the search field on the Israeli forecast page.

Args: city: The name of the city to search for (in Hebrew)

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It transparently describes the action as typing into a search field, which is useful, but it does not say whether the field is cleared first, whether suggestions are expected to appear, or whether any submission occurs. There is no contradiction with annotations.

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 short and front-loaded, with a clear action sentence followed by an Args block. Every sentence contributes useful information with no filler.

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?

The tool is low-complexity and has an output schema, so return value details are not needed. However, with no annotations and a UI-automation context, the description omits prerequisite page state and the surrounding workflow with sibling tools, leaving some ambiguity for an agent navigating the full flow.

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?

Schema description coverage is 0%, but the description fully documents the only parameter and adds the important constraint that the city name must be in Hebrew. This meaningfully supplements the bare schema definition.

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

Purpose4/5

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

The description states a concrete action ('Type a city name into the search field') and names the target resource ('the Israeli forecast page'). It makes the tool's role reasonably clear, though it does not explicitly distinguish it from the sibling select_weather_forecast_city_israel.

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 about when this tool should be used relative to open_weather_forecast_israel, select_weather_forecast_city_israel, or get_weather_forecast_content_israel. The likely workflow is only implied by the sibling names.

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

get_weather_forecast_content_israelA

Extract the weather forecast text from the currently open forecast page.

Returns the cleaned textual content so the LLM can answer the user directly.

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 are provided, so the description carries the burden. It discloses that the tool extracts and cleans text and returns it for direct answering, which is useful. However, it does not specify failure behavior (e.g., what happens if no forecast page is open) or what 'cleaned' means concretely, leaving some behavioral uncertainty.

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?

Two short sentences, no filler. The core purpose is front-loaded, and the second sentence explains why the output matters to the agent. Every word earns its place.

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

Completeness4/5

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

For a zero-parameter extraction tool with an output schema, the description is largely complete: it states the source, the output type, and the intended use. It could be slightly stronger by explicitly advising that it should follow open_weather_forecast_israel or similar navigation tools, but 'currently open forecast page' conveys this adequately.

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 tool has zero parameters and the schema is fully complete with an empty properties object. The description correctly relies on page state rather than parameters, and no additional parameter explanation is needed. The baseline of 4 for zero-parameter tools applies.

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?

Description states a specific verb (Extract) and resource (weather forecast text from the currently open forecast page), and clarifies the output is cleaned textual content for direct LLM answering. This clearly separates it from sibling tools that open or select forecast pages, since it operates on the already-open page.

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?

The phrase 'currently open forecast page' establishes the key precondition: this tool should be used after a forecast page has been opened, not before. It does not explicitly name alternatives or exclusion conditions, but the context of opening/selecting pages among siblings makes the intended usage inferable.

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

Open a browser and navigate to the Israeli weather forecast website.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It does disclose that the tool launches a browser and navigates to a website, which is the core behavior. However, it does not mention side effects like whether an existing browser session is reused, whether the page loads before returning, or what happens on navigation failure.

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, clear sentence with no redundant words. The action and target are front-loaded and immediately understandable.

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

Completeness4/5

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

For a zero-argument browser-navigation tool, the description is largely complete: it identifies the action and target. The exact URL is not specified, but the 'Israeli weather forecast website' is enough of a target, and an output schema is present so return-value details are not required. Minor lack of contextual guidance about when to call it is already captured in usage_guidelines.

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 input schema has zero parameters, so there is no parameter semantics burden on the description. The baseline of 4 applies because there is nothing for the description to clarify about arguments.

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

Purpose4/5

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

The description clearly states the action ('Open a browser and navigate') and the resource ('Israeli weather forecast website'), making the tool's purpose obvious. It does not explicitly distinguish itself from sibling tools, but the naming and 'open browser' action imply a distinct initial navigation step.

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?

The description gives no guidance on when to use this tool versus the siblings like enter_weather_forecast_city_israel or get_weather_forecast_content_israel. There is no mention of prerequisites, ordering, or contexts where this tool is the appropriate choice.

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_israelB

Select the first city from the autocomplete suggestion list.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It only states the immediate action and does not explain what selecting the city does, whether it mutates state, or how it connects to the forecast workflow. The phrase 'autocomplete suggestion list' adds some context, but the effects and sequencing remain undisclosed.

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, front-loaded sentence with no redundancy or filler. Every word contributes to the meaning, and it is appropriately sized for a simple zero-argument selection action.

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?

The tool is simple: no parameters and an output schema exists, so return-value documentation is not needed. However, the description lacks workflow context and behavioral detail, such as when this tool should be invoked relative to its siblings. This makes it minimally viable but incomplete for an agent that must reason about the overall weather-forecast interaction sequence.

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 tool has zero parameters, and the schema description coverage is 100%. Per the baseline for zero-parameter tools, the description does not need to add parameter-level meaning, and it does not need to compensate for any schema gaps.

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

Purpose4/5

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

The description states a specific verb ('Select') and a specific resource ('the first city from the autocomplete suggestion list'). This clearly differentiates the tool from siblings like `enter_weather_forecast_city_israel` and `get_weather_forecast_content_israel`. It does not explicitly frame the action within the larger forecast flow, so it stops short of a 5.

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 implicitly tells the agent when to act: when an autocomplete suggestion list is presented and the first city should be chosen. However, it gives no explicit guidance about prerequisites, such as needing to call `enter_weather_forecast_city_israel` first, nor does it name alternatives or when not to use this tool.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedenter_weather_forecast_city_israel
    • First observedget_weather_forecast_content_israel
    • First observedopen_weather_forecast_israel
    • First observedselect_weather_forecast_city_israel

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation4/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo issues

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

  • F
    license
    Not graded
    quality
    C
    maintenance
    MCP server that lets users obtain current Israeli city weather forecasts. It uses Playwright to browse Weather2day, extract the forecast page, and feed the cleaned data back to the LLM for natural language responses.
    -
  • F
    license
    A
    quality
    C
    maintenance
    An MCP server that provides real-time weather data for Israel by automating browser searches via Playwright. It allows LLMs to get current forecasts for Israeli cities through natural language queries.
    4
    -
  • F
    license
    B
    quality
    C
    maintenance
    MCP server that enables LLMs to retrieve weather forecasts for Israeli cities by automating a browser with Playwright, and also provides US weather alerts and forecasts via NWS API.
    4
    -