Skip to main content
Glama
cwa-mcp-server

cwa-mcp-server

by gary2376

cwa-mcp-server

MCP server that wraps the Central Weather Administration (CWA) open data API, allowing agents to query weather forecasts, earthquake reports, weather warnings, and typhoon alerts, and generate evacuation advisories.

Features

  • Tool get_weather_forcast(county) — 36-hour weather forecast for a county/city

  • Tool get_earthquake_report(limit) — The most recent N noticeable earthquake reports

  • Tool get_weather_warning(county) — Currently active weather warnings for a county/city (heavy rain, strong winds, etc.)

  • Tool get_typhoon_warning(limit) — The most recent N typhoon alerts

  • Resource cwa://counties — List of valid county/city names

  • Prompt evacuation_advisory(county) — Prompt template that generates an evacuation plan based on real-time weather/warning/earthquake/typhoon data

Related MCP server: mcp-cwa

Get an API Key

  1. Register an account on the Meteorological Data Open Platform (email + password is enough, no approval needed)

  2. After logging in, click "API Authorization Code" → "Get Authorization Code" to generate your key immediately

Installation (General Users)

Already published to PyPI; no need to clone this repo. In the MCP configuration of Claude Desktop / Claude Code, just specify uvx to run, and it will automatically fetch the package:

{
  "mcpServers": {
    "cwa-weather": {
      "command": "uvx",
      "args": ["cwa-mcp-server"],
      "env": { "CWA_API_KEY": "你申請到的授權碼" }
    }
  }
}

Or use the Claude Code CLI:

claude mcp add cwa-weather -e CWA_API_KEY=你申請到的授權碼 -- uvx cwa-mcp-server

Development (Modifying This Repo's Source Code)

git clone https://github.com/gary2376/cwa-mcp-server
cd cwa-mcp-server
uv sync
cp .env.example .env   # 填入 CWA_API_KEY

uv run python tests/test_client.py   # 最小自我檢查(不打真網路)
uv run mcp dev src/cwa_mcp/server.py # 本地用 inspector 手動測試 tools

Status

All four tools (weather forecast, earthquake report, weather warning, typhoon warning) have been validated against the live API with a real key, and have also been connected to Claude Code for real conversation-flow testing, correctly determining risk levels and providing specific recommendations. Published to PyPI and the MCP Server Registry.

Known pitfall fixed: The wheel originally uploaded in v0.1.0 was an empty shell package because uv_build defaults to guessing the module name from project.name (which becomes cwa_mcp_server), and that didn't match the actual source directory src/cwa_mcp/. This caused uvx cwa-mcp-server to fail with ModuleNotFoundError. This has been fixed by adding [tool.uv.build-backend] module-name = "cwa_mcp" to pyproject.toml and rebuilding to verify the wheel contents are correct.

License

MIT

Available Tools

4 tools
get_earthquake_reportA

查詢最近 N 筆顯著有感地震報告(時間、地點、規模、深度)。

Inputs: limit. Returns: result

get_typhoon_warningA

查詢最近 N 筆颱風警報(命名、路徑強度描述、大雨/強風特報段落)。

Inputs: limit. Returns: result

get_weather_forecastA

查詢指定縣市未來 36 小時天氣預報(天氣現象、降雨機率、氣溫等)。

county 必須是 cwa://counties 清單中的完整縣市名稱,例如「臺北市」。

Inputs: county (required). Returns: result

get_weather_warningB

查詢指定縣市目前生效中的天氣特報(豪雨、強風等現象與有效時段)。

county 必須是 cwa://counties 清單中的完整縣市名稱,例如「臺北市」。

Inputs: county (required). Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 4 tools

    Disambiguation4/5

    The four tools cover distinct domains: weather forecast, earthquake reports, weather warnings, and typhoon warnings. However, get_weather_warning and get_typhoon_warning could overlap during typhoons (heavy rain/strong wind warnings), but their descriptions focus on different parameters, so confusion is minimal.

    Naming Consistency4/5

    All tools follow a get_<domain>_<type> pattern, making them predictable. The only deviation is 'report' in get_earthquake_report versus 'forecast' and 'warning' in others, which is a minor inconsistency but does not harm readability.

    Tool Count5/5

    At 4 tools, the server is tightly scoped to the Central Weather Administration's primary data products. This is within the ideal 3-15 range, and each tool justifies its presence.

    Completeness4/5

    The server covers forecast, seismic events, and warnings comprehensively for its niche. Minor gaps exist, such as no get_current_weather or an explicit county-list tool (referenced externally via cwa://counties), but these are easily worked around and do not break core workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Provides access to Hong Kong Observatory weather data APIs, enabling retrieval of forecasts, earthquake info, tide data, and more via natural language.
      20
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides read-only access to Taiwan's Central Weather Administration (CWA) Open Data API, offering 36 tools across 7 categories including weather forecasts, observations, earthquakes, and astronomy.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables to access Taiwan Central Weather Administration data, including 3-day and 1-week weather forecasts for counties/cities and historical rainfall data.
      3
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      An MCP server that provides real-time weather forecasts, weather warnings, and recent earthquake information in Taiwan via the Central Weather Administration's open data API.
      3
      MIT