Skip to main content
Glama

Weather Query MCP Server

by eternachen

天気クエリMCPサーバー/クライアントの例

このプロジェクトは、MCP (モデル クライアント プロトコル) サーバーと対話して、指定された都市の天気情報を取得して表示する天気クエリ クライアントです。

特徴

  • MCP サーバーに接続して、利用可能なツールを一覧表示します。
  • 指定された都市の天気情報を照会します。
  • 温度、湿度、風速、天気の説明など、フォーマットされた天気情報を表示します。

要件

  • Python 3.8以上
  • openaiライブラリ
  • dotenvライブラリ
  • mcpライブラリ

設定

  1. リポジトリをクローンします。
    git clone <repository_url> cd <repository_directory>
  2. 仮想環境を作成してアクティブ化します。
    python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
  3. 必要な依存関係をインストールします。
    pip install -r requirements.txt
  4. ルート ディレクトリに.envファイルを作成し、OpenAI API キーとその他の構成を追加します。
    OPENAI_API_KEY=<your_openai_api_key> BASE_URL=<your_base_url> MODEL=<your_model>

使用法

  1. MCP サーバーを起動します。
    python server.py
  2. クライアントを実行してサーバーに接続します。
    python client.py <path_to_server_script>
  3. クライアントと対話する:
    • 天気情報を取得するには、英語で都市名を入力します。
    • クライアントを終了するには、 quit入力します。

プロジェクト構造

  • server.py : MCP サーバーの実装と天気クエリ ツールが含まれています。
  • client.py : サーバーと対話するための MCP クライアント実装が含まれています。
  • .env : API キーと構成の環境変数。
  • .gitignore : git によって無視されるファイルとディレクトリを指定します。
  • README.md : プロジェクトのドキュメント。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています。

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

指定された都市の天気情報(気温、湿度、風速、天気の説明など)を取得して表示できるようにする MCP サーバー実装。

  1. 特徴
    1. 要件
      1. 設定
        1. 使用法
          1. プロジェクト構造
            1. ライセンス

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                An MCP server that provides real-time weather information including temperature, humidity, wind speed, and sunrise/sunset times through the OpenWeatherMap API.
                Last updated -
                1
                Python
                MIT License
                • Linux
                • Apple
              • -
                security
                F
                license
                -
                quality
                A simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.
                Last updated -
                JavaScript
              • -
                security
                A
                license
                -
                quality
                An MCP server that connects to OpenWeatherMap's API to provide current weather data and multi-day forecasts for locations worldwide in different measurement units.
                Last updated -
                12
                TypeScript
                MIT License
              • A
                security
                F
                license
                A
                quality
                MCP server that provides Korean weather information using grid coordinates and the Korea Meteorological Administration API, allowing users to query current weather conditions and forecasts for specific locations in Korea.
                Last updated -
                2
                3
                Python
                • Apple
                • Linux

              View all related MCP servers

              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/eternachen/mcp-playground'

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