weather-mcp-playwright
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@weather-mcp-playwright what's the weather in Tel Aviv?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π¦οΈ Weather MCP β Israel via Browser Automation, USA via API
An MCP (Model Context Protocol) project demonstrating two ways to extend an LLM's context with live weather data:
weather_USA.pyβ a "classic" MCP server: fetches forecasts and alerts from the US National Weather Service API (api.weather.gov).weather_Israel.pyβ an MCP server that puts the LLM's hand on the mouse π±οΈ: it launches a real Chromium browser with Playwright, navigates to weather2day.co.il, types a city name into the search box, picks it from the autocomplete list β and extracts the page content so the LLM can answer the question itself (RAG).
π§© Project Structure
βββ client.py # Generic MCP client β connects to any MCP server over stdio
βββ host.py # Terminal chat: connects Gemini to all MCP servers
βββ weather_USA.py # MCP server for US forecasts (API)
βββ weather_Israel.py # MCP server for Israeli forecasts (Playwright)
βββ test_israel_flow.py # Smoke test for the full Israeli flowThe Israeli Server's Tools
Tool | What it does |
| Opens a browser and navigates to the forecast page |
| Types a city name into the search field (and reports the suggestions) |
| Selects the first item in the autocomplete list |
| Extracts the forecast page content and feeds it to the LLM |
Related MCP server: Israel Weather MCP
π Setup & Run
Prerequisites: Python 3.11+, uv.
# 1. Install dependencies
uv sync
# 2. Install Chromium for Playwright
uv run playwright install chromium
# 3. Gemini API key (free, no credit card) β https://aistudio.google.com/apikey
copy .env.example .env # then edit: GEMINI_API_KEY=...
# 4. Run the chat
uv run host.pyQuick check of the Israeli server without an LLM:
uv run test_israel_flow.py㪠Example Questions
ΧΧ ΧΧͺΧΧΧΧͺ ΧΧΧΧΧ ΧΧͺΧ ΧΧΧΧ?(What's today's forecast in Tel Aviv?)ΧΧΧΧ ΧΧ§ΧΧͺ ΧΧΧ¨ΧΧ ΧΧΧ¨ ΧΧΧ¨ΧΧ©ΧΧΧ?(Should I take an umbrella tomorrow in Jerusalem?)ΧΧ ΧΧΧ ΧΧΧΧΧΧ¨ ΧΧΧΧ€Χ ΧΧ‘ΧΧ£ ΧΧ©ΧΧΧ’?(What's the weather in Haifa this weekend?)What's the forecast in Chicago?(routed to the US server)Are there weather alerts in California?
While the question is being processed you'll see the browser open, type the city name, and select it from the list β then the model answers based on the page content.
βοΈ How It Works
The Host (
host.py) launches each MCP server as a child process and opens a stdio session with it (via the generic Client inclient.py).The Host discovers each server's tools and attaches them to every LLM (Gemini) call.
When the model detects a question about weather in Israel, it invokes the four tools one after another: open browser β type city β select from list β extract content.
The page content comes back to the model as a tool result, and it composes an answer from it β RAG over a live web page.
π Connecting to Other Hosts (e.g. ChatBox)
The MCP servers are host-agnostic. Connect one to any MCP-capable app with a command like:
uv --directory C:\path\to\project run weather_Israel.pyAvailable Tools
4 toolsenter_weather_forecast_city_israelB
Type a city name into the search field on the forecast page.
Args: city: City name in Hebrew (e.g. 'ΧͺΧ ΧΧΧΧ', 'ΧΧ¨ΧΧ©ΧΧΧ', 'ΧΧΧ€Χ')
Inputs: city (required). Returns: result
get_weather_forecast_content_israelA
Extract the forecast content from the currently open city forecast page, so it can be used to answer the user's weather question directly.
Inputs: no named parameters. Returns: result
open_weather_forecast_israelA
Open a browser and navigate to the Israeli weather forecast site (weather2day.co.il). This must be called first, before entering or selecting a city.
Inputs: no named parameters. Returns: result
select_weather_forecast_city_israelA
Select the first city in the autocomplete suggestions list and load its forecast page.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool handles a distinct, sequential step: open site, enter city, select suggestion, extract content. No overlap or ambiguity between them.
All names follow a predictable action_weather_forecast_..._israel pattern with snake_case. The pattern is consistent and readable.
4 tools perfectly cover the browser-based workflow for this narrow purpose. Not too sparse, not bloated.
The tool set forms a complete, linear workflow from opening the site to extracting forecast content. No obvious gaps for the stated domain.
Maintenance
Related MCP Connectors
An MCP server for weather information by @kulybaba
An MCP server for weather information by @kulybaba
MCP server for weather with reasoning β umbrella advice, outdoor checks, city comparisons.
Hosted MCP server for Xweather weather data: conditions, forecasts, alerts, and more.
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that uses Playwright to scrape Israeli weather forecasts from weather2day.co.il by automating a real browser, enabling an LLM to answer questions about current conditions and hourly forecasts for Israeli cities.5-
- FlicenseNot gradedqualityDmaintenanceMCP server that provides Israeli weather forecasts using browser automation with Playwright.-
- FlicenseNot gradedqualityDmaintenanceMCP server that enables users to get real-time weather forecasts for Israeli cities by automating a browser with Playwright and using Gemini to answer natural language queries.-
- FlicenseBqualityDmaintenanceAn MCP server that provides weather forecasts and alerts for the USA and Israel, using the National Weather Service API and Playwright-based browser automation.2-