logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

caiyun-weather-mcp-adapter

A Model Context Protocol (MCP) service interface designed to fetch comprehensive meteorological readings from the Caiyun Weather platform. It delivers granular atmospheric details, including ambient temperature, moisture levels, wind velocity, barometric pressure readings, fine-grained, minute-by-minute precipitation projections, granular hourly outlooks, extended daily forecasts, and official severe weather advisories. This utility supports queries based on geographic coordinates or textual street addresses, offering configurable localization (language) and measurement system preferences.

Author

caiyun-weather-mcp-adapter logo

marcusbai

No License

Quick Info

GitHub GitHub Stars 6
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

weathercaiyunprecipitationweather dataweather queriescaiyun weather

Caiyun Meteorological Data Interface (MCP Implementation)

smithery badge

This specialized Model Context Protocol (MCP) endpoint connects to the Caiyun Weather service API, facilitating robust access to environmental condition metrics.

Core Capabilities

  • Current Conditions Retrieval: Access to instantaneous data points such as air temperature, relative humidity, air movement speed, and atmospheric pressure.
  • Precipitation Forecasting (Minute-Level): Highly localized, two-hour outlook on expected rainfall or snowfall.
  • Short-Term Prognosis (Hourly): Detailed weather predictions spanning the next 24 hours or more.
  • Extended Outlook (Daily): Multi-day weather trend projections.
  • Advisory System: Delivery of official weather hazard and warning notifications.
  • Address Resolution: Geocoding capability to translate human-readable locations into coordinates (requires optional Amap API key).
  • Internationalization: Support for major languages (e.g., Chinese and English).
  • Unit Customization: Toggle between metric (SI) and imperial measurement standards.

Deployment Instructions

Installation via Smithery CLI

To integrate this service into your local Claude desktop environment using Smithery:

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

Execution via NPX (One-off Use)

Execute directly using NPX, providing credentials via command-line argument:

bash npx caiyun-weather-mcp --api-key=YOUR_CAIYUN_API_SECRET

Alternatively, utilize environment variables for secure credential handling:

bash CAIYUN_API_KEY=YOUR_SECRET_KEY npx caiyun-weather-mcp

Source Code Installation

For developers preferring local compilation or modification:

  1. Clone Repository:

bash git clone https://github.com/marcusbai/caiyun-weather-mcp.git cd caiyun-weather-mcp

  1. Dependency Resolution:

bash npm install

Prerequisite Notice: Successful operation mandates the presence of the Model Context Protocol (MCP) SDK within the execution runtime environment, typically supplied by the hosting application (e.g., Claude).

  1. Compilation:

bash npm run build

Configuration Requirements

Prior activation necessitates the Caiyun Weather API credentials. Address lookup functionality additionally requires an Amap API token.

Caiyun Weather API Key Acquisition

  1. Navigate to the Caiyun Weather Developer Portal
  2. Authenticate and register a new application.
  3. Secure the unique API access token.

Amap API Key (Optional for Geocoding)

  1. Visit the Amap Open Platform
  2. Register and generate an API key.
  3. Ensure the 'Geocoding' service feature is explicitly enabled for this key.

MCP Server Configuration Definition

Modify your environment's MCP configuration manifest to incorporate this weather adapter:

{ "mcpServers": { "caiyun-weather": { "command": "node", "args": ["/path/to/caiyun-weather-mcp/dist/index.js"], "env": { "CAIYUN_API_KEY": "Your_Acquired_Caiyun_Key", "AMAP_API_KEY": "Your_Optional_Amap_Key" }, "disabled": false, "autoApprove": [] } } }

If installation was managed via NPX, use this corresponding setup:

{ "mcpServers": { "caiyun-weather": { "command": "npx", "args": ["caiyun-weather-mcp"], "env": { "CAIYUN_API_KEY": "Your_Acquired_Caiyun_Key", "AMAP_API_KEY": "Your_Optional_Amap_Key" }, "disabled": false, "autoApprove": [] } } }

Utilization Examples (Tool Invocation)

Query by Geographic Coordinates

caiyun-weather get_weather_by_location { "longitude": 116.3976, "latitude": 39.9075, "daily_steps": 5, "hourly_steps": 24, "language": "zh_CN", "unit": "metric" }

Query by Textual Address

caiyun-weather get_weather_by_address { "address": "Haidian District, Beijing", "daily_steps": 5, "hourly_steps": 24, "language": "zh_CN", "unit": "metric" }

Fetching Current Meteorological Snapshot

caiyun-weather get_realtime_weather { "longitude": 116.3976, "latitude": 39.9075, "language": "zh_CN", "unit": "metric" }

Retrieving Minute-Level Precipitation Forecast

caiyun-weather get_minutely_forecast { "longitude": 116.3976, "latitude": 39.9075, "language": "zh_CN", "unit": "metric" }

Obtaining Hourly Projections

caiyun-weather get_hourly_forecast { "longitude": 116.3976, "latitude": 39.9075, "hourly_steps": 24, "language": "zh_CN", "unit": "metric" }

Acquiring Daily Forecast Data

caiyun-weather get_daily_forecast { "longitude": 116.3976, "latitude": 39.9075, "daily_steps": 5, "language": "zh_CN", "unit": "metric" }

Fetching Severe Weather Advisories

caiyun-weather get_weather_alert { "longitude": 116.3976, "latitude": 39.9075, "language": "zh_CN", "unit": "metric" }

Parameter Definitions

Global Parameters

  • longitude: The east/west coordinate value.
  • latitude: The north/south coordinate value.
  • address: Textual location string (utilized exclusively by get_weather_by_address).
  • daily_steps: Defines the scope of the daily report (Range: 1 to 15 days; Default: 5).
  • hourly_steps: Determines the count of hourly data points to retrieve (Range: 1 to 360 hours; Default: 24).
  • language: Locale setting for output (zh_CN or en_US; Default: zh_CN).
  • unit: Measurement system selection (metric or imperial; Default: metric).

License

MIT

WIKIPEDIA: XMLHttpRequest (XHR) is an API in the form of a JavaScript object whose methods transmit HTTP requests from a web browser to a web server. The methods allow a browser-based application to send requests to the server after page loading is complete, and receive information back. XMLHttpRequest is a component of Ajax programming. Prior to Ajax, hyperlinks and form submissions were the primary mechanisms for interacting with the server, often replacing the current page with another one.

== History == The concept behind XMLHttpRequest was conceived in 2000 by the developers of Microsoft Outlook. The concept was then implemented within the Internet Explorer 5 browser (1999). However, the original syntax did not use the XMLHttpRequest identifier. Instead, the developers used the identifiers ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer 7 (2006), all browsers support the XMLHttpRequest identifier. The XMLHttpRequest identifier is now the de facto standard in all the major browsers, including Mozilla's Gecko layout engine (2002), Safari 1.2 (2004) and Opera 8.0 (2005).

=== Standards === The World Wide Web Consortium (W3C) published a Working Draft specification for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C published the Working Draft Level 2 specification. Level 2 added methods to monitor event progress, allow cross-site requests, and handle byte streams. At the end of 2011, the Level 2 specification was absorbed into the original specification. At the end of 2012, the WHATWG took over development and maintains a living document using Web IDL.

== Usage == Generally, sending a request with XMLHttpRequest has several programming steps.

Create an XMLHttpRequest object by calling a constructor: Call the "open" method to specify the request type, identify the relevant resource, and select synchronous or asynchronous operation: For an asynchronous request, set a listener that will be notified when the request's state changes: Initiate the request by calling the "send" method: Respond to state changes in the event listener. If the server sends response data, by default it is captured in the "responseText" property. When the object stops processing the response, it changes to state 4, the "done" state. Aside from these general steps, XMLHttpRequest has many options to control how the request is sent and how the response is processed. Custom header fields can be added to the request to indicate how the server should fulfill it, and data can be uploaded to the server by providing it in the "send" call. The response can be parsed from the JSON format into a readily usable JavaScript object, or processed gradually as it arrives rather than waiting for the entire text. The request can be aborted prematurely or set to fail if not completed in a specified amount of time.

== Cross-domain requests ==

In the early development of the World Wide Web, it was found possible to brea

See Also

`