Skip to main content
Glama
yael3222664-alt

Weather Israel MCP Server

🌀️ Weather Israel β€” Agentic MCP Server with Browser Automation

An AI-powered weather assistant that autonomously controls a browser to fetch real-time Israeli weather forecasts using the Model Context Protocol (MCP) and Playwright.

Python MCP Playwright Gemini


πŸ“Œ Overview

This project implements a custom MCP (Model Context Protocol) Server that gives an LLM autonomous browser control capabilities. Instead of relying on a traditional weather API, the system opens a real browser, navigates to an Israeli weather website, searches for a city, and extracts the live forecast β€” just like a human would.

The LLM (Gemini 2.5 Flash) acts as the orchestrating agent, deciding which tools to invoke and in what sequence, creating a fully autonomous agentic pipeline.

Why is this interesting?

  • No API needed β€” scrapes data directly from the web using browser automation

  • Agentic architecture β€” the LLM decides which tools to call and when

  • MCP standard β€” uses Anthropic's open protocol for tool communication

  • RAG pattern β€” extracts page content and feeds it back to the LLM for reasoning


Related MCP server: Israel Weather MCP

🎯 Project Goals

  • Implement a custom MCP Server from scratch

  • Use Playwright to add browser automation capabilities to an LLM

  • Demonstrate agentic tool-calling with multi-step orchestration

  • Build a complete RAG pipeline β€” retrieve data β†’ augment context β†’ generate response


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         User Query                               β”‚
β”‚              "What's the weather in Tel Aviv?"                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    host.py (Orchestrator)                         β”‚
β”‚              Gemini 2.5 Flash + Tool Calling                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚ MCP Protocol
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               weather_Israel.py (MCP Server)                     β”‚
β”‚                                                                  β”‚
β”‚   Tool 1: open_weather_forecast_israel()                         β”‚
β”‚   Tool 2: enter_weather_forecast_city_israel(city)               β”‚
β”‚   Tool 3: select_weather_forecast_city_israel()                  β”‚
β”‚   Tool 4: get_weather_page_content()                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚ Playwright
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              weather2day.co.il (Live Website)                     β”‚
β”‚         Real-time weather data scraped from browser               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Technology

Purpose

Python 3.13+

Core language

MCP SDK

Model Context Protocol β€” exposes tools to the LLM

Playwright

Headless browser automation (Chromium)

Gemini 2.5 Flash

LLM for reasoning and tool orchestration

httpx

HTTP client for Gemini REST API calls

uv

Modern Python package manager


πŸ“ Project Structure

MCP/
β”œβ”€β”€ weather_Israel.py     # MCP Server β€” Israeli weather tools (Playwright)
β”œβ”€β”€ weather_USA.py        # MCP Server β€” US weather tools (API-based)
β”œβ”€β”€ host.py               # Orchestrator β€” Gemini + MCP client integration
β”œβ”€β”€ client.py             # Generic MCP client connector
β”œβ”€β”€ pyproject.toml        # Dependencies and project metadata
β”œβ”€β”€ .env.example          # Environment variable template
β”œβ”€β”€ .gitignore            # Git ignore rules
β”œβ”€β”€ uv.lock               # Locked dependencies
└── README.md             # This file

πŸ”§ MCP Tools β€” weather_Israel.py

#

Tool

Description

1

open_weather_forecast_israel()

Launches Chromium and navigates to the weather website

2

enter_weather_forecast_city_israel(city)

Types the city name into the search field using keyboard simulation

3

select_weather_forecast_city_israel()

Clicks the first autocomplete result from the dropdown

4

get_weather_page_content()

Extracts and cleans the visible text from the forecast page


⚑ Prerequisites

  • Python 3.13 or higher

  • uv package manager (pip install uv)

  • Gemini API Key from Google AI Studio


πŸ“¦ Installation

1. Clone the repository

git clone https://github.com/yael3222664-alt/MCP.git
cd MCP

2. Install dependencies

uv sync

3. Install Chromium for Playwright

uv run playwright install chromium

4. Configure environment variables

Create a .env file in the project root:

GEMINI_API_KEY=your_gemini_api_key_here

Get your free API key at Google AI Studio


πŸš€ Running the Application

python -m uv run host.py

You'll see:

MCP Client Started!
Type your queries or 'quit' to exit.

Query: 

πŸ’¬ Example Queries & Output

Query:

ΧžΧ” ΧžΧ–Χ’ האוויר Χ‘Χ‘Χ Χ™ Χ‘Χ¨Χ§?

Agent Actions:

[Calling tool weather_Israel__open_weather_forecast_israel with args {}]
[Calling tool weather_Israel__enter_weather_forecast_city_israel with args {'city': 'Χ‘Χ Χ™ Χ‘Χ¨Χ§'}]
[Calling tool weather_Israel__select_weather_forecast_city_israel with args {}]
[Calling tool weather_Israel__get_weather_page_content with args {}]

Response:

The current temperature in Bnei Brak is 30Β°C with wind speed of 15 km/h 
and gusts up to 37 km/h from the west. Humidity is at 52%.

Hourly forecast for today:
β€’ 14:00 β€” 30Β°C, humidity 52%, wind 15 km/h
β€’ 15:00 β€” 30Β°C, humidity 52%, wind 15 km/h
β€’ 16:00 β€” 29Β°C, humidity 54%, wind 14 km/h
...

More examples:

What's the weather in Jerusalem?
ΧžΧ” Χ”ΧͺΧ—Χ–Χ™Χͺ ΧœΧ—Χ™Χ€Χ”?
How's the weather in Tel Aviv today?
What are the weather alerts in California?  (uses USA tools)

οΏ½ How It Works β€” Step by Step

  1. User asks a question β†’ "What's the weather in Tel Aviv?"

  2. Gemini analyzes the query and identifies the required tools

  3. Tool 1 β†’ Playwright opens a headless Chromium browser and navigates to the weather site

  4. Tool 2 β†’ Playwright types the city name into the search field (character by character to trigger autocomplete)

  5. Tool 3 β†’ Playwright clicks the first matching result in the dropdown

  6. Tool 4 β†’ Playwright extracts all visible text from the forecast page

  7. Gemini receives the raw page content and formulates a clean, structured answer

  8. User gets a natural language response with temperature, wind, humidity, and hourly forecast


🧠 Key Design Decisions

  • Keyboard simulation (keyboard.type()) instead of fill() β€” triggers the website's JavaScript autocomplete

  • Direct REST API calls to Gemini with httpx(verify=False) β€” bypasses SSL issues in restricted network environments

  • Global browser state β€” shared between tool calls so the same page instance persists across the multi-step workflow

  • Graceful error handling β€” each tool validates state and returns clear error messages


πŸ› Troubleshooting

Issue

Solution

uv: command not found

Use python -m uv instead of uv

GEMINI_API_KEY not found

Create .env file with your API key

429 Too Many Requests

Rate limit β€” wait 1 minute or use a different API key

Browser doesn't open

Run uv run playwright install chromium

SSL errors

The code already disables SSL verification for restricted networks


πŸ“š Resources


πŸ“„ License

This project is open source and available for educational purposes.


Built with Playwright 🎭 and the Model Context Protocol πŸ€–

Available Tools

4 tools
enter_weather_forecast_city_israelB

Enters a city name into the search input field on the weather forecast page.

Args: city: The name of the city to search for

Returns: A message indicating success or failure

ParametersJSON Schema
NameRequiredDescriptionDefault
cityYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, and the description only mentions 'enters a city name' and a generic success/failure return message. It fails to disclose whether previous input is cleared, if the action triggers a search, or any side effects on the page state.

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 short and includes structured Args/Returns sections, making it easy to parse. However, it could be slightly more concise by removing redundant phrasing.

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 simple action with one parameter, the description covers the basic purpose and return value. The presence of an output schema (though not detailed) reduces the need to explain return structure. However, it lacks mention of any prerequisites or page state.

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

Parameters3/5

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

Schema description coverage is 0%, and the description adds a brief explanation for the 'city' parameter ('The name of the city to search for'), but this is essentially a restatement of the schema field title. No additional constraints, formats, or examples are provided.

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 the action ('enters a city name') and the target ('search input field on the weather forecast page'), distinguishing it from siblings like 'select_weather_forecast_city_israel' which likely involves selection rather than text entry.

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 provides no guidance on when to use this tool versus siblings such as 'select_weather_forecast_city_israel' or 'open_weather_forecast_israel', leaving the agent to infer context.

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

get_weather_page_contentA

Extracts the weather forecast data from the currently loaded page.

Returns: The weather forecast text content from the page, or an error message

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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

No annotations provided, so description must carry full burden. It fails to disclose prerequisites (e.g., page must be loaded), error conditions, or return format details beyond 'text content' or 'error message'.

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, front-loaded sentences with no filler. Every word adds value.

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 simple tool with no parameters and an output schema, the description is largely adequate. However, it omits details about the output format and error semantics, which would improve completeness.

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?

With zero parameters, schema coverage is trivially 100%. The description adds no parameter information, but none is needed. Baseline of 4 is appropriate.

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 the verb 'extracts' and the resource 'weather forecast data from the currently loaded page', effectively distinguishing it from sibling tools which focus on navigation and city selection.

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?

No explicit guidance on when to use this tool versus siblings. While the context implies it should be used after navigation tools like open_weather_forecast_israel, the description does not state prerequisites or exclusions.

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

Opens a Chromium browser and navigates to the Israeli weather forecast website.

Returns: A message indicating success or failure

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?

Discloses that it opens a Chromium browser and navigates to a website, indicating it is a browser automation step. Returns success/failure message. Lacks details on side effects (e.g., new window, blocking behavior) or what happens on failure. Minimal but adequate.

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?

Extremely concise: two sentences covering action and return value. No extraneous information, front-loaded with the key action.

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 simple tool with no parameters, the description is complete enough for its role. It explains what it does and what it returns. However, it could specify the exact URL or that the output is a simple status message, not page content.

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 exist (0 params), so baseline score is 4. Description does not need to add parameter meaning beyond schema.

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 (opens a Chromium browser) and the target (Israeli weather forecast website). It distinguishes from sibling tools which handle city-specific actions and content retrieval. However, it could be more specific about exact URL or website name.

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 on when to use this tool versus alternatives. Does not mention prerequisites, context, or when to use sibling tools like 'enter_weather_forecast_city_israel' or 'get_weather_page_content'.

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_israelC

Clicks/selects the first item in the dropdown list of cities.

Returns: A message indicating success or failure

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

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

No annotations provided, so description must disclose all behavioral traits. It simply states 'clicks/selects' and returns success/failure, but lacks details on side effects (e.g., page changes, error states if dropdown empty). Minimal transparency for a UI interaction.

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?

Description is concise with two sentences covering action and return. No unnecessary words. Could benefit from a more structured format, but efficiency is good.

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?

With an output schema existing, the description need not explain return values. However, it omits error conditions, prerequisites (e.g., dropdown must be visible), and how it interacts with sibling tools. Adequate but not comprehensive for a UI automation tool.

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

Parameters3/5

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

Input schema has no properties, so schema coverage is 100%. Baseline 3 applies. The description adds no parameter info because none exist; it correctly describes the tool's action without needing param details.

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 identifies the action (clicks/selects) and the target (first item in dropdown list of cities). It distinguishes from siblings like 'enter_weather_forecast_city_israel' which likely types input. However, it could be more explicit about the tool's role in the workflow.

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 on when to use this tool versus alternatives. It does not mention prerequisites or when selection is appropriate, leaving the agent to infer usage context.

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. Dates show when Glama detected each change.

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

TDQS

B3.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool performs a distinct step in the weather forecast workflow: opening the site, entering a city, selecting from a dropdown, and extracting the content. No two tools have overlapping purposes.

Naming Consistency3/5

Most tools follow a 'verb_weather_forecast_city_israel' pattern, but 'get_weather_page_content' deviates by omitting 'israel' and using 'page_content' instead of 'forecast', causing inconsistency.

Tool Count4/5

Four tools is a reasonable number for a focused weather query server, covering the essential steps without unnecessary complexity.

Completeness3/5

The tools cover the basic flow of opening the page, searching, selecting, and retrieving content, but lack support for error recovery, multiple cities, or closing the browser, leaving minor gaps.

Maintenance

ActivityStale
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

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/yael3222664-alt/MCP'

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