Skip to main content
Glama
cwa-mcp-server

cwa-mcp-server

by gary2376

cwa-mcp-server

MCP 서버로, 중앙기상청(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) — 실시간 날씨/특보/지진/태풍 데이터를 기반으로 대피 권고를 생성하는 프롬프트 템플릿

Related MCP server: mcp-cwa

API Key 신청

  1. 기상 데이터 개방 플랫폼에서 회원 가입 (email + 비밀번호만 있으면 되며, 심사 불필요)

  2. 로그인 후 「API 인증 코드」→「인증 코드 발급」을 클릭하면 즉시 key가 생성됩니다

설치 (일반 사용자)

PyPI에 이미 배포되어 있어 이 repo를 clone할 필요가 없습니다. Claude Desktop / Claude Code의 MCP 설정에서 uvx 실행을 지정하면 자동으로 패키지를 가져옵니다:

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

또는 Claude Code CLI 사용:

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

개발 (이 repo 소스 코드 수정)

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

상태

네 가지 tool(날씨 예보, 지진 보고, 기상 특보, 태풍 경보) 모두 실제 key로 온라인 API 검증을 완료했으며, Claude Code에 연결하여 실제 대화 흐름도 테스트했습니다. 위험 등급을 정확히 판단하고 구체적인 권고를 제시할 수 있습니다. PyPI와 MCP Server Registry에 배포 완료했습니다.

알려진 수정 사항: v0.1.0에서 처음 업로드한 wheel은 uv_build가 기본적으로 project.name으로 모듈 이름(cwa_mcp_server)을 추측하여 실제 소스 코드 디렉터리 src/cwa_mcp/와 일치하지 않아 빈 껍데기 패키지가 빌드되었고, uvx cwa-mcp-server 실행 시 바로 ModuleNotFoundError가 발생했습니다. pyproject.toml에 [tool.uv.build-backend] module-name = "cwa_mcp"를 추가하여 수정했고, wheel 내용이 올바른지 다시 빌드하여 검증했습니다.

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
    ResponsivenessNo recent community issues

    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