cwa-mcp-server
cwa-mcp-server
Servidor MCP que envuelve la API de datos abiertos de la Agencia Meteorológica Central (CWA), permitiendo a los agentes consultar pronósticos del tiempo, informes de terremotos, avisos meteorológicos, alertas de tifones y generar recomendaciones de evacuación.
Funciones
Tool
get_weather_forecast(county)— Pronóstico del tiempo para las próximas 36 horas en el condado/ciudadTool
get_earthquake_report(limit)— Informe de los últimos N terremotos perceptibles significativosTool
get_weather_warning(county)— Avisos meteorológicos actualmente activos para el condado/ciudad (lluvias torrenciales, vientos fuertes, etc.)Tool
get_typhoon_warning(limit)— Alertas de tifón de los últimos NResource
cwa://counties— Lista de nombres válidos de condados/ciudadesPrompt
evacuation_advisory(county)— Plantilla de prompt para generar recomendaciones de evacuación basadas en datos en tiempo real de clima/avisos/terremotos/tifones
Related MCP server: mcp-cwa
Obtener una clave de API
Regístrese en Plataforma de datos abiertos meteorológicos (solo se necesita correo electrónico y contraseña, sin revisión)
Después de iniciar sesión, haga clic en «Código de autorización de API» → «Obtener código de autorización» para generar la clave inmediatamente
Instalación (usuarios generales)
Se ha publicado en PyPI, no es necesario clonar este repositorio. En la configuración de MCP de Claude Desktop / Claude Code, especifique uvx para ejecutarlo y descargará el paquete automáticamente:
{
"mcpServers": {
"cwa-weather": {
"command": "uvx",
"args": ["cwa-mcp-server"],
"env": { "CWA_API_KEY": "你申請到的授權碼" }
}
}
}O con la CLI de Claude Code:
claude mcp add cwa-weather -e CWA_API_KEY=你申請到的授權碼 -- uvx cwa-mcp-serverDesarrollo (modificar el código fuente de este repositorio)
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 手動測試 toolsEstado
Las cuatro herramientas (pronóstico del tiempo, informe de terremotos, avisos meteorológicos, alertas de tifones) han sido verificadas con claves reales contra la API en línea, y también se han probado con Claude Code en flujos de conversación reales, pudiendo evaluar correctamente los niveles de riesgo y proporcionar recomendaciones concretas. Se ha publicado en PyPI y en el Registro de Servidores MCP.
Errores conocidos corregidos: El wheel subido inicialmente en v0.1.0, debido a que uv_build usa por defecto project.name para adivinar el nombre del módulo (cwa_mcp_server), no coincidía con el directorio real del código fuente src/cwa_mcp/, empaquetando un paquete vacío, y uvx cwa-mcp-server generaba directamente un ModuleNotFoundError. Se ha corregido añadiendo [tool.uv.build-backend] module-name = "cwa_mcp" en pyproject.toml, y se ha reconstruido y verificado que el contenido del wheel es correcto.
Licencia
MIT
Available Tools
4 toolsget_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
Scored across 4 tools
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.
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.
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.
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
Related MCP Connectors
Taiwan data for AI agents: THSR/TRA timetables, TWSE/TPEx stocks, invoice lottery, garbage, outages
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
US weather & geo for AI agents: forecasts, alerts, earthquakes, elevation, geocoding. No keys.
Taiwan official open data for AI agents: property prices and laws in English, with change alerts
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides access to Hong Kong Observatory weather data APIs, enabling retrieval of forecasts, earthquake info, tide data, and more via natural language.202MIT
- AlicenseNot gradedqualityDmaintenanceProvides 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
- AlicenseAqualityDmaintenanceEnables to access Taiwan Central Weather Administration data, including 3-day and 1-week weather forecasts for counties/cities and historical rainfall data.3MIT
- AlicenseAqualityCmaintenanceAn 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.3MIT