HK Climate and Weather MCP Server
Provides access to Hong Kong climate and weather data from the Hong Kong Observatory, including current conditions, forecasts, warnings, tides, and more.
README
HK Climate and Weather MCP Server
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
- Dict containing:
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
- Dict containing:
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
- Dict containing:
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
- Dict containing:
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
- Dict containing:
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
- Dict containing:
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
- Clone this repository
- Install Python dependencies:
pip install -r requirements.txt - 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 tosseto run the server in SSE mode. If not set, defaults tostdiomode.HOST: WhenTRANSPORT_MODEissse, specifies the host to bind the server to (e.g.,0.0.0.0). Defaults to127.0.0.1.PORT: WhenTRANSPORT_MODEissse, specifies the port to run the server on (e.g.,8080). Defaults to8000.
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:
- 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。