Skip to main content

cwa-mcp-server

MCP server,包中央氣象署(CWA)開放資料 API,讓 agent 能查天氣預報、地震報告、天氣特報、颱風警報,並產生避難建議。

功能

  • Tool get_weather_forecast(county) — 縣市未來 36 小時天氣預報
  • Tool get_earthquake_report(limit) — 最近 N 筆顯著有感地震報告
  • Tool get_weather_warning(county) — 縣市目前生效中的天氣特報(豪雨、強風等)
  • Tool get_typhoon_warning(limit) — 最近 N 筆颱風警報
  • Resource cwa://counties — 合法縣市名稱清單
  • Prompt evacuation_advisory(county) — 根據即時天氣/特報/地震/颱風資料生成避難建議的提示模板

安裝

uv sync

申請 API Key

  1. 氣象資料開放平台 註冊會員(email + 密碼即可,免審核)
  2. 登入後點「API 授權碼」→「取得授權碼」,立即產生 key
  3. 複製 .env.example.env,填入 CWA_API_KEY

在 Claude Desktop / Claude Code 使用

{
  "mcpServers": {
    "cwa-weather": {
      "command": "uv",
      "args": ["--directory", "/絕對路徑/cwa-mcp-server", "run", "cwa-mcp-server"],
      "env": { "CWA_API_KEY": "${CWA_API_KEY}" }
    }
  }
}

開發

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

狀態

四個 tool(天氣預報、地震報告、天氣特報、颱風警報)都已用真實 key 打過線上 API 驗證,也已接上 Claude Code 實測對話流程,能正確判斷風險等級並給出具體建議。尚未發布到 MCP Server Registry。

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cwa_mcp_server-0.1.0.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cwa_mcp_server-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file cwa_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: cwa_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cwa_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 daf3c44e256cf6c6f7863d244fe02454fe7631aa407f532b9864f23bc3c1143f
MD5 9b208c92c9d8d3f477150237bc86e72c
BLAKE2b-256 ec26fbf51393168892cf817516b3bc723b2178a8b7d611d2487d72f1acccd996

See more details on using hashes here.

File details

Details for the file cwa_mcp_server-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cwa_mcp_server-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cwa_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36ec473b55dbda95ea8b3f87b4fbfb530745319c02d02ab21947656b69674a1e
MD5 8e503d99c54a7a70b480df4bb51fc37c
BLAKE2b-256 c85f59092fbcaa7cea7dec6218d4c9673b58922fc407a4a4eeb6d730943ba85b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page