Skip to main content
Glama
Weather MCP Server

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 を使用しています。セットアップ手順は以下の通りです:

  1. リポジトリをクローンする

  2. 依存関係をインストールする(uvを使用して実行すると仮想環境が作成されます):

    uv sync

使用方法

MCPサーバーは標準入出力(stdio)を介して手動で実行できます。これはMCPクライアントがサーバーと対話する方法です:

uv run weather.py

Claude 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

Available Tools

2 tools
get_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

    B3.4/5.0

    Scored across 2 tools

    Disambiguation5/5

    get_alerts and get_forecast have clearly distinct purposes: one for weather alerts by state, the other for forecast by coordinates. No overlap exists.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun pattern (get_alerts, get_forecast), making them predictable.

    Tool Count3/5

    With only 2 tools, the server feels thin for a weather domain, bordering on insufficient scope.

    Completeness2/5

    Common weather operations like current conditions, hourly forecast, or radar are missing, leaving significant gaps for typical use cases.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers