hko-mcp(又称 mcp-hko)是一个基于 Model Context Protocol(MCP)的服务器,旨在提供对香港天文台天气数据 API 的访问。它实现了多种工具,允许客户端通过 MCP 检索天气预报、地震信息、潮汐数据及其他气象信息。
主要能力
该服务器提供的天气数据工具包括:
- 9-day Weather Forecast (fnd)
- Current Weather Report (rhrread)
- Local Weather Forecast (flw)
- Weather Warning Information (warningInfo)
- Weather Warning Summary (warnsum)
- Special Weather Tips (swt)
- Quick Earthquake Messages (qem)
- Locally Felt Earth Tremor Report (feltearthquake)
- Tide Information (HHOT, HLT)
- Astronomical Data (SRS, lunardate)
- Lightning and Visibility Data (LHL, LTMV)
- Temperature Records (CLMTEMP, CLMMAXT, CLMMINT)
- Radiation Level Reports (RYES)
- Rainfall Data (hourlyrainfall)
使用方式
用户可以通过自然语言查询使用这些工具,例如:
- 获取9天天气预报:询问“what is the weather in next Wed ?”
- 获取当前天气报告:询问“what is the weather now ?”
开发与配置
项目包含开发设置说明,包括安装依赖、启动 MCP 开发服务器、构建 MCP 服务器以及在监视模式下运行测试。已为所有 API 函数创建了全面的测试,详情参见 docs/TESTING.md。项目还提供了针对 Claude Desktop 和 Docker 的配置说明。
项目结构
- src/:服务器源代码
- src/lib/:API 实现模块
- documentation/:API 文档和测试用例
- scripts/:开发实用工具
- src/tests/:测试文件
服务器架构
MCP 服务器基于 FastMCP 框架构建,实现了与香港天文台 API 对应的各种工具。架构通过两个图表展示:服务器概览和详细工具结构。
限制
目前资料未提供关于收费、价格、平台限制或具体使用效果的信息。