Caiyun Weather MCP server

Integrates with Caiyun Weather API to provide real-time weather data and forecasts based on geographic coordinates or location names for travel planning and outdoor activities.
Back to servers
Setup instructions
Provider
Marcus Bai
Release date
Mar 31, 2025
Language
TypeScript
Package
Stats
8 downloads
5 stars

This MCP server leverages the Caiyun Weather API to provide comprehensive weather data queries. It offers real-time weather information, precipitation forecasts, hourly and daily weather predictions, weather alerts, and supports location-based weather lookups.

Installation

Via Smithery

The easiest way to install the Caiyun Weather MCP server is through Smithery:

npm install @smithery/cli -g
smithery install @pepperai/caiyun-weather-mcp

Manual Installation

Alternatively, you can install it manually:

  1. Clone the repository:
git clone https://github.com/marcusbai/caiyun-weather-mcp.git
cd caiyun-weather-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

Before using the server, you need to configure API keys.

Obtain API Keys

  1. Caiyun Weather API Key (Required)

  2. Amap API Key (Optional, for address lookup)

    • Visit the Amap Open Platform
    • Register and log in
    • Create an application and enable the "Geocoding" service
    • Obtain the API key

Configure MCP Settings

Edit your MCP settings file and add the Caiyun Weather MCP server configuration:

{
  "mcpServers": {
    "caiyun-weather": {
      "command": "node",
      "args": ["full/path/to/caiyun-weather-mcp/dist/index.js"],
      "env": {
        "CAIYUN_API_KEY": "your-caiyun-api-key",
        "AMAP_API_KEY": "your-amap-api-key-optional"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Usage Examples

Get Weather by Location (Coordinates)

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_weather_by_location</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "daily_steps": 5,
  "hourly_steps": 24,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Weather by Address

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_weather_by_address</tool_name>
<arguments>
{
  "address": "Haidian District, Beijing",
  "daily_steps": 5,
  "hourly_steps": 24,
  "language": "en_US",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Real-time Weather Data

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_realtime_weather</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Minute-level Precipitation Forecast

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_minutely_forecast</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Hourly Weather Forecast

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_hourly_forecast</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "hourly_steps": 24,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Daily Weather Forecast

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_daily_forecast</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "daily_steps": 5,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Get Weather Alert Information

<use_mcp_tool>
<server_name>caiyun-weather</server_name>
<tool_name>get_weather_alert</tool_name>
<arguments>
{
  "longitude": 116.3976,
  "latitude": 39.9075,
  "language": "zh_CN",
  "unit": "metric"
}
</arguments>
</use_mcp_tool>

Parameter Reference

Common Parameters

  • longitude: Longitude coordinate
  • latitude: Latitude coordinate
  • address: Address string (only for get_weather_by_address)
  • daily_steps: Number of days for daily forecast (1-15, default: 5)
  • hourly_steps: Number of hours for hourly forecast (1-360, default: 24)
  • language: Language setting (zh_CN or en_US, default: zh_CN)
  • unit: Unit system (metric or imperial, default: metric)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "caiyun-weather" '{"command":"node","args":["\u5b8c\u6574\u8def\u5f84/caiyun-weather-mcp/dist/index.js"],"env":{"CAIYUN_API_KEY":"\u60a8\u7684\u5f69\u4e91\u5929\u6c14API\u5bc6\u94a5","AMAP_API_KEY":"\u60a8\u7684\u9ad8\u5fb7\u5730\u56feAPI\u5bc6\u94a5\uff08\u53ef\u9009\uff09"},"disabled":false,"autoApprove":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "caiyun-weather": {
            "command": "node",
            "args": [
                "\u5b8c\u6574\u8def\u5f84/caiyun-weather-mcp/dist/index.js"
            ],
            "env": {
                "CAIYUN_API_KEY": "\u60a8\u7684\u5f69\u4e91\u5929\u6c14API\u5bc6\u94a5",
                "AMAP_API_KEY": "\u60a8\u7684\u9ad8\u5fb7\u5730\u56feAPI\u5bc6\u94a5\uff08\u53ef\u9009\uff09"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "caiyun-weather": {
            "command": "node",
            "args": [
                "\u5b8c\u6574\u8def\u5f84/caiyun-weather-mcp/dist/index.js"
            ],
            "env": {
                "CAIYUN_API_KEY": "\u60a8\u7684\u5f69\u4e91\u5929\u6c14API\u5bc6\u94a5",
                "AMAP_API_KEY": "\u60a8\u7684\u9ad8\u5fb7\u5730\u56feAPI\u5bc6\u94a5\uff08\u53ef\u9009\uff09"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later