Skip to main content
Glama
HK Climate and Weather MCP Server

HK Climate and Weather MCP Server

by hkopenai

HK Climate and Weather MCP Server

GitHub Repository License: MIT

This is an MCP server that provides access to climate and weather data through a FastMCP interface.

Data Source

  • Hong Kong Observatory

Related MCP server: Hefeng QWeather MCP Server

Features

  • Current weather: Get current weather observations from HKO (supports optional region parameter)

  • 9-day forecast: Get extended weather forecast including general situation, daily forecasts, sea and soil temperatures

  • Local weather forecast: Get short-term weather forecast with outlook

  • Weather warnings: Get summary and detailed information about active weather warnings

  • Special weather tips: Get important weather-related safety tips

API Reference

Current Weather

get_current_weather(region: str = "Hong Kong Observatory") -> Dict

  • Get current weather observations for a specific region in Hong Kong

  • Parameters:

    • region: The region to get weather for (default: "Hong Kong Observatory")

  • Returns:

    • Dict containing:

      • warning: Current weather warnings

      • temperature: Current temperature in Celsius

      • humidity: Current humidity percentage

      • rainfall: Current rainfall in mm

9-Day Weather Forecast

get_9_day_weather_forecast(lang: str = "en") -> Dict

  • Get the 9-day weather forecast for Hong Kong

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing:

      • generalSituation: General weather situation

      • weatherForecast: List of daily forecast dicts

      • updateTime: Last update time

      • seaTemp: Sea temperature info

      • soilTemp: List of soil temperature info

Local Weather Forecast

get_local_weather_forecast(lang: str = "en") -> Dict

  • Get local weather forecast for Hong Kong

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing:

      • forecastDesc: Forecast description

      • outlook: Outlook forecast

      • updateTime: Last update time

      • forecastPeriod: Forecast period

      • forecastDate: Forecast date

Weather Warning Summary

get_weather_warning_summary(lang: str = "en") -> Dict

  • Get weather warning summary for Hong Kong

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing:

      • warningMessage: List of warning messages

      • updateTime: Last update time

Weather Warning Information

get_weather_warning_info(lang: str = "en") -> Dict

  • Get detailed weather warning information

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing:

      • warningStatement: Warning statement

      • updateTime: Last update time

Special Weather Tips

get_special_weather_tips(lang: str = "en") -> Dict

  • Get special weather tips for Hong Kong

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing:

      • specialWeatherTips: List of special weather tips

      • updateTime: Last update time

Visibility Data

get_visibility(lang: str = "en") -> Dict

  • Get latest 10-minute mean visibility data for Hong Kong

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing visibility data with fields and data arrays

Lightning Data

get_lightning_data(lang: str = "en") -> Dict

  • Get cloud-to-ground and cloud-to-cloud lightning count data

  • Parameters:

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing lightning data with fields and data arrays

Moon Times

get_moon_times(year: int, month: Optional[int] = None, day: Optional[int] = None, lang: str = "en") -> Dict

  • Get times of moonrise, moon transit and moonset

  • Parameters:

    • year: Year (2018-2024)

    • month: Optional month (1-12)

    • day: Optional day (1-31)

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing moon times data with fields and data arrays

Hourly Tides

get_hourly_tides(station: str, year: int, month: Optional[int] = None, day: Optional[int] = None, hour: Optional[int] = None, lang: str = "en") -> Dict

  • Get hourly heights of astronomical tides for a specific station

  • Parameters:

    • station: Station code (e.g. 'CCH' for Cheung Chau)

    • year: Year (2022-2024)

    • month: Optional month (1-12)

    • day: Optional day (1-31)

    • hour: Optional hour (1-24)

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing tide data with fields and data arrays

High/Low Tides

get_high_low_tides(station: str, year: int, month: Optional[int] = None, day: Optional[int] = None, hour: Optional[int] = None, lang: str = "en") -> Dict

  • Get times and heights of astronomical high and low tides

  • Parameters:

    • station: Station code (e.g. 'CCH' for Cheung Chau)

    • year: Year (2022-2024)

    • month: Optional month (1-12)

    • day: Optional day (1-31)

    • hour: Optional hour (1-24)

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing tide data with fields and data arrays

Weather and Radiation Report

get_weather_radiation_report(date: str, station: str, lang: str = "en") -> Dict

  • Get weather and radiation level report for Hong Kong

  • Parameters:

    • date: Mandatory date in YYYYMMDD format (e.g., 20250618)

    • station: Mandatory station code (e.g., 'HKO' for Hong Kong Observatory)

    • lang: Language code (en/tc/sc, default: en)

  • Returns:

    • Dict containing weather and radiation data or error message if parameters are invalid

Station Codes

get_radiation_station_codes() -> Dict

  • Get a list of station codes and their corresponding names for weather and radiation reports in Hong Kong

  • Parameters:

    • None

  • Returns:

    • Dict mapping station codes to station names

Setup

  1. Clone this repository

  2. Install Python dependencies:

    pip install -r requirements.txt
  3. Run the server:

    python server.py

Running Options

  • Default stdio mode: python server.py

  • SSE mode (port 8000): python server.py --sse

Environment Variables

  • TRANSPORT_MODE: Set to sse to run the server in SSE mode. If not set, defaults to stdio mode.

  • HOST: When TRANSPORT_MODE is sse, specifies the host to bind the server to (e.g., 0.0.0.0). Defaults to 127.0.0.1.

  • PORT: When TRANSPORT_MODE is sse, specifies the port to run the server on (e.g., 8080). Defaults to 8000.

Example:

TRANSPORT_MODE=sse HOST=0.0.0.0 PORT=8080 python server.py

Cline Integration

To connect this MCP server to Cline using stdio:

  1. Add this configuration to your Cline MCP settings (cline_mcp_settings.json):

{
  "hko-server": {
    "disabled": false,
    "timeout": 3,
    "type": "stdio",
    "command": "python",
    "args": [
      "-m",
      "hkopenai.hk_climate_mcp_server"
    ]
  }
}

Testing

Tests are available in tests. Run with:

pytest

Available Tools

19 tools
get_9_day_weather_forecastB

Get 9-day weather forecast for HK with general situation, daily data.

Inputs: lang. Returns: object

get_current_weatherB

Get current weather data, warnings, temp, humidity in HK from HKO.

Inputs: lang, region. Returns: object

get_daily_max_temperatureC

Get daily maximum temperature data for a specific station in Hong Kong

Inputs: station (required), lang, year, month. Returns: object

get_daily_mean_temperatureB

Get daily mean temperature data for a specific station in Hong Kong

Inputs: station (required), lang, year, month. Returns: object

get_daily_min_temperatureB

Get daily minimum temperature data for a specific station in Hong Kong

Inputs: station (required), lang, year, month. Returns: object

get_gregorian_lunar_calendarC

Get Gregorian-Lunar calendar conversion data

Inputs: year (required), day, lang, month. Returns: object

get_high_low_tidesC

Get times, heights of astronomical high/low tides for a station in HK.

Inputs: year (required), station (required), options. Returns: object

get_hourly_tidesB

Get hourly heights of astronomical tides for a station in HK.

Inputs: year (required), station (required), options. Returns: object

get_lightning_dataB

Get cloud-to-ground and cloud-to-cloud lightning count data

Inputs: lang. Returns: object

get_local_weather_forecastC

Get local weather forecast for HK with description, outlook, update.

Inputs: lang. Returns: object

get_moon_timesC

Get times of moonrise, moon transit and moonset

Inputs: year (required), day, lang, month. Returns: object

get_radiation_station_codesA

Get list of weather station codes and names for radiation reports in HK.

Inputs: lang. Returns: object

get_special_weather_tipsC

Get special weather tips for Hong Kong including tips list and update.

Inputs: lang. Returns: object

get_sunrise_sunset_timesB

Get times of sunrise, sun transit and sunset for Hong Kong

Inputs: year (required), day, lang, month. Returns: object

get_tide_station_codesB

Get list of tide station codes and names for tide reports in HK.

Inputs: lang. Returns: object

get_visibilityA

Get latest 10-minute mean visibility data for Hong Kong

Inputs: lang. Returns: object

get_weather_radiation_reportC

Get weather, radiation report for HK. Date must be YYYYMMDD.

Inputs: date (required), station (required), lang. Returns: object

get_weather_warning_infoC

Get detailed weather warning info for HK with statement and update.

Inputs: lang. Returns: object

get_weather_warning_summaryC

Get weather warning summary for HK with messages and update.

Inputs: lang. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, such as current weather vs. forecasts vs. warnings. There is some potential confusion between get_current_weather and get_local_weather_forecast, but their descriptions distinguish immediate conditions from short-range outlooks.

    Naming Consistency5/5

    All tools follow the consistent 'get_' prefix combined with a descriptive object name, creating a predictable verb_noun pattern. No mixing of styles or vague verbs.

    Tool Count4/5

    With 19 tools, the server is slightly above the typical well-scoped range, but the breadth of climate, weather, tide, and astronomical data justifies the count. Each tool serves a specific data need without excessive redundancy.

    Completeness4/5

    The toolset covers a wide range of weather, climate, and astronomy data, including forecasts, warnings, radiation, tides, and visibility. A notable gap is the lack of a general station code list for temperature data, as only radiation and tide stations provide code lookup tools.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables access to Hong Kong government's official open data portal (DATA.GOV.HK) through natural language queries. Supports searching datasets, browsing categories, and retrieving detailed information about Hong Kong's public data resources.
      8
      9
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides comprehensive weather data including forecasts, air quality, weather alerts, historical data, and astronomical information through the Hefeng Weather API. Supports real-time weather, multi-day forecasts, hourly predictions, and specialized data like sunrise/sunset times and precipitation forecasts.
      4
      MIT
    • 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