mcp-weather
🌤️ Kaushik's Weather MCP Server
TypeScript で構築された本番環境対応の Model Context Protocol (MCP) サーバーで、LLM(Claude Desktop、Cursor、カスタム AI エージェントなど)をリアルタイムの National Weather Service (NWS / NOAA) 気象データに接続します。
🔗 統合のライブ実証
🚀 Claude Desktop での動作確認済み: リアルタイムの予報取得、アラート、ヘルス診断を実演するライブチャットセッションをご覧ください:
👉 ライブ Claude AI チャットの実証を見る
Related MCP server: mcp-weather
✨ アーキテクチャのハイライト
🏗️ モジュール式クリーンアーキテクチャ: 専用サービス層(
CacheService、RateLimiterService、NwsClient、Logger、Formatter)に分離。📡 公式気象速報: 標準化されたメタデータとプロバイダー帰属を備えた構造化気象レポート。
⚡ インメモリキャッシュ(5分 TTL): スレッドセーフなインメモリキャッシュにより、上流 API トラフィックを最大 80% 削減。
🛡️ Zero-Vibe セキュリティ層: 厳格な入力サニタイズ、XSS エンティティエスケープ、クライアント分離型レート制限(100 リクエスト/分)。
🔁 耐障害性とフォールトトレランス: HTTP
5xx/429エラーに対する自動指数バックオフ再試行とリクエストタイムアウトガード。🩺 可観測性と診断: 構造化 JSON ロギングを備えた組み込みの
health_check、get_metrics、clear_cacheツール。
📁 プロジェクト構造
weather/
├── src/
│ ├── config/ # Central configuration & runtime constants
│ ├── services/ # Core business logic (Cache, RateLimiter, NwsClient, Formatter, Logger)
│ ├── tools/ # MCP Tool handlers (alerts, forecast, diagnostics)
│ ├── types/ # Strongly typed TypeScript interfaces
│ ├── utils/ # Input sanitization and security helpers
│ └── index.ts # Server bootstrap, transport initialization & graceful shutdown
├── tests/
│ ├── unit/ # Unit test suites (utils, sanitizer, cache)
│ ├── integration/ # Upstream NWS API integration & retry tests
│ ├── performance/ # Cache throughput & rate-limiting load tests
│ ├── security/ # XSS, injection prevention & boundary tests
│ └── basic.test.ts # Comprehensive test runner
├── build/ # Compiled ES module JavaScript distribution
├── package.json
└── tsconfig.json🛠️ MCP ツール
ツール | パラメータ | 説明 |
|
| 米国座標のリアルタイム期間予報(気温、風、天候)を取得します。 |
|
| 発令中の悪天候アラート、警報、気象注意報を取得します。 |
| なし | ランタイムの健全性、稼働時間、ヒープメモリ使用量、キャッシュサイズ、API 接続ステータスを返します。 |
| なし | パフォーマンス診断とアクティブなレート制限クライアントバケットを出力します。 |
| なし | インメモリキャッシュをフラッシュし、削除されたエントリ数を返します。 |
🚀 はじめに
1. クローンとインストール
git clone https://github.com/Kaushik2105/mcp-weather.git
cd mcp-weather
npm install2. ビルド
npm run build3. テストスイートの実行
npm test🔌 Claude Desktop への接続
この設定を Claude Desktop の設定ファイルに追加します:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"kaushik-weather": {
"command": "node",
"args": [
"c:/Workholic/LawSikho/POCs/weather/weather/build/index.js"
]
}
}
}注: 設定を保存したら Claude Desktop を再起動してください。
💬 Claude 向けサンプルプロンプト
"ロサンゼルス(緯度: 34.0522、経度: -118.2437)の Kaushik の天気ツールによる公式予報速報を表示してください"
"フロリダ州(FL)に発令中の気象アラートはありますか?"
"Kaushik の天気 MCP サーバーでヘルスチェック診断を実行してください。"
👨💻 作者
Kaushik Karmakar
GitHub: @Kaushik2105
ライブ統合の実証: Claude AI Chat
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Get US weather forecasts, active and recent alerts, and current observations.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides real-time US weather alerts and forecasts by integrating with the National Weather Service API. It enables AI assistants to fetch state-specific alerts and detailed local forecasts using geographic coordinates.21-
- FlicenseNot gradedqualityDmaintenanceProvides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.-
- FlicenseNot gradedqualityDmaintenanceProvides real-time weather alerts and forecasts for US locations by integrating with the National Weather Service API. Supports both server and client interactions with optional LLM summarization.-
- AlicenseNot gradedqualityDmaintenanceProvides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.ISC