MCP server with basic demonstration of getting weather from Hong Kong Observatory
This MCP server provides access to Hong Kong Observatory weather data APIs. It implements various tools that allow clients to retrieve weather forecasts, earthquake information, tide data, and other meteorological information through the Model Context Protocol.
prompt:
what is the weather in next Wed ?
prompt:
what is the weather now ?
npm install
npm run inspect
npm run build
npm test
npm run test:watch
Comprehensive tests have been created for all API functions. See docs/TESTING.md for details.
{
"mcpServers": {
"mcp-hko": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"github:louiscklaw/mcp-hko"
]
}
}
}
{
"mcpServers": {
"mcp-hko-docker": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp-hko:latest"],
"name": "mcp-hko (Docker)",
}
}
}
src/
- Server source codesrc/lib/
- API implementation modulesdocumentation/
- API documentation and test casesscripts/
- Development utilitiessrc/tests/
- Test filesThe MCP server is built on the FastMCP framework and implements various tools that correspond to Hong Kong Observatory APIs. The architecture is shown in two diagrams for better readability:
flowchart TD
subgraph REQ01xx[Weather Forecasts & Warnings]
direction BT
B1[9-day Forecast]
B2[Current Weather]
B3[Local Forecast]
B4[Warning Info]
B5[Warning Summary]
B6[Special Weather Tips]
end
flowchart TD
subgraph REQ02xx[Earthquake Information]
C1[Quick Earthquake]
C2[Felt Earthquake]
end
flowchart TD
subgraph REQ03xx[Tides, Astronomy & Climate]
D1[Tide: HHOT]
D2[Tide: HLT]
D3[Sunrise/Sunset: SRS]
D4[Lightning: LHL]
D5[Visibility: LTMV]
D6[Temperature: CLMTEMP]
D7[Max Temperature: CLMMAXT]
D8[Min Temperature: CLMMINT]
D9[Radiation: RYES]
end
flowchart TD
subgraph REQ04xx[Lunar Calendar]
E1[Lunar Date]
end
flowchart TD
subgraph REQ05xx[Rainfall]
F1[Hourly Rainfall]
end