Skip to main content

Hong Kong Weather MCP Server providing climate and weather data tools

Project description

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

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_data(lang: str = "en", rformat: str = "json") -> Dict

  • Get latest 10-minute mean visibility data for Hong Kong
  • Parameters:
    • lang: Language code (en/tc/sc, default: en)
    • rformat: Return format (json/csv, default: json)
  • Returns:
    • Dict containing visibility data with fields and data arrays

Lightning Data

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

  • Get cloud-to-ground and cloud-to-cloud lightning count data
  • Parameters:
    • lang: Language code (en/tc/sc, default: en)
    • rformat: Return format (json/csv, default: json)
  • 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", rformat: str = "json") -> 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)
    • rformat: Return format (json/csv, default: json)
  • 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", rformat: str = "json") -> 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)
    • rformat: Return format (json/csv, default: json)
  • 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", rformat: str = "json") -> 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)
    • rformat: Return format (json/csv, default: json)
  • Returns:
    • Dict containing tide data with fields and data arrays

Setup

  1. Clone this repository
  2. Install Python dependencies:
    pip install -r requirements.txt
    
  3. Run the server:
    python app.py
    

Running Options

  • Default stdio mode: python app.py
  • SSE mode (port 8000): python app.py --sse

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

Project details


Download files

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

Source Distribution

hkopenai_hk_climate_mcp_server-0.3.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file hkopenai_hk_climate_mcp_server-0.3.0.tar.gz.

File metadata

File hashes

Hashes for hkopenai_hk_climate_mcp_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 21dd6dbf3a0d09cb242eeb69576689739e5a061d2e97ab6118d65c81ade1a9b9
MD5 788ccc0e5cc796ea7c241d43c3243483
BLAKE2b-256 ad978fae6754b64fc274ac6e1f87583fdc7c04215942ec71cb868e27ceb83c41

See more details on using hashes here.

File details

Details for the file hkopenai_hk_climate_mcp_server-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hkopenai_hk_climate_mcp_server-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0170ed16292b58a5595d3952e976e6e5055d6afeb2f9b272976fb73220e3be3
MD5 1fca42261a4e22e21b8bf6b6095de858
BLAKE2b-256 a4e97b49164e3593c0b09b01628a89429196db4de3efbb2e9569bcc81354e97c

See more details on using hashes here.

Supported by

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