MCP server for CWA (中央氣象署) open data API — 36 tools across 7 weather data categories
Project description
mcp-cwa
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.
Part of the Asgard AI Platform open-source ecosystem.
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=Trueannotations
Categories
| 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 |
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
- Register at CWA Open Data Platform
- 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 |
Example Usage
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")]
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
API Reference
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.
License
MIT — see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_cwa-0.1.0.tar.gz.
File metadata
- Download URL: mcp_cwa-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd7e9be323a810461fad711670bf95d040d97dd0935b9a1aa295a9f1b2c7bdf6
|
|
| MD5 |
edfd815dcfc85805b6a815340b5480aa
|
|
| BLAKE2b-256 |
1f6506229fc20e15df8a710622aab2e6fa1631f977fc1e2229109b96c4328c0c
|
Provenance
The following attestation bundles were made for mcp_cwa-0.1.0.tar.gz:
Publisher:
publish.yml on asgard-ai-platform/mcp-cwa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_cwa-0.1.0.tar.gz -
Subject digest:
fd7e9be323a810461fad711670bf95d040d97dd0935b9a1aa295a9f1b2c7bdf6 - Sigstore transparency entry: 1362606012
- Sigstore integration time:
-
Permalink:
asgard-ai-platform/mcp-cwa@ffd6edd90b37e775b904a0c990988b5119c245f9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asgard-ai-platform
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ffd6edd90b37e775b904a0c990988b5119c245f9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_cwa-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_cwa-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adb17a6ed56f6c8cbe2af0362fd003013ed4352b7f0aeda49ff145c7c0ebd4ea
|
|
| MD5 |
bf0ca34ca456805bc388dfcd7f0b6d2e
|
|
| BLAKE2b-256 |
fcc3619a6b3a075ca00b475bdf83845aa39124d19433f37714dbc045ba35ca95
|
Provenance
The following attestation bundles were made for mcp_cwa-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on asgard-ai-platform/mcp-cwa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_cwa-0.1.0-py3-none-any.whl -
Subject digest:
adb17a6ed56f6c8cbe2af0362fd003013ed4352b7f0aeda49ff145c7c0ebd4ea - Sigstore transparency entry: 1362606021
- Sigstore integration time:
-
Permalink:
asgard-ai-platform/mcp-cwa@ffd6edd90b37e775b904a0c990988b5119c245f9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asgard-ai-platform
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ffd6edd90b37e775b904a0c990988b5119c245f9 -
Trigger Event:
release
-
Statement type: