MCP ExplorerExplorer

Hk Climate Mcp Server

@hkopenaion 4 days ago
4 MIT
FreeCommunity
AI Systems
#ai#artificial-intelligence#hong-kong#hongkong#mcp#mcp-server#open-data
This is an MCP server that provides access to climate and weather data through a FastMCP interface.

Overview

What is Hk Climate Mcp Server

The HKO MCP Server is a FastMCP interface that provides access to climate and weather data sourced from the Hong Kong Observatory. It facilitates real-time retrieval of current weather observations tailored to specific regions.

Use cases

The server is particularly useful for applications needing up-to-date weather data, such as mobile weather applications, climate research projects, and environmental monitoring systems that require real-time information dissemination.

How to use

Users can set up the server by cloning the repository, installing the necessary Python dependencies, and running the server either in standard input/output mode or server-sent events mode. Additionally, users can integrate it with Cline by modifying the configuration settings to point to the server.

Key features

Key features include real-time access to current weather data, optional region filtering for localized weather information, and dual running options that offer flexibility in how the server operates, whether via standard I/O or a dedicated SSE port.

Where to use

The HKO MCP Server can be utilized in various settings, including research institutions, educational platforms, mobile applications, and any climate-related services that require accurate and timely weather data, particularly in the context of Hong Kong.

Content

HKO 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

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": [
      "c:/Projects/hkopenai/hk-climate-mcp-server/app.py"
    ]
  }
}

Testing

Tests are available in tests. Run with:

pytest

Tools

No tools

Comments