彩云气象MCP服务器
安装说明
在进行任何操作之前,请确保您可以访问API。您可以在以下网址申请 https://docs.caiyunapp.com/weather-api/.
先安装uv。
MacOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh窗户:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"使用Claude Desktop进行设置
# claude_desktop_config.json
# Can find location through:
# Hamburger Menu -> File -> Settings -> Developer -> Edit Config
{
"mcpServers": {
"caiyun-weather": {
"command": "uvx",
"args": ["mcp-caiyun-weather"],
"env": {
"CAIYUN_WEATHER_API_TOKEN": "YOUR_API_KEY_HERE"
}
}
}
}问克劳德一个关于天气的问题
例如:“现在北京的天气怎么样?”
本地/开发设置说明
使用Claude Desktop进行设置
# claude_desktop_config.json
# Can find location through:
# Hamburger Menu -> File -> Settings -> Developer -> Edit Config
{
"mcpServers": {
"caiyun-weather": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-caiyun-weather",
"run",
"mcp-caiyun-weather"
],
"env": {
"CAIYUN_WEATHER_API_TOKEN": "YOUR_API_TOKEN_HERE"
}
}
}
}调试
运行:
npx @modelcontextprotocol/inspector \
uv \
--directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/mcp-caiyun-weather \
run \
mcp-caiyun-weather可用工具
get_realtime_weather:获取特定位置的实时天气数据
- 参数: - lng:位置的经度 - lat:位置的纬度 - 返回详细信息,包括: - 温度 - 湿度 - 风速与风向 - 降水强度 - 空气质量指标(PM2.5、PM10、O3、SO2、NO2、CO) - AQI(中国和美国标准) - 寿命指数(紫外线和舒适度)
get_hourly_forecast:获取未来72小时的每小时天气预报
- 参数: - lng:位置的经度 - lat:位置的纬度 - 返回每小时预测,包括: - 温度 - 天气情况 - 降雨概率 - 风速与风向
get_weekly_forecast:获取未来7天的每日天气预报
- 参数: - lng:位置的经度 - lat:位置的纬度 - 返回每日预测,包括: - 温度范围(最小/最大) - 天气情况 - 降雨概率
get_historical_weather:获取过去24小时的历史天气数据
- 参数: - lng:位置的经度 - lat:位置的纬度 - 返回历史数据,包括: - 温度 - 天气情况
get_weather_alerts:获取特定位置的天气警报
- 参数: - lng:位置的经度 - lat:位置的纬度 - 返回天气警报,包括: - 警报标题 - 警报代码 - 警戒状态 - 警报说明
注意:所有工具都需要在环境变量中设置有效的彩云天气API令牌 CAIYUN_WEATHER_API_TOKEN.

