hkopenai.hk-climate-mcp-server 0.1.7__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.1.7 → hkopenai_hk_climate_mcp_server-0.3.0}/LICENSE +21 -21
- hkopenai_hk_climate_mcp_server-0.3.0/PKG-INFO +208 -0
- hkopenai_hk_climate_mcp_server-0.3.0/README.md +190 -0
- hkopenai_hk_climate_mcp_server-0.3.0/hkopenai/hk_climate_mcp_server/__init__.py +43 -0
- {hkopenai_hk_climate_mcp_server-0.1.7 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai/hk_climate_mcp_server/__main__.py +4 -4
- 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.3.0/hkopenai.hk_climate_mcp_server.egg-info/PKG-INFO +208 -0
- hkopenai_hk_climate_mcp_server-0.3.0/pyproject.toml +32 -0
- {hkopenai_hk_climate_mcp_server-0.1.7 → hkopenai_hk_climate_mcp_server-0.3.0}/setup.cfg +4 -4
- hkopenai_hk_climate_mcp_server-0.3.0/tests/test_app.py +84 -0
- {hkopenai_hk_climate_mcp_server-0.1.7 → hkopenai_hk_climate_mcp_server-0.3.0}/tests/test_tools.py +15 -15
- hkopenai_hk_climate_mcp_server-0.3.0/tests/test_weather.py +420 -0
- hkopenai_hk_climate_mcp_server-0.1.7/PKG-INFO +0 -74
- hkopenai_hk_climate_mcp_server-0.1.7/README.md +0 -56
- hkopenai_hk_climate_mcp_server-0.1.7/hkopenai/hk_climate_mcp_server/__init__.py +0 -6
- hkopenai_hk_climate_mcp_server-0.1.7/hkopenai/hk_climate_mcp_server/app.py +0 -35
- hkopenai_hk_climate_mcp_server-0.1.7/hkopenai/hk_climate_mcp_server/tool_weather.py +0 -88
- hkopenai_hk_climate_mcp_server-0.1.7/hkopenai.hk_climate_mcp_server.egg-info/PKG-INFO +0 -74
- hkopenai_hk_climate_mcp_server-0.1.7/pyproject.toml +0 -40
- hkopenai_hk_climate_mcp_server-0.1.7/tests/test_app.py +0 -48
- hkopenai_hk_climate_mcp_server-0.1.7/tests/test_weather.py +0 -155
- {hkopenai_hk_climate_mcp_server-0.1.7 → 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.1.7 → 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.1.7 → 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.1.7 → 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.1.7 → hkopenai_hk_climate_mcp_server-0.3.0}/hkopenai.hk_climate_mcp_server.egg-info/top_level.txt +0 -0
@@ -1,21 +1,21 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2025 neo@01man.com
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
13
|
-
copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 neo@01man.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1,208 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: hkopenai.hk_climate_mcp_server
|
3
|
+
Version: 0.3.0
|
4
|
+
Summary: Hong Kong Weather MCP Server providing climate and weather data tools
|
5
|
+
Author-email: Neo Chow <neo@01man.com>
|
6
|
+
License-Expression: MIT
|
7
|
+
Project-URL: repository, https://github.com/hkopenai/hk-climate-mcp-server.git
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Operating System :: OS Independent
|
10
|
+
Requires-Python: >=3.10
|
11
|
+
Description-Content-Type: text/markdown
|
12
|
+
License-File: LICENSE
|
13
|
+
Requires-Dist: fastmcp>=0.1.0
|
14
|
+
Requires-Dist: requests>=2.31.0
|
15
|
+
Requires-Dist: pytest>=8.2.0
|
16
|
+
Requires-Dist: pytest-cov>=6.1.1
|
17
|
+
Dynamic: license-file
|
18
|
+
|
19
|
+
# HK Climate and Weather MCP Server
|
20
|
+
|
21
|
+
[](https://github.com/hkopenai/hk-climate-mcp-server)
|
22
|
+
[](https://opensource.org/licenses/MIT)
|
23
|
+
|
24
|
+
|
25
|
+
This is an MCP server that provides access to climate and weather data through a FastMCP interface.
|
26
|
+
|
27
|
+
## Data Source
|
28
|
+
|
29
|
+
* Hong Kong Observatory
|
30
|
+
|
31
|
+
## Features
|
32
|
+
|
33
|
+
- Current weather: Get current weather observations from HKO (supports optional region parameter)
|
34
|
+
- 9-day forecast: Get extended weather forecast including general situation, daily forecasts, sea and soil temperatures
|
35
|
+
- Local weather forecast: Get short-term weather forecast with outlook
|
36
|
+
- Weather warnings: Get summary and detailed information about active weather warnings
|
37
|
+
- Special weather tips: Get important weather-related safety tips
|
38
|
+
|
39
|
+
## API Reference
|
40
|
+
|
41
|
+
### Current Weather
|
42
|
+
`get_current_weather(region: str = "Hong Kong Observatory") -> Dict`
|
43
|
+
- Get current weather observations for a specific region in Hong Kong
|
44
|
+
- Parameters:
|
45
|
+
- region: The region to get weather for (default: "Hong Kong Observatory")
|
46
|
+
- Returns:
|
47
|
+
- Dict containing:
|
48
|
+
- warning: Current weather warnings
|
49
|
+
- temperature: Current temperature in Celsius
|
50
|
+
- humidity: Current humidity percentage
|
51
|
+
- rainfall: Current rainfall in mm
|
52
|
+
|
53
|
+
### 9-Day Weather Forecast
|
54
|
+
`get_9_day_weather_forecast(lang: str = "en") -> Dict`
|
55
|
+
- Get the 9-day weather forecast for Hong Kong
|
56
|
+
- Parameters:
|
57
|
+
- lang: Language code (en/tc/sc, default: en)
|
58
|
+
- Returns:
|
59
|
+
- Dict containing:
|
60
|
+
- generalSituation: General weather situation
|
61
|
+
- weatherForecast: List of daily forecast dicts
|
62
|
+
- updateTime: Last update time
|
63
|
+
- seaTemp: Sea temperature info
|
64
|
+
- soilTemp: List of soil temperature info
|
65
|
+
|
66
|
+
### Local Weather Forecast
|
67
|
+
`get_local_weather_forecast(lang: str = "en") -> Dict`
|
68
|
+
- Get local weather forecast for Hong Kong
|
69
|
+
- Parameters:
|
70
|
+
- lang: Language code (en/tc/sc, default: en)
|
71
|
+
- Returns:
|
72
|
+
- Dict containing:
|
73
|
+
- forecastDesc: Forecast description
|
74
|
+
- outlook: Outlook forecast
|
75
|
+
- updateTime: Last update time
|
76
|
+
- forecastPeriod: Forecast period
|
77
|
+
- forecastDate: Forecast date
|
78
|
+
|
79
|
+
### Weather Warning Summary
|
80
|
+
`get_weather_warning_summary(lang: str = "en") -> Dict`
|
81
|
+
- Get weather warning summary for Hong Kong
|
82
|
+
- Parameters:
|
83
|
+
- lang: Language code (en/tc/sc, default: en)
|
84
|
+
- Returns:
|
85
|
+
- Dict containing:
|
86
|
+
- warningMessage: List of warning messages
|
87
|
+
- updateTime: Last update time
|
88
|
+
|
89
|
+
### Weather Warning Information
|
90
|
+
`get_weather_warning_info(lang: str = "en") -> Dict`
|
91
|
+
- Get detailed weather warning information
|
92
|
+
- Parameters:
|
93
|
+
- lang: Language code (en/tc/sc, default: en)
|
94
|
+
- Returns:
|
95
|
+
- Dict containing:
|
96
|
+
- warningStatement: Warning statement
|
97
|
+
- updateTime: Last update time
|
98
|
+
|
99
|
+
### Special Weather Tips
|
100
|
+
`get_special_weather_tips(lang: str = "en") -> Dict`
|
101
|
+
- Get special weather tips for Hong Kong
|
102
|
+
- Parameters:
|
103
|
+
- lang: Language code (en/tc/sc, default: en)
|
104
|
+
- Returns:
|
105
|
+
- Dict containing:
|
106
|
+
- specialWeatherTips: List of special weather tips
|
107
|
+
- updateTime: Last update time
|
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
|
+
|
167
|
+
## Setup
|
168
|
+
|
169
|
+
1. Clone this repository
|
170
|
+
2. Install Python dependencies:
|
171
|
+
```bash
|
172
|
+
pip install -r requirements.txt
|
173
|
+
```
|
174
|
+
3. Run the server:
|
175
|
+
```bash
|
176
|
+
python app.py
|
177
|
+
```
|
178
|
+
|
179
|
+
### Running Options
|
180
|
+
|
181
|
+
- Default stdio mode: `python app.py`
|
182
|
+
- SSE mode (port 8000): `python app.py --sse`
|
183
|
+
|
184
|
+
## Cline Integration
|
185
|
+
|
186
|
+
To connect this MCP server to Cline using stdio:
|
187
|
+
|
188
|
+
1. Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
|
189
|
+
```json
|
190
|
+
{
|
191
|
+
"hko-server": {
|
192
|
+
"disabled": false,
|
193
|
+
"timeout": 3,
|
194
|
+
"type": "stdio",
|
195
|
+
"command": "python",
|
196
|
+
"args": [
|
197
|
+
"-m",
|
198
|
+
"hkopenai.hk_climate_mcp_server"
|
199
|
+
]
|
200
|
+
}
|
201
|
+
}
|
202
|
+
```
|
203
|
+
|
204
|
+
## Testing
|
205
|
+
|
206
|
+
Tests are available in `tests`. Run with:
|
207
|
+
```bash
|
208
|
+
pytest
|
@@ -0,0 +1,190 @@
|
|
1
|
+
# HK Climate and Weather MCP Server
|
2
|
+
|
3
|
+
[](https://github.com/hkopenai/hk-climate-mcp-server)
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
5
|
+
|
6
|
+
|
7
|
+
This is an MCP server that provides access to climate and weather data through a FastMCP interface.
|
8
|
+
|
9
|
+
## Data Source
|
10
|
+
|
11
|
+
* Hong Kong Observatory
|
12
|
+
|
13
|
+
## Features
|
14
|
+
|
15
|
+
- Current weather: Get current weather observations from HKO (supports optional region parameter)
|
16
|
+
- 9-day forecast: Get extended weather forecast including general situation, daily forecasts, sea and soil temperatures
|
17
|
+
- Local weather forecast: Get short-term weather forecast with outlook
|
18
|
+
- Weather warnings: Get summary and detailed information about active weather warnings
|
19
|
+
- Special weather tips: Get important weather-related safety tips
|
20
|
+
|
21
|
+
## API Reference
|
22
|
+
|
23
|
+
### Current Weather
|
24
|
+
`get_current_weather(region: str = "Hong Kong Observatory") -> Dict`
|
25
|
+
- Get current weather observations for a specific region in Hong Kong
|
26
|
+
- Parameters:
|
27
|
+
- region: The region to get weather for (default: "Hong Kong Observatory")
|
28
|
+
- Returns:
|
29
|
+
- Dict containing:
|
30
|
+
- warning: Current weather warnings
|
31
|
+
- temperature: Current temperature in Celsius
|
32
|
+
- humidity: Current humidity percentage
|
33
|
+
- rainfall: Current rainfall in mm
|
34
|
+
|
35
|
+
### 9-Day Weather Forecast
|
36
|
+
`get_9_day_weather_forecast(lang: str = "en") -> Dict`
|
37
|
+
- Get the 9-day weather forecast for Hong Kong
|
38
|
+
- Parameters:
|
39
|
+
- lang: Language code (en/tc/sc, default: en)
|
40
|
+
- Returns:
|
41
|
+
- Dict containing:
|
42
|
+
- generalSituation: General weather situation
|
43
|
+
- weatherForecast: List of daily forecast dicts
|
44
|
+
- updateTime: Last update time
|
45
|
+
- seaTemp: Sea temperature info
|
46
|
+
- soilTemp: List of soil temperature info
|
47
|
+
|
48
|
+
### Local Weather Forecast
|
49
|
+
`get_local_weather_forecast(lang: str = "en") -> Dict`
|
50
|
+
- Get local weather forecast for Hong Kong
|
51
|
+
- Parameters:
|
52
|
+
- lang: Language code (en/tc/sc, default: en)
|
53
|
+
- Returns:
|
54
|
+
- Dict containing:
|
55
|
+
- forecastDesc: Forecast description
|
56
|
+
- outlook: Outlook forecast
|
57
|
+
- updateTime: Last update time
|
58
|
+
- forecastPeriod: Forecast period
|
59
|
+
- forecastDate: Forecast date
|
60
|
+
|
61
|
+
### Weather Warning Summary
|
62
|
+
`get_weather_warning_summary(lang: str = "en") -> Dict`
|
63
|
+
- Get weather warning summary for Hong Kong
|
64
|
+
- Parameters:
|
65
|
+
- lang: Language code (en/tc/sc, default: en)
|
66
|
+
- Returns:
|
67
|
+
- Dict containing:
|
68
|
+
- warningMessage: List of warning messages
|
69
|
+
- updateTime: Last update time
|
70
|
+
|
71
|
+
### Weather Warning Information
|
72
|
+
`get_weather_warning_info(lang: str = "en") -> Dict`
|
73
|
+
- Get detailed weather warning information
|
74
|
+
- Parameters:
|
75
|
+
- lang: Language code (en/tc/sc, default: en)
|
76
|
+
- Returns:
|
77
|
+
- Dict containing:
|
78
|
+
- warningStatement: Warning statement
|
79
|
+
- updateTime: Last update time
|
80
|
+
|
81
|
+
### Special Weather Tips
|
82
|
+
`get_special_weather_tips(lang: str = "en") -> Dict`
|
83
|
+
- Get special weather tips for Hong Kong
|
84
|
+
- Parameters:
|
85
|
+
- lang: Language code (en/tc/sc, default: en)
|
86
|
+
- Returns:
|
87
|
+
- Dict containing:
|
88
|
+
- specialWeatherTips: List of special weather tips
|
89
|
+
- updateTime: Last update time
|
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
|
+
|
149
|
+
## Setup
|
150
|
+
|
151
|
+
1. Clone this repository
|
152
|
+
2. Install Python dependencies:
|
153
|
+
```bash
|
154
|
+
pip install -r requirements.txt
|
155
|
+
```
|
156
|
+
3. Run the server:
|
157
|
+
```bash
|
158
|
+
python app.py
|
159
|
+
```
|
160
|
+
|
161
|
+
### Running Options
|
162
|
+
|
163
|
+
- Default stdio mode: `python app.py`
|
164
|
+
- SSE mode (port 8000): `python app.py --sse`
|
165
|
+
|
166
|
+
## Cline Integration
|
167
|
+
|
168
|
+
To connect this MCP server to Cline using stdio:
|
169
|
+
|
170
|
+
1. Add this configuration to your Cline MCP settings (cline_mcp_settings.json):
|
171
|
+
```json
|
172
|
+
{
|
173
|
+
"hko-server": {
|
174
|
+
"disabled": false,
|
175
|
+
"timeout": 3,
|
176
|
+
"type": "stdio",
|
177
|
+
"command": "python",
|
178
|
+
"args": [
|
179
|
+
"-m",
|
180
|
+
"hkopenai.hk_climate_mcp_server"
|
181
|
+
]
|
182
|
+
}
|
183
|
+
}
|
184
|
+
```
|
185
|
+
|
186
|
+
## Testing
|
187
|
+
|
188
|
+
Tests are available in `tests`. Run with:
|
189
|
+
```bash
|
190
|
+
pytest
|
@@ -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
|
+
]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from hkopenai.hk_climate_mcp_server.app import main
|
2
|
-
|
3
|
-
if __name__ == "__main__":
|
4
|
-
main()
|
1
|
+
from hkopenai.hk_climate_mcp_server.app import main
|
2
|
+
|
3
|
+
if __name__ == "__main__":
|
4
|
+
main()
|