Skip to main content
Glama
mcp-weather

mcp-weather

by Kaushik2105

🌤️ Kaushik's Weather MCP Server

TypeScript Model Context Protocol Node.js Tests Claude Verified License: ISC

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 ツール

ツール

パラメータ

説明

get_forecast

latitude (number), longitude (number)

米国座標のリアルタイム期間予報(気温、風、天候)を取得します。

get_alerts

state (米国 2 文字コード、例: CA、NY、TX)

発令中の悪天候アラート、警報、気象注意報を取得します。

health_check

なし

ランタイムの健全性、稼働時間、ヒープメモリ使用量、キャッシュサイズ、API 接続ステータスを返します。

get_metrics

なし

パフォーマンス診断とアクティブなレート制限クライアントバケットを出力します。

clear_cache

なし

インメモリキャッシュをフラッシュし、削除されたエントリ数を返します。


🚀 はじめに

1. クローンとインストール

git clone https://github.com/Kaushik2105/mcp-weather.git
cd mcp-weather
npm install

2. ビルド

npm run build

3. テストスイートの実行

npm test

🔌 Claude Desktop への接続

この設定を Claude Desktop の設定ファイルに追加します:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/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

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      Provides 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.
      2
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time weather alerts and forecasts from the National Weather Service for US locations, integrating with AI assistants via the Model Control Protocol.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides 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.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides weather forecasts and alerts for US locations via the National Weather Service API, enabling AI assistants to deliver real-time weather information.
      ISC