天気MCPサーバー
米国国立気象局(NWS)APIを使用して、米国各地の気象情報と警報を提供するモデルコンテキストプロトコル(MCP)サーバーです。このサーバーは、モデルコンテキストプロトコルを介してAIエージェントが使用できるように設計されています。
特徴
米国のどの州の天気警報も受信できるツール
座標を使用して米国の任意の場所の詳細な天気予報を取得するためのツール
気温、風の状況、短い予報の説明をサポート
国立気象局からのリアルタイムデータ
前提条件
Node.js (v16 以上)
npm または yarn パッケージマネージャー
インストール
リポジトリをクローンします。
依存関係をインストールします:
アプリケーションをビルドします。
MCPツール
サーバーは、AI エージェントが使用できる 2 つの MCP ツールを提供します。
アラートを取得する
特定の米国の州の天気警報を取得します。
パラメータ:
state
: 2文字の州コード(例:CA、NY)
応答例:
予測を取得する
座標を使用して特定の場所の天気予報を取得します。
パラメータ:
latitude
: 場所の緯度 (-90 ~ 90)longitude
: 場所の経度 (-180 ~ 180)
応答例:
プロジェクト構造
技術的な詳細
TypeScriptで構築
モデルコンテキストプロトコル(MCP)サーバーを実装します
MCP サーバーの実装には @modelcontextprotocol/sdk を使用します
国立気象局 (NWS) API とのインターフェース
Node16モジュール解決によるES2022ターゲット
発達
サーバーを変更または拡張するには:
src/index.ts
ファイルに変更を加えるアプリケーションを再構築します。
依存関係
@modelcontextprotocol/sdk: MCP サーバー実装フレームワーク
zod: ツールパラメータのランタイム型チェックと検証
TypeScript: 型安全性のための開発依存性
ライセンス
ISC
注記
このサーバーは国立気象サービスAPIを使用しているため、米国の場所でのみ機能します。
APIリクエストはレート制限があり、User-Agentヘッダーが必要です。
すべての座標は10進度形式で入力する必要があります
これはスタンドアロンのCLIアプリケーションではなく、モデルコンテキストプロトコルを通じてAIエージェントにツールを提供するサーバーです。
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.
National Weather Service API を使用して米国の各地の気象警報や詳細な予報を取得するためのツールを AI エージェントに提供するモデル コンテキスト プロトコル サーバー。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides tools to fetch weather alerts for US states and forecasts based on latitude/longitude coordinates using the US National Weather Service API.Last updated -2821MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that provides real-time weather information and 5-day forecasts to AI assistants, supporting multiple languages and flexible units.Last updated -33
- -securityFlicense-qualityA Model Context Protocol server that enables AI models to fetch weather alerts and detailed forecasts for US locations using the National Weather Service API.Last updated -82
- AsecurityAlicenseAqualityA Model Context Protocol server that provides comprehensive weather data and forecasts through the OpenWeatherMap API, enabling AI assistants to access real-time weather information, forecasts, air quality data, and location services.Last updated -1137MIT License