Weather MCP Server
天気 MCP サーバー
National Weather Service (NWS) APIを使用して米国の気象情報を提供するModel Context Protocol (MCP) サーバーです。FastMCPで構築されています。
機能
このサーバーは、AIアシスタントがリアルタイムの気象データを取得できるようにするためのツールを公開しています:
get_alerts(state: str): 指定された米国の州(CA、NY、TXなどの2文字の州コードを使用)のアクティブな気象警報を取得します。イベントの詳細、深刻度、説明、安全上の指示を返します。get_forecast(latitude: float, longitude: float): 特定の場所(緯度と経度を使用)の詳細な天気予報を取得します。次の5期間(例:今日の午後、今夜、明日など)の予報を返します。
Related MCP server: weather-mcp
前提条件
Python 3.10以上
uvパッケージマネージャー
インストールとセットアップ
このプロジェクトは依存関係管理に uv を使用しています。セットアップ手順は以下の通りです:
リポジトリをクローンする
依存関係をインストールする(uvを使用して実行すると仮想環境が作成されます):
uv sync
使用方法
MCPサーバーは標準入出力(stdio)を介して手動で実行できます。これはMCPクライアントがサーバーと対話する方法です:
uv run weather.pyClaude Desktopとの統合
このサーバーをClaude Desktopで使用するには、claude_desktop_config.jsonに追加します:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"path/to/your/mcp-server",
"run",
"weather.py"
]
}
}
}カスタムMCPクライアントとの統合
カスタムPython MCPクライアントがある場合は、次のように接続できます:
from mcp import StdioServerParameters
server_params = StdioServerParameters(
command="uv",
args=["--directory", "path/to/mcp-server", "run", "weather.py"],
env=None
)
# Pass server_params to your MCP client使用しているAPI
National Weather Service API (APIキーは不要)
Available Tools
2 toolsget_alertsA
Get weather alerts for a US state.
Args: state: Two-letter US state code (e.g. CA, NY)
Inputs: state (required). Returns: result
get_forecastC
Get weather forecast for a location.
Args: latitude: Latitude of the location longitude: Longitude of the location
Inputs: latitude (required), longitude (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
get_alerts and get_forecast have clearly distinct purposes: one for weather alerts by state, the other for forecast by coordinates. No overlap exists.
Both tools follow a consistent verb_noun pattern (get_alerts, get_forecast), making them predictable.
With only 2 tools, the server feels thin for a weather domain, bordering on insufficient scope.
Common weather operations like current conditions, hourly forecast, or radar are missing, leaving significant gaps for typical use cases.
Maintenance
Related MCP Connectors
Get US weather forecasts, active and recent alerts, and current observations.
US NWS weather alerts and 5-day forecasts for AI agents. $0.01 per call.
Provide real-time and forecast weather information for locations in the United States using natura…
Official NWS forecasts and alerts, as one MCP tool through Apify
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.2ISC
- AlicenseNot gradedqualityDmaintenanceProvides US weather alerts and forecasts via the National Weather Service API.79 npmGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.GPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides weather alerts and forecasts for US locations using the National Weather Service API.79 npmGPL 3.0