Skip to main content
Glama
israel-weather-mcp

israel-weather-mcp

by YL4279

Israel Weather MCP

プロジェクト概要

このプロジェクトは、イスラエルの都市の天気予報を取得するための専用 MCP サーバーを実装しています。

外部 API に基づく実装とは異なり、このプロジェクトでは Playwright を使用して取得を行います。Playwright はブラウザー上での人間のユーザーの操作をシミュレートします。具体的には、天気予報サイトを開き、都市名を入力し、ドロップダウンリストから都市を選択し、結果ページから予報データを取得します。

このプロジェクトの目的は、MCP とブラウザー自動化ツールを用いることで LLM の能力を拡張する方法を示すことです。モデルは質問に答えられるだけでなく、情報収集のために実際のアクションを実行することもできます。


Related MCP server: mcp-playwright-weather-israel

学習目的

  • 独立した MCP サーバーの実装

  • LLM が使用するためのツールの公開

  • Playwright を使用したブラウザーの自動化

  • Web サイトから情報を取得し、クリーンなテキスト形式で返す


使用技術

  • Python

  • MCP SDK

  • Playwright

  • ローカル Google Chrome


プロジェクト構成

project-template/

├── client.py

├── host.py

├── weather_USA.py

├── weather_Israel.py

└── README.md


実行方法

依存関係のインストール:

uv sync

プロジェクトの実行:

uv run host.py


ローカル Chrome の設定

このプロジェクトはローカルの Chrome ブラウザーを使用します。

weather_Israel.py ファイルには、実行ファイルへのパスを設定します:

LOCAL_CHROME = r"C:\Program Files\Google\Chrome\Application\chrome.exe"

Chrome が別のパスにインストールされている場合は、それに応じて更新してください。


実装したツール

open_weather_forecast_israel

天気予報サイトを開きます。

enter_weather_forecast_city_israel

検索フィールドに都市名を入力します。

select_weather_forecast_city_israel

オートコンプリートのリストから都市を選択します。

get_weather_forecast_israel

一連の操作全体を実行し、ページからデータを抽出して、LLM が使用できるクリーンな予報を返します。


クエリの例

エルサレムの天気はどうですか?

ハイファの予報どうですか?

テルアビブの天気はどうですか?


出力例

項目

値

都市

エルサレム

気温

11.8°

最終更新

19:10

湿度

71%

風速

15.8 km/h


まとめ

このプロジェクトでは、MCP と Playwright を利用して、LLM が実際の Web サイトとやり取りし、リアルタイムで情報を収集し、ユーザーに対して的を絞った関連性の高い解答を返すことを実現する方法を実証しています。

Available Tools

4 tools
enter_weather_forecast_city_israelC

מזין עיר בתיבת החיפוש.

Inputs: city (required). Returns: result

get_weather_forecast_israelC

מבצע את כל הזרימה ומחזיר תחזית נקייה.

Inputs: city. Returns: result

open_weather_forecast_israelC

פותח את אתר התחזית.

Inputs: no named parameters. Returns: result

select_weather_forecast_city_israelC

בוחר את העיר מהרשימה הנפתחת.

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

    C2.8/5.0

    Scored across 4 tools

    Disambiguation3/5

    The composite get_weather_forecast_israel performs the entire flow, making the three granular browser-step tools (open, enter, select) redundant and raising 'when to use which' confusion. Descriptions clarify each step's action, but the boundaries between the composite and its sub-steps overlap significantly.

    Naming Consistency5/5

    All four tools follow a consistent snake_case verb_noun pattern with the same weather_forecast..._israel stem. The naming is fully predictable and easy to parse.

    Tool Count3/5

    Four tools is a reasonable raw count, but three are subsumed by the single composite tool, so effectively only one tool earns its place. The set is borderline redundant rather than well-scoped.

    Completeness4/5

    The core task—retrieving a clean weather forecast for an Israeli city—is covered by get_weather_forecast_israel. For this narrow domain there are no obvious missing lifecycle operations, though multi-city or forecast-detail coverage is not evident.

    Related MCP Connectors

    Related MCP Servers