Back to MCP directory
publicPublicdnsLocal runtime

caiyun-weather

Caiyun天气MCP服务项目,提供实时天气、小时预报、周预报、历史天气和天气警报等功能,需通过API密钥访问。

article

README

🚀 集成指南

本集成指南将帮助你完成彩云天气API的集成,实现天气信息的获取与使用。

🚀 快速开始

在开始集成之前,请确保你已经获取了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 Desktop进行配置

claude_desktop_config.json文件中添加以下内容,具体路径可通过: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 Desktop进行配置

claude_desktop_config.json文件中添加以下内容,具体路径可通过: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(中国和美国标准)、生活指数(UV和舒适度) | | get_hourly_forecast | 获取未来72小时的逐小时天气预报 | lng(地理位置经度)、lat(地理位置纬度) | 温度、天气状况、降水概率、风速和风向 | | get_weekly_forecast | 获取未来7天的每日天气预报 | lng(地理位置经度)、lat(地理位置纬度) | 温度范围(最低/最高)、天气状况、降水概率 | | get_historical_weather | 获取过去24小时的历史天气数据 | lng(地理位置经度)、lat(地理位置纬度) | 温度、天气状况 | | get_weather_alerts | 获取指定位置的天气警报信息 | lng(地理位置经度)、lat(地理位置纬度) | 警报标题、警报代码、警报状态、警报描述 |

所有工具的使用均需提供地理位置的经纬度参数,并依赖有效的API令牌进行调用。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client