hkopenai.hk-climate-mcp-server 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/PKG-INFO +62 -3
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/README.md +61 -2
- hkopenai_hk_climate_mcp_server-0.3.0/hkopenai/hk_climate_mcp_server/__init__.py +43 -0
- hkopenai_hk_climate_mcp_server-0.3.0/hkopenai/hk_climate_mcp_server/app.py +245 -0
- hkopenai_hk_climate_mcp_server-0.3.0/hkopenai/hk_climate_mcp_server/tool_weather.py +600 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/PKG-INFO +62 -3
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/pyproject.toml +7 -7
- hkopenai_hk_climate_mcp_server-0.3.0/tests/test_app.py +84 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/tests/test_weather.py +129 -1
- hkopenai_hk_climate_mcp_server-0.2.0/hkopenai/hk_climate_mcp_server/__init__.py +0 -21
- hkopenai_hk_climate_mcp_server-0.2.0/hkopenai/hk_climate_mcp_server/app.py +0 -65
- hkopenai_hk_climate_mcp_server-0.2.0/hkopenai/hk_climate_mcp_server/tool_weather.py +0 -241
- hkopenai_hk_climate_mcp_server-0.2.0/tests/test_app.py +0 -70
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/LICENSE +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai/hk_climate_mcp_server/__main__.py +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/SOURCES.txt +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/dependency_links.txt +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/entry_points.txt +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/requires.txt +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/top_level.txt +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/setup.cfg +0 -0
- {hkopenai_hk_climate_mcp_server-0.2.0 → hkopenai_hk_climate_mcp_server-0.3.0}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hkopenai.hk_climate_mcp_server
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Hong Kong Weather MCP Server providing climate and weather data tools
|
5
5
|
Author-email: Neo Chow <neo@01man.com>
|
6
6
|
License-Expression: MIT
|
@@ -16,7 +16,7 @@ Requires-Dist: pytest>=8.2.0
|
|
16
16
|
Requires-Dist: pytest-cov>=6.1.1
|
17
17
|
Dynamic: license-file
|
18
18
|
|
19
|
-
#
|
19
|
+
# HK Climate and Weather MCP Server
|
20
20
|
|
21
21
|
[](https://github.com/hkopenai/hk-climate-mcp-server)
|
22
22
|
[](https://opensource.org/licenses/MIT)
|
@@ -106,6 +106,64 @@ This is an MCP server that provides access to climate and weather data through a
|
|
106
106
|
- specialWeatherTips: List of special weather tips
|
107
107
|
- updateTime: Last update time
|
108
108
|
|
109
|
+
### Visibility Data
|
110
|
+
`get_visibility_data(lang: str = "en", rformat: str = "json") -> Dict`
|
111
|
+
- Get latest 10-minute mean visibility data for Hong Kong
|
112
|
+
- Parameters:
|
113
|
+
- lang: Language code (en/tc/sc, default: en)
|
114
|
+
- rformat: Return format (json/csv, default: json)
|
115
|
+
- Returns:
|
116
|
+
- Dict containing visibility data with fields and data arrays
|
117
|
+
|
118
|
+
### Lightning Data
|
119
|
+
`get_lightning_data(lang: str = "en", rformat: str = "json") -> Dict`
|
120
|
+
- Get cloud-to-ground and cloud-to-cloud lightning count data
|
121
|
+
- Parameters:
|
122
|
+
- lang: Language code (en/tc/sc, default: en)
|
123
|
+
- rformat: Return format (json/csv, default: json)
|
124
|
+
- Returns:
|
125
|
+
- Dict containing lightning data with fields and data arrays
|
126
|
+
|
127
|
+
### Moon Times
|
128
|
+
`get_moon_times(year: int, month: Optional[int] = None, day: Optional[int] = None, lang: str = "en", rformat: str = "json") -> Dict`
|
129
|
+
- Get times of moonrise, moon transit and moonset
|
130
|
+
- Parameters:
|
131
|
+
- year: Year (2018-2024)
|
132
|
+
- month: Optional month (1-12)
|
133
|
+
- day: Optional day (1-31)
|
134
|
+
- lang: Language code (en/tc/sc, default: en)
|
135
|
+
- rformat: Return format (json/csv, default: json)
|
136
|
+
- Returns:
|
137
|
+
- Dict containing moon times data with fields and data arrays
|
138
|
+
|
139
|
+
### Hourly Tides
|
140
|
+
`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`
|
141
|
+
- Get hourly heights of astronomical tides for a specific station
|
142
|
+
- Parameters:
|
143
|
+
- station: Station code (e.g. 'CCH' for Cheung Chau)
|
144
|
+
- year: Year (2022-2024)
|
145
|
+
- month: Optional month (1-12)
|
146
|
+
- day: Optional day (1-31)
|
147
|
+
- hour: Optional hour (1-24)
|
148
|
+
- lang: Language code (en/tc/sc, default: en)
|
149
|
+
- rformat: Return format (json/csv, default: json)
|
150
|
+
- Returns:
|
151
|
+
- Dict containing tide data with fields and data arrays
|
152
|
+
|
153
|
+
### High/Low Tides
|
154
|
+
`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`
|
155
|
+
- Get times and heights of astronomical high and low tides
|
156
|
+
- Parameters:
|
157
|
+
- station: Station code (e.g. 'CCH' for Cheung Chau)
|
158
|
+
- year: Year (2022-2024)
|
159
|
+
- month: Optional month (1-12)
|
160
|
+
- day: Optional day (1-31)
|
161
|
+
- hour: Optional hour (1-24)
|
162
|
+
- lang: Language code (en/tc/sc, default: en)
|
163
|
+
- rformat: Return format (json/csv, default: json)
|
164
|
+
- Returns:
|
165
|
+
- Dict containing tide data with fields and data arrays
|
166
|
+
|
109
167
|
## Setup
|
110
168
|
|
111
169
|
1. Clone this repository
|
@@ -136,7 +194,8 @@ To connect this MCP server to Cline using stdio:
|
|
136
194
|
"type": "stdio",
|
137
195
|
"command": "python",
|
138
196
|
"args": [
|
139
|
-
"
|
197
|
+
"-m",
|
198
|
+
"hkopenai.hk_climate_mcp_server"
|
140
199
|
]
|
141
200
|
}
|
142
201
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# HK Climate and Weather MCP Server
|
2
2
|
|
3
3
|
[](https://github.com/hkopenai/hk-climate-mcp-server)
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
@@ -88,6 +88,64 @@ This is an MCP server that provides access to climate and weather data through a
|
|
88
88
|
- specialWeatherTips: List of special weather tips
|
89
89
|
- updateTime: Last update time
|
90
90
|
|
91
|
+
### Visibility Data
|
92
|
+
`get_visibility_data(lang: str = "en", rformat: str = "json") -> Dict`
|
93
|
+
- Get latest 10-minute mean visibility data for Hong Kong
|
94
|
+
- Parameters:
|
95
|
+
- lang: Language code (en/tc/sc, default: en)
|
96
|
+
- rformat: Return format (json/csv, default: json)
|
97
|
+
- Returns:
|
98
|
+
- Dict containing visibility data with fields and data arrays
|
99
|
+
|
100
|
+
### Lightning Data
|
101
|
+
`get_lightning_data(lang: str = "en", rformat: str = "json") -> Dict`
|
102
|
+
- Get cloud-to-ground and cloud-to-cloud lightning count data
|
103
|
+
- Parameters:
|
104
|
+
- lang: Language code (en/tc/sc, default: en)
|
105
|
+
- rformat: Return format (json/csv, default: json)
|
106
|
+
- Returns:
|
107
|
+
- Dict containing lightning data with fields and data arrays
|
108
|
+
|
109
|
+
### Moon Times
|
110
|
+
`get_moon_times(year: int, month: Optional[int] = None, day: Optional[int] = None, lang: str = "en", rformat: str = "json") -> Dict`
|
111
|
+
- Get times of moonrise, moon transit and moonset
|
112
|
+
- Parameters:
|
113
|
+
- year: Year (2018-2024)
|
114
|
+
- month: Optional month (1-12)
|
115
|
+
- day: Optional day (1-31)
|
116
|
+
- lang: Language code (en/tc/sc, default: en)
|
117
|
+
- rformat: Return format (json/csv, default: json)
|
118
|
+
- Returns:
|
119
|
+
- Dict containing moon times data with fields and data arrays
|
120
|
+
|
121
|
+
### Hourly Tides
|
122
|
+
`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`
|
123
|
+
- Get hourly heights of astronomical tides for a specific station
|
124
|
+
- Parameters:
|
125
|
+
- station: Station code (e.g. 'CCH' for Cheung Chau)
|
126
|
+
- year: Year (2022-2024)
|
127
|
+
- month: Optional month (1-12)
|
128
|
+
- day: Optional day (1-31)
|
129
|
+
- hour: Optional hour (1-24)
|
130
|
+
- lang: Language code (en/tc/sc, default: en)
|
131
|
+
- rformat: Return format (json/csv, default: json)
|
132
|
+
- Returns:
|
133
|
+
- Dict containing tide data with fields and data arrays
|
134
|
+
|
135
|
+
### High/Low Tides
|
136
|
+
`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`
|
137
|
+
- Get times and heights of astronomical high and low tides
|
138
|
+
- Parameters:
|
139
|
+
- station: Station code (e.g. 'CCH' for Cheung Chau)
|
140
|
+
- year: Year (2022-2024)
|
141
|
+
- month: Optional month (1-12)
|
142
|
+
- day: Optional day (1-31)
|
143
|
+
- hour: Optional hour (1-24)
|
144
|
+
- lang: Language code (en/tc/sc, default: en)
|
145
|
+
- rformat: Return format (json/csv, default: json)
|
146
|
+
- Returns:
|
147
|
+
- Dict containing tide data with fields and data arrays
|
148
|
+
|
91
149
|
## Setup
|
92
150
|
|
93
151
|
1. Clone this repository
|
@@ -118,7 +176,8 @@ To connect this MCP server to Cline using stdio:
|
|
118
176
|
"type": "stdio",
|
119
177
|
"command": "python",
|
120
178
|
"args": [
|
121
|
-
"
|
179
|
+
"-m",
|
180
|
+
"hkopenai.hk_climate_mcp_server"
|
122
181
|
]
|
123
182
|
}
|
124
183
|
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"""Hong Kong climate MCP Server package."""
|
2
|
+
from .app import main
|
3
|
+
from .tool_weather import (
|
4
|
+
get_current_weather,
|
5
|
+
get_9_day_weather_forecast,
|
6
|
+
get_local_weather_forecast,
|
7
|
+
get_weather_warning_summary,
|
8
|
+
get_weather_warning_info,
|
9
|
+
get_special_weather_tips,
|
10
|
+
get_visibility_data,
|
11
|
+
get_lightning_data,
|
12
|
+
get_moon_times,
|
13
|
+
get_hourly_tides,
|
14
|
+
get_high_low_tides,
|
15
|
+
get_sunrise_sunset_times,
|
16
|
+
get_gregorian_lunar_calendar,
|
17
|
+
get_daily_mean_temperature,
|
18
|
+
get_daily_max_temperature,
|
19
|
+
get_daily_min_temperature,
|
20
|
+
get_weather_radiation_report
|
21
|
+
)
|
22
|
+
|
23
|
+
__version__ = "0.1.0"
|
24
|
+
__all__ = [
|
25
|
+
'main',
|
26
|
+
'get_current_weather',
|
27
|
+
'get_9_day_weather_forecast',
|
28
|
+
'get_local_weather_forecast',
|
29
|
+
'get_weather_warning_summary',
|
30
|
+
'get_weather_warning_info',
|
31
|
+
'get_special_weather_tips',
|
32
|
+
'get_visibility_data',
|
33
|
+
'get_lightning_data',
|
34
|
+
'get_moon_times',
|
35
|
+
'get_hourly_tides',
|
36
|
+
'get_high_low_tides',
|
37
|
+
'get_sunrise_sunset_times',
|
38
|
+
'get_gregorian_lunar_calendar',
|
39
|
+
'get_daily_mean_temperature',
|
40
|
+
'get_daily_max_temperature',
|
41
|
+
'get_daily_min_temperature',
|
42
|
+
'get_weather_radiation_report'
|
43
|
+
]
|
@@ -0,0 +1,245 @@
|
|
1
|
+
import argparse
|
2
|
+
from fastmcp import FastMCP
|
3
|
+
from hkopenai.hk_climate_mcp_server import tool_weather
|
4
|
+
from typing import Dict, Annotated, Optional
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
def create_mcp_server():
|
8
|
+
"""Create and configure the HKO MCP server"""
|
9
|
+
mcp = FastMCP(name="HKOServer")
|
10
|
+
|
11
|
+
@mcp.tool(
|
12
|
+
description="Get current weather observations, warnings, temperature, humidity and rainfall in Hong Kong from Hong Kong Observatory, with optional region or place in Hong Kong",
|
13
|
+
)
|
14
|
+
def get_current_weather(region: str = "Hong Kong Observatory") -> Dict:
|
15
|
+
return tool_weather.get_current_weather(region)
|
16
|
+
|
17
|
+
@mcp.tool(
|
18
|
+
description="Get the 9-day weather forecast for Hong Kong including general situation, daily forecasts, sea and soil temperatures",
|
19
|
+
)
|
20
|
+
def get_9_day_weather_forecast(lang: str = "en") -> Dict:
|
21
|
+
return tool_weather.get_9_day_weather_forecast(lang)
|
22
|
+
|
23
|
+
@mcp.tool(
|
24
|
+
description="Get local weather forecast for Hong Kong including forecast description, outlook and update time",
|
25
|
+
)
|
26
|
+
def get_local_weather_forecast(lang: str = "en") -> Dict:
|
27
|
+
return tool_weather.get_local_weather_forecast(lang)
|
28
|
+
|
29
|
+
@mcp.tool(
|
30
|
+
description="Get weather warning summary for Hong Kong including warning messages and update time",
|
31
|
+
)
|
32
|
+
def get_weather_warning_summary(lang: str = "en") -> Dict:
|
33
|
+
return tool_weather.get_weather_warning_summary(lang)
|
34
|
+
|
35
|
+
@mcp.tool(
|
36
|
+
description="Get detailed weather warning information for Hong Kong including warning statement and update time",
|
37
|
+
)
|
38
|
+
def get_weather_warning_info(lang: str = "en") -> Dict:
|
39
|
+
return tool_weather.get_weather_warning_info(lang)
|
40
|
+
|
41
|
+
@mcp.tool(
|
42
|
+
description="Get special weather tips for Hong Kong including tips list and update time",
|
43
|
+
)
|
44
|
+
def get_special_weather_tips(lang: str = "en") -> Dict:
|
45
|
+
return tool_weather.get_special_weather_tips(lang)
|
46
|
+
|
47
|
+
@mcp.tool(
|
48
|
+
description="Get latest 10-minute mean visibility data for Hong Kong",
|
49
|
+
)
|
50
|
+
def get_visibility_data(lang: str = "en", rformat: str = "json") -> Dict:
|
51
|
+
return tool_weather.get_visibility_data(lang, rformat)
|
52
|
+
|
53
|
+
@mcp.tool(
|
54
|
+
description="Get cloud-to-ground and cloud-to-cloud lightning count data",
|
55
|
+
)
|
56
|
+
def get_lightning_data(lang: str = "en", rformat: str = "json") -> Dict:
|
57
|
+
return tool_weather.get_lightning_data(lang, rformat)
|
58
|
+
|
59
|
+
@mcp.tool(
|
60
|
+
description="Get times of moonrise, moon transit and moonset",
|
61
|
+
)
|
62
|
+
def get_moon_times(
|
63
|
+
year: int,
|
64
|
+
month: Optional[int] = None,
|
65
|
+
day: Optional[int] = None,
|
66
|
+
lang: str = "en",
|
67
|
+
rformat: str = "json"
|
68
|
+
) -> Dict:
|
69
|
+
return tool_weather.get_moon_times(
|
70
|
+
year=year,
|
71
|
+
month=month,
|
72
|
+
day=day,
|
73
|
+
lang=lang,
|
74
|
+
rformat=rformat
|
75
|
+
)
|
76
|
+
|
77
|
+
@mcp.tool(
|
78
|
+
description="Get hourly heights of astronomical tides for a specific station in Hong Kong",
|
79
|
+
)
|
80
|
+
def get_hourly_tides(
|
81
|
+
station: str,
|
82
|
+
year: int,
|
83
|
+
month: Optional[int] = None,
|
84
|
+
day: Optional[int] = None,
|
85
|
+
hour: Optional[int] = None,
|
86
|
+
lang: str = "en",
|
87
|
+
rformat: str = "json"
|
88
|
+
) -> Dict:
|
89
|
+
return tool_weather.get_hourly_tides(
|
90
|
+
station=station,
|
91
|
+
year=year,
|
92
|
+
month=month,
|
93
|
+
day=day,
|
94
|
+
hour=hour,
|
95
|
+
lang=lang,
|
96
|
+
rformat=rformat
|
97
|
+
)
|
98
|
+
|
99
|
+
@mcp.tool(
|
100
|
+
description="Get times and heights of astronomical high and low tides for a specific station in Hong Kong",
|
101
|
+
)
|
102
|
+
def get_high_low_tides(
|
103
|
+
station: str,
|
104
|
+
year: int,
|
105
|
+
month: Optional[int] = None,
|
106
|
+
day: Optional[int] = None,
|
107
|
+
hour: Optional[int] = None,
|
108
|
+
lang: str = "en",
|
109
|
+
rformat: str = "json"
|
110
|
+
) -> Dict:
|
111
|
+
return tool_weather.get_high_low_tides(
|
112
|
+
station=station,
|
113
|
+
year=year,
|
114
|
+
month=month,
|
115
|
+
day=day,
|
116
|
+
hour=hour,
|
117
|
+
lang=lang,
|
118
|
+
rformat=rformat
|
119
|
+
)
|
120
|
+
|
121
|
+
@mcp.tool(
|
122
|
+
description="Get times of sunrise, sun transit and sunset for Hong Kong",
|
123
|
+
)
|
124
|
+
def get_sunrise_sunset_times(
|
125
|
+
year: int,
|
126
|
+
month: Optional[int] = None,
|
127
|
+
day: Optional[int] = None,
|
128
|
+
lang: str = "en",
|
129
|
+
rformat: str = "json"
|
130
|
+
) -> Dict:
|
131
|
+
return tool_weather.get_sunrise_sunset_times(
|
132
|
+
year=year,
|
133
|
+
month=month,
|
134
|
+
day=day,
|
135
|
+
lang=lang,
|
136
|
+
rformat=rformat
|
137
|
+
)
|
138
|
+
|
139
|
+
@mcp.tool(
|
140
|
+
description="Get Gregorian-Lunar calendar conversion data",
|
141
|
+
)
|
142
|
+
def get_gregorian_lunar_calendar(
|
143
|
+
year: int,
|
144
|
+
month: Optional[int] = None,
|
145
|
+
day: Optional[int] = None,
|
146
|
+
lang: str = "en",
|
147
|
+
rformat: str = "json"
|
148
|
+
) -> Dict:
|
149
|
+
return tool_weather.get_gregorian_lunar_calendar(
|
150
|
+
year=year,
|
151
|
+
month=month,
|
152
|
+
day=day,
|
153
|
+
lang=lang,
|
154
|
+
rformat=rformat
|
155
|
+
)
|
156
|
+
|
157
|
+
@mcp.tool(
|
158
|
+
description="Get daily mean temperature data for a specific station in Hong Kong",
|
159
|
+
)
|
160
|
+
def get_daily_mean_temperature(
|
161
|
+
station: str,
|
162
|
+
year: Optional[int] = None,
|
163
|
+
month: Optional[int] = None,
|
164
|
+
lang: str = "en",
|
165
|
+
rformat: str = "json"
|
166
|
+
) -> Dict:
|
167
|
+
return tool_weather.get_daily_mean_temperature(
|
168
|
+
station=station,
|
169
|
+
year=year,
|
170
|
+
month=month,
|
171
|
+
lang=lang,
|
172
|
+
rformat=rformat
|
173
|
+
)
|
174
|
+
|
175
|
+
@mcp.tool(
|
176
|
+
description="Get daily maximum temperature data for a specific station in Hong Kong",
|
177
|
+
)
|
178
|
+
def get_daily_max_temperature(
|
179
|
+
station: str,
|
180
|
+
year: Optional[int] = None,
|
181
|
+
month: Optional[int] = None,
|
182
|
+
lang: str = "en",
|
183
|
+
rformat: str = "json"
|
184
|
+
) -> Dict:
|
185
|
+
return tool_weather.get_daily_max_temperature(
|
186
|
+
station=station,
|
187
|
+
year=year,
|
188
|
+
month=month,
|
189
|
+
lang=lang,
|
190
|
+
rformat=rformat
|
191
|
+
)
|
192
|
+
|
193
|
+
@mcp.tool(
|
194
|
+
description="Get daily minimum temperature data for a specific station in Hong Kong",
|
195
|
+
)
|
196
|
+
def get_daily_min_temperature(
|
197
|
+
station: str,
|
198
|
+
year: Optional[int] = None,
|
199
|
+
month: Optional[int] = None,
|
200
|
+
lang: str = "en",
|
201
|
+
rformat: str = "json"
|
202
|
+
) -> Dict:
|
203
|
+
return tool_weather.get_daily_min_temperature(
|
204
|
+
station=station,
|
205
|
+
year=year,
|
206
|
+
month=month,
|
207
|
+
lang=lang,
|
208
|
+
rformat=rformat
|
209
|
+
)
|
210
|
+
|
211
|
+
@mcp.tool(
|
212
|
+
description="Get weather and radiation level report for Hong Kong",
|
213
|
+
)
|
214
|
+
def get_weather_radiation_report(
|
215
|
+
date: Optional[str] = None,
|
216
|
+
station: Optional[str] = None,
|
217
|
+
lang: str = "en",
|
218
|
+
rformat: str = "json"
|
219
|
+
) -> Dict:
|
220
|
+
return tool_weather.get_weather_radiation_report(
|
221
|
+
date=date,
|
222
|
+
station=station,
|
223
|
+
lang=lang,
|
224
|
+
rformat=rformat
|
225
|
+
)
|
226
|
+
|
227
|
+
return mcp
|
228
|
+
|
229
|
+
def main():
|
230
|
+
parser = argparse.ArgumentParser(description='HKO MCP Server')
|
231
|
+
parser.add_argument('-s', '--sse', action='store_true',
|
232
|
+
help='Run in SSE mode instead of stdio')
|
233
|
+
args = parser.parse_args()
|
234
|
+
|
235
|
+
server = create_mcp_server()
|
236
|
+
|
237
|
+
if args.sse:
|
238
|
+
server.run(transport="streamable-http")
|
239
|
+
print("HKO MCP Server running in SSE mode on port 8000")
|
240
|
+
else:
|
241
|
+
server.run()
|
242
|
+
print("HKO MCP Server running in stdio mode")
|
243
|
+
|
244
|
+
if __name__ == "__main__":
|
245
|
+
main()
|