weather-chat-mcp
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-chat-mcp 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 Israel MCP Server (Playwright)
The MCP that puts the LLM's hand on the mouse.
Weather forecasts Made in Israel โ not through a boring API, but the Israeli way: open a browser, poke your nose into the site, type, click... and get a forecast.
๐ฏ What is this project?
In the classic Weather MCP example, the LLM pulls weather data through a US API. Nice, but... who really cares about a forecast somewhere in the USA when you need the current temperature in Tel Aviv or Jerusalem?
This project builds an Israeli MCP Server that gives the LLM a completely human ability: to control a real browser. Instead of calling an API, the Agent:
Opens a real Chromium browser (in headless=False mode, so you can watch it live!).
Types a city name into the search field of weather2day.co.il.
Picks the city from the autocomplete dropdown dynamically.
Scrapes the page content, cleans it, and feeds it back to the LLM so it can answer on its own (Retrieval-Augmented Generation / RAG).
The big idea: Everything a human user does with two hands โ the LLM learns to do with four Tools.
Related MCP server: Israeli Weather MCP Agent
๐ง What you'll learn
Build your own MCP Server for any purpose or targeted website.
Expose Python functions as Tools for an LLM using the FastMCP decorator.
Use Playwright to give an LLM physical control over a browser (mouse & keyboard simulation).
Build RAG (Retrieval-Augmented Generation): Stream live, freshly-scraped page content directly into the model's context.
Sync & Stability: Handle dynamic web element loading and prevent flakiness in browser automation.
๐ Project Structure
project-template/ โโโ weather_Israel.py # MCP Server โ Israel forecast via Playwright โโโ host.py # Terminal chat โ connects the LLM to the MCP server โโโ client.py # Generic MCP Client (stdio communication) โโโ pyproject.toml # Project dependencies and metadata (uv) โโโ .env # Environment variables (OpenAI API key)
๐ ๏ธ Technologies Used
Python 3.13+
FastMCP (MCP SDK) - Anthropic's official framework for building Model Context Protocol servers easily.
Playwright (Python Async API) - Advanced browser automation and control library.
OpenAI API - The brain of the Agent (powered by gpt-4o-mini), deciding which tools to call and interpreting the results.
๐งฉ The Four Tools of the Israeli MCP
The manual steps a human performs on the website are broken down into 4 modular tools that the LLM calls sequentially:
Tool | What it does | Human equivalent |
open_weather_forecast_israel | Launches Chromium in non-headless mode and navigates to the forecast site. | Open a browser and go to the site. |
enter_weather_forecast_city_israel(city) | Finds the search field, clears it, and types the city name char-by-char to trigger autocomplete. | Click the search bar and type the city name. |
select_weather_forecast_city_israel | Detects the dropdown list, clicks the first auto-complete suggestion, and waits for the city page to load. | Click on the correct city from the suggestions. |
get_forecast_content_israel | Scrapes the loaded page, cleans up redundant spaces and empty lines, and feeds it back to the LLM. | Read the forecast details on the screen. |
Why not just search Google?
Running a Google search through automated browsers quickly triggers CAPTCHA challenges. By guiding the Agent through a direct, targeted flow on a specific website, we bypass bot detection completely and guarantee a seamless run.
๐ก๏ธ Loop Protection (ืื ืื ืื ืื ืืขืช ืืืืืืช)
During development, we identified that LLMs can sometimes get stuck in an infinite loop, calling the same tool repeatedly (such as trying to open the browser over and over).
To prevent this, we implemented a strict Loop Protection Mechanism inside host.py:
The host keeps track of all executed tools within the current turn.
If the LLM tries to invoke the same tool more than once per turn, the call is blocked and a system message is returned: "This action has already been completed in this turn. Please proceed to the next step."
This forces the LLM to progress linearly: Open โ Type โ Select โ Scrape.
๐ Setup & Run (ืฉืื ืืืจ ืฉืื)
This project is managed using uv for ultra-fast dependency management.
Install dependencies and set up the environment: Command: uv sync
Install the Chromium browser for Playwright: Command: uv run playwright install chromium
Configure your API key: Create a .env file in the project root and add your OpenAI API key: OPENAI_API_KEY=your_actual_api_key_here (The .env file is already listed in .gitignore to ensure your secret key is never pushed to public repositories).
Start the Chat Agent: Command: uv run host.py
Type your query in the terminal, press Enter, and watch the browser open and perform the actions on its own! To exit, simply type "quit".
๐ฌ Example Questions to Try
The Agent will analyze your request and trigger the correct sequence of tools automatically. Try asking:
"ืื ืืื ืืืืืืจ ืืืจืืฉืืื ืืืื?" (What's the weather in Jerusalem today?)
"Check the temperature in Tel Aviv for the upcoming days"
"ืืื ืฆืคืื ืืจืืช ืืฉื ืืืืคื ืืืจ? ืื ืืืืื ืืืืืช?"
๐ญ A Closing Thought
Playwright was born long before the GenAI era โ originally designed as a testing automation tool for developers. But with the rise of AI Agents, it has taken center stage. Suddenly, giving an LLM "hands and a mouse" to interact with the real web has become the ultimate way to bridge the gap between static knowledge and real-world actions.
Available Tools
4 toolsenter_weather_forecast_city_israelA
ืืืื ืฉื ืขืืจ ืืฉืื ืืืืคืืฉ ืฉืืืฃ ืืื ืืืืืจ. ืืฉ ืืงืจืื ืืคืื ืงืฆืื open_weather_forecast_israel ืืคื ื ืฉืืืืฉ ืืคืื ืงืฆืื ืื.
Args: city: ืฉื ืืขืืจ ืืืืคืืฉ (ืืืืืื: 'ืชื ืืืื', 'ืืจืืฉืืื')
Inputs: city (required). Returns: result
get_forecast_content_israelA
ืืืืฆืช ืืช ืชืืื ืืชืืืืช ืืืืฃ ืืืขืื ืืืืจ ืืืืจืช ืขืืจ. ืืฉ ืืงืจืื ืืคืื ืงืฆืื ืื ืจืง ืืืืจ ืืืืจืช ืืขืืจ ื-select_weather_forecast_city_israel.
Inputs: no named parameters. Returns: result
open_weather_forecast_israelA
ืคืืชื ืืคืืคื Chromium ืืื ืืื ืืืชืจ ืืื ืืืืืจ ืืืฉืจืืื. ืืฉ ืืงืจืื ืืคืื ืงืฆืื ืื ืจืืฉืื ื ืืคื ื ืื ืคืขืืื ืืืจืช.
Inputs: no named parameters. Returns: result
select_weather_forecast_city_israelA
ืืืืจืช ืืช ืืคืจืื ืืจืืฉืื ืืจืฉืืืช ืืขืจืื ืฉืืืคืืขื ืืืืจ ืืืงืืื. ืืฉ ืืงืจืื ืชืืืื ื-enter_weather_forecast_city_israel.
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 has a clearly distinct role in a sequential workflow: open browser, enter city, select from list, extract forecast. No overlap in purpose.
Names follow a consistent pattern of verb_noun_location (e.g., open_weather_forecast_israel), though they are quite verbose. Slight inconsistency in 'enter_weather_forecast_city_israel' vs 'select_weather_forecast_city_israel' but still readable.
Four tools is well-scoped for a focused weather forecast retrieval task. No unnecessary bloat.
Covers the essential steps to retrieve a forecast from a specific Israeli weather site. Missing generic options like city validation or error recovery, but sufficient for the intended workflow.
Maintenance
Related MCP Connectors
Playwright browser automation โ navigate, click, fill forms, extract, screenshot โ 17 agent tools.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Current weather and forecast lookup as an agent tool.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to iโฆ
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides LLMs with real-time weather forecasts for Israeli cities using browser automation with Playwright to scrape live data from a weather website.-
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to retrieve Israeli weather forecasts by controlling a browser via Playwright and scraping data from an Israeli weather website.-
- FlicenseAqualityDmaintenanceEnables querying weather forecasts for Israeli cities by automating browser with Playwright, extracting data from Weather2Day website, and feeding it to an LLM for natural language responses.4-
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to fetch real-time, localized weather forecasts for Israeli cities by using Playwright to autonomously navigate and scrape weather2day.co.il, including handling Hebrew queries and stateful web interactions.-