彩云天气 MCP 服务器基于彩云天气 API,遵循 Model Context Protocol (MCP),为用户提供全面且精准的天气数据查询服务。
彩云天气 MCP 服务器能为你提供丰富的天气数据。使用前,你需完成安装和配置步骤。
git clone https://github.com/marcusbai/caiyun-weather-mcp.git
cd caiyun-weather-mcp
npm install
⚠️ 重要提示
本项目依赖于 Model Context Protocol (MCP) SDK,该SDK需要在运行环境中可用。MCP SDK通常由Claude或其他支持MCP的应用程序提供。
npm run build
在使用前,需要配置彩云天气API密钥。如果需要地址查询功能,还需要配置高德地图API密钥。
完成上述配置后,将以下信息添加到 config.js
文件中:
{
"apiKey": "your_api_key", // 彩云天气 API Key
"mapKey": "your_map_key" // 高德地图 API 令牌
}
参数 | 详情 |
---|---|
lon |
经度 |
lat |
纬度 |
days |
预报天数(1 - 15,默认5) |
GET /weather/alerts?lon=120.1234&lat=30.5678 HTTP/1.1
Host: your_domain
GET /weather/current?lon=120.1234&lat=30.5678 HTTP/1.1
Host: your_domain
GET /weather/forecast?lon=120.1234&lat=30.5678&days=5 HTTP/1.1
Host: your_domain
本项目采用 MIT 许可证。