Weather Playwright
БесплатноНе проверенAn MCP server that fetches US weather forecasts via API and Israel weather forecasts by automating a browser with Playwright to scrape a weather website.
Описание
An MCP server that fetches US weather forecasts via API and Israel weather forecasts by automating a browser with Playwright to scrape a weather website.
README
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 flow
The Israeli Server's Tools
| Tool | What it does |
|---|---|
open_weather_forecast_israel |
Opens a browser and navigates to the forecast page |
enter_weather_forecast_city_israel |
Types a city name into the search field (and reports the suggestions) |
select_weather_forecast_city_israel |
Selects the first item in the autocomplete list |
get_weather_forecast_content_israel |
Extracts the forecast page content and feeds it to the LLM |
🚀 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.py
Quick 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.py
Установить Weather Playwright в Claude Desktop, Claude Code, Cursor
unyly install weather-mcp-playwrightСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add weather-mcp-playwright -- uvx weather-mcpFAQ
Weather Playwright MCP бесплатный?
Да, Weather Playwright MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Weather Playwright?
Нет, Weather Playwright работает без API-ключей и переменных окружения.
Weather Playwright — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Weather Playwright в Claude Desktop, Claude Code или Cursor?
Открой Weather Playwright на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Playwright
Browser automation, scraping, screenshots
автор: MicrosoftPuppeteer
Browser automation and web scraping.
автор: modelcontextprotocolopentabs-dev/opentabs
Plugin-based MCP server + Chrome extension that gives AI agents access to web applications through the user's authenticated browser session. 100+ plugins with a
автор: opentabs-devrobhunter/agentdeals
1,500+ developer infrastructure deals, free tiers, and startup programs across 54 categories. Search deals, compare vendors, plan stacks, and track pricing chan
автор: robhunterCompare Weather Playwright with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории browse
