Yggdrasil
MCP ServersMCP 伺服器 SKILLs技能 PlugIns解決方案 Asgard AI SolutionAsgard AI 方案 Submit Listing申請上架 GitHub
C

CWA Weather 中央氣象署

Released已發布
data taiwan

MCP server for CWA (中央氣象署, Central Weather Administration) Open Data API. Provides 36 read-only tools across 7 weather data categories for AI agents such as Claude.

中央氣象署 MCP Server,提供 AI 代理透過自然語言存取相關資料與功能。

Status狀態
released
Tools工具數
36
Category分類
data
Region地區
taiwan
Maintainer維護者
GitHub

Features功能特色

  • 36 tools covering all major CWA Open Data categories
  • 80 API endpoints accessible via intelligent tool grouping (e.g. 44 township forecasts → 2 tools with county parameter)
  • 22 county mapping for township-level weather forecasts
  • All tools are read-only with readOnlyHint=True annotations
  • 36 個工具 覆蓋所有主要 CWA 開放資料類別
  • 80 個 API 端點 透過智慧分組存取(例如 44 個鄉鎮預報 → 2 個帶縣市參數的工具)
  • 22 縣市對應表 可查詢鄉鎮級天氣預報
  • 所有工具皆為唯讀(readOnlyHint=True

Quick Start快速開始

Install from PyPI

pip install mcp-cwa

Or clone and install locally

git clone https://github.com/asgard-ai-platform/mcp-cwa.git
cd mcp-cwa
uv venv && source .venv/bin/activate
uv pip install -e .

Claude Desktop / Claude Code

Add to your MCP configuration:

{
  "mcpServers": {
    "mcp-cwa": {
      "command": "python3",
      "args": ["mcp_server.py"],
      "cwd": "/path/to/mcp-cwa",
      "env": {
        "CWA_API_KEY": "CWA-your-authorization-code"
      }
    }
  }
}

Get API Key

  1. Register at CWA Open Data Platform
  2. After registration, obtain your authorization code from the member page

Environment Variables

Variable Required Description
CWA_API_KEY Yes CWA Open Data API authorization code

從 PyPI 安裝

pip install mcp-cwa

或 clone 並本地安裝

git clone https://github.com/asgard-ai-platform/mcp-cwa.git
cd mcp-cwa
uv venv && source .venv/bin/activate
uv pip install -e .

Claude Desktop / Claude Code

將以下設定加入 MCP 設定檔:

{
  "mcpServers": {
    "mcp-cwa": {
      "command": "python3",
      "args": ["mcp_server.py"],
      "cwd": "/path/to/mcp-cwa",
      "env": {
        "CWA_API_KEY": "CWA-你的授權碼"
      }
    }
  }
}

取得 API Key

  1. 中央氣象署開放資料平臺註冊會員
  2. 註冊後於會員頁面取得授權碼

環境變數

變數 必要 說明
CWA_API_KEY CWA 開放資料 API 授權碼

API ReferenceAPI 參考文件

All tools query the CWA Open Data API at https://opendata.cwa.gov.tw/api/v1/rest/datastore/{dataset_id}.

See _spec/api-tools-list.md for the complete endpoint inventory.

所有工具皆查詢 CWA Open Data API:https://opendata.cwa.gov.tw/api/v1/rest/datastore/{dataset_id}

完整端點清單請參閱 _spec/api-tools-list.md

Development開發

# Install dependencies
uv venv && source .venv/bin/activate
uv pip install -e .

# Run E2E tests (requires real API key)
CWA_API_KEY=CWA-xxx python3 tests/test_all_tools.py
# 安裝相依套件
uv venv && source .venv/bin/activate
uv pip install -e .

# 執行端對端測試(需真實 API key)
CWA_API_KEY=CWA-xxx python3 tests/test_all_tools.py

License授權

MIT — see LICENSE

MIT — 詳見 LICENSE

CategoriesCategories

Category Tools Description
Forecast (預報) 9 36-hour, 3-day, 1-week forecasts; township forecasts; tidal; cold injury; temperature diff
Observation (觀測) 7 Weather stations, rainfall, 10-min observations, UV index, ozone, marine
Earthquake (地震海嘯) 5 Tsunami info, significant/local earthquake reports (zh/en)
Climate (氣候) 5 30-day observations, daily rainfall, monthly average, station info
Warning (天氣警特報) 7 Weather warnings by county, heavy rain, cold, heat, typhoon, tropical cyclone
Numerical (數值預報) 1 Heat injury index
Astronomy (天文) 2 Sunrise/sunset, moonrise/moonset
分類 工具數 說明
預報 9 36小時、3天、1週天氣預報;鄉鎮預報;潮汐;低溫傷害;溫差
觀測 7 氣象站、雨量、10分鐘觀測、紫外線指數、臭氧、海象
地震海嘯 5 海嘯資訊、顯著/小區域有感地震報告(中/英)
氣候 5 30天觀測、日雨量、月平均、測站資訊
天氣警特報 7 依縣市警特報、豪大雨、低溫、高溫、颱風、熱帶氣旋
數值預報 1 熱傷害指數
天文 2 日出日沒、月出月沒

Usage ExamplesUsage Examples

User: 臺北市現在天氣如何?
Agent: [calls get_weather_observation(county_name="臺北市")]

User: 最近有地震嗎?
Agent: [calls get_significant_earthquake(limit=3)]

User: 明天高雄日出時間?
Agent: [calls get_sunrise_sunset(county_name="高雄市", date="2025-04-16")]
使用者: 臺北市現在天氣如何?
Agent: [呼叫 get_weather_observation(county_name="臺北市")]

使用者: 最近有地震嗎?
Agent: [呼叫 get_significant_earthquake(limit=3)]

使用者: 明天高雄日出時間?
Agent: [呼叫 get_sunrise_sunset(county_name="高雄市", date="2025-04-16")]

使用者: 基隆市未來三天天氣?
Agent: [呼叫 get_township_forecast_3day(county="基隆市")]

Tags標籤

weathertaiwangov

Related MCP Servers相關 MCP 伺服器