彩云天气

# 彩云天气 MCP 服务器 ## 设置说明

weather-services

2.4k 查看 · 2026-07-07 更新

简介

彩云天气 MCP 服务器

设置说明

简介

彩云天气 MCP 服务器

设置说明

彩云天气 MCP 服务器

设置说明

在开始之前,请确保您已经获得了 API 访问权限。您可以在 https://docs.caiyunapp.com/weather-api/ 申请。

首先安装 uv。

MacOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

使用 Claude 桌面版设置

# 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 提出需要天气信息的问题

例如:"北京现在的天气怎么样?"

本地/开发环境设置说明

使用 Claude 桌面版设置

# 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: 地点的纬度
    • 返回天气警报包括:
      • 警报标题
      • 警报代码
      • 警报状态
      • 警报描述

注意:所有工具都需要在环境变量 CAIYUN_WEATHER_API_TOKEN 中设置有效的彩云天气 API 令牌。

工具列表

  • get_realtime_weather: Get the realtime weather for a location.

  • get_hourly_forecast: Get hourly weather forecast for the next 72 hours.

  • get_weekly_forecast: Get daily weather forecast for the next 7 days.

  • get_historical_weather: Get historical weather data for the past 24 hours.

  • get_weather_alerts: Get weather alerts for the location.

服务配置

[{'mcpServers': {'caiyun-weather': {'args': ['mcp-caiyun-weather'], 'command': 'uvx'}}}]

来源