Skip to main content
Glama

MCP 天気サーバー

npmバージョン ライセンス ノードバージョン 問題 週次ダウンロード数

AccuWeather API を使用して時間ごとおよび毎日の天気予報を提供するモデル コンテキスト プロトコル (MCP) サーバー。


クイックスタート

AccuWeather API キーが必要です (無料レベルあり)。
ここでサインアップしてアプリを作成し、キーを取得してください。

API キーを環境変数としてエクスポートします。

export ACCUWEATHER_API_KEY=your_api_key_here

次に、次のコマンドで MCP Weather サーバーを直接実行します。

npx -y @timlukahorstmann/mcp-weather

または、スーパーゲートウェイ経由の HTTP/REST アクセスの場合:

npx -y supergateway --stdio "npx -y @timlukahorstmann/mcp-weather" \
  --port 4004 \
  --baseUrl http://127.0.0.1:4004 \
  --ssePath /messages \
  --messagePath /message \
  --cors "*" \
  --env ACCUWEATHER_API_KEY="$ACCUWEATHER_API_KEY"

Related MCP server: Weather MCP Server

MCP サーバー設定例

Claude Desktop またはその他の MCP 互換クライアントと統合するには、これを構成に追加します (例: claude_desktop_config.json )。

{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["-y", "@timlukahorstmann/mcp-weather"],
      "env": {
        "ACCUWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

概要

このMCPサーバーは、Claudeのような大規模言語モデルがリアルタイムの気象データにアクセスすることを可能にします。LLMと統合することで、モデルは以下のことが可能になります。

  • 正確で最新の天気予報を取得します

  • 今後12時間の1時間ごとの天気データを提供する

  • 最大15日間の毎日の天気予報にアクセス

  • データをメートル法(°C)とヤードポンド法(°F)の両方で表示します

  • 気温、天候、降水量情報、その他の天気の詳細を表示します

前提条件

  • Node.js ≥18

  • AccuWeather API キー ( .envまたはシェル経由で設定)

設定

  1. このリポジトリをクローンします:

    git clone https://github.com/TimLukaHorstmann/mcp-weather.git
    cd mcp-weather
  2. 依存関係をインストールします:

    npm install
  3. AccuWeather API キーを取得します。

    • AccuWeather APIに登録する

    • 新しいアプリを作成し、APIキーを取得する

  4. API キーを使用して.envファイルを作成します。

    ACCUWEATHER_API_KEY=your_api_key_here
  5. プロジェクトをビルドします。

    npm run build

Claude Desktopでの使用

  1. この MCP サーバーを使用するように Claude Desktop を構成します。

    • クロードデスクトップを開く

    • 設定 > 開発者 > 設定の編集に移動します

    • claude_desktop_config.jsonに以下を追加します。

    {
      "mcpServers": {
        "weather": {
          "command": "npx",
          "args": ["-y", "@timlukahorstmann/mcp-weather"],
          "env": {
            "ACCUWEATHER_API_KEY": "your_api_key_here"
          }
        }
      }
    }
  2. Claudeデスクトップを再起動します

  3. 新しい会話で、プラグアイコンをクリックして「天気」を選択し、MCPサーバーを有効にします。

  4. 次のような天気予報をクロードに尋ねることができるようになりました。

    • 「ニューヨーク市の1時間ごとの天気予報はどうですか?」

    • 「ロンドンの5日間の天気予報をください。」

    • 「今週の東京の天気は華氏でどうなりますか?」

    • 「明日サンフランシスコは雨が降りますか?」

利用可能なツール

1時間ごとの天気予報

  • ツール名: weather-get_hourly

  • 今後12時間の1時間ごとの予報を提供します

  • パラメータ:

    • sessionId (必須): セッションの一意の識別子

    • location (必須): 市または場所の名前

    • units (オプション): 「メートル法」(摂氏、デフォルト)または「帝国法」(華氏)

毎日の天気予報

  • ツール名: weather-get_daily

  • 最大15日間の毎日の予報を提供します

  • パラメータ:

    • sessionId (必須): セッションの一意の識別子

    • location (必須): 市または場所の名前

    • days (オプション):予測日数(1、5、10、または15。デフォルトは5)

    • units (オプション): 「メートル法」(摂氏、デフォルト)または「帝国法」(華氏)

発達

  • 開発依存関係をインストール: npm install

  • コードをLintする: npm run lint

  • ビルド: npm run build

  • テストを実行: npm test

  • 開発モードで起動: npm run dev

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

将来の機能強化

MCP Weather Server は常に改善に取り組んでいます。今後のリリースで検討している機能は以下のとおりです。

  • 拡張時間別予報: 12 時間を超える、たとえば 24 時間または 48 時間。

  • 気象警報: AccuWeather の悪天候警報 API との統合。

  • **場所のオートコンプリート:**オートコンプリートの提案による場所の検索が改善されました。

  • **過去の気象データ:**過去の気象状況にアクセスできます。

他の機能についてのアイデアがある場合は、お気軽に問題を報告してください。

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

Available Tools

2 tools
weather-get_dailyA

Get daily weather forecast for up to 15 days

Inputs: location (required), days, units.

weather-get_hourlyA

Get hourly weather forecast for the next 12 hours

Inputs: location (required), units.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: one provides daily forecasts for up to 15 days, while the other provides hourly forecasts for the next 12 hours. There is no overlap in functionality, and an agent can easily differentiate between them based on the time granularity and forecast duration.

    Naming Consistency5/5

    Both tools follow a consistent naming pattern with a prefix 'weather-' followed by a verb_noun structure (get_daily, get_hourly). This pattern is predictable and enhances readability, making it easy for agents to understand the tool's purpose at a glance.

    Tool Count2/5

    With only 2 tools, the server feels under-scoped for a weather domain. While the tools cover forecast retrieval, there are obvious gaps such as current weather conditions, historical data, or location-based searches, making the set too thin for comprehensive weather-related tasks.

    Completeness2/5

    The tool surface is severely incomplete for a weather server. It lacks essential operations like getting current weather, searching locations, or accessing historical data, which are core to weather applications. Agents will face dead ends when trying to perform basic weather queries beyond forecasts.

    Related MCP Connectors

    Related MCP Servers