Agricultural Commodity Climate

by apifyforge

131 downloads
Not rated
GitHub Website

About

Agricultural commodity climate risk intelligence for AI agents via the Model Context Protocol. This MCP server gives any AI assistant — Claude, GPT-4, Cursor, or a custom agent — direct access to live weather stress analysis, pest emergence monitoring, trade concentration scoring

Details

Author
apifyforge
Downloads
131
Categories
AI

- Weather Stress Index (0–100) from NOAA alerts, forecasts, and GDACS disasters
- Pest Emergence Score (0–100) using GBIF species observations and World Bank vulnerability
- Trade Disruption Score with Herfindahl-Hirschman Index (HHI) from UN COMTRADE
- Price Shock Probability (0–100) from FRED trends, weather/disaster supply shocks, and trade concentration
- Composite Commodity Risk Score (0–100) weighted across all four models with CRITICAL override
- Parallel data fetching via Promise.all and standby mode for low-latency agent workflows
- Per-tool spending limits and built-in proxy/retry infrastructure

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Agricultural Commodity Climate
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Add the server to your MCP client by configuring the URL https://ryanclinton--agricultural-commodity-climate-mcp.apify.actor/mcp in your MCP settings JSON. Then invoke any of the seven available tools (e.g., crop_region_risk_assessment) via your AI agent or programmatically via the Apify API. Each tool call costs $0.045 and returns results in 30–90 seconds.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "agricultural commodity climate": {
            "agricultural-commodity-climate-mcp": {
                "url": "https://ryanclinton--agricultural-commodity-climate-mcp.apify.actor/mcp"
            }
        }
    }
}

McpServers

{
    "agricultural-commodity-climate-mcp": {
        "url": "https://ryanclinton--agricultural-commodity-climate-mcp.apify.actor/mcp"
    }
}

Agricultural Commodity Climate MCP Server

> View on ApifyForge | Use on Apify Store

---

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf):

{
  "mcpServers": {
    "agricultural-commodity-climate-mcp": {
      "url": "https://ryanclinton--agricultural-commodity-climate-mcp.apify.actor/mcp"
    }
  }
}

---

Agricultural commodity climate risk intelligence for AI agents via the Model Context Protocol. This MCP server gives any AI assistant — Claude, GPT-4, Cursor, or a custom agent — direct access to live weather stress analysis, pest emergence monitoring, trade concentration scoring, and price shock probability for any crop or growing region on Earth.

The server orchestrates 8 public data sources in parallel: NOAA weather alerts, multi-day forecasts, GDACS disaster events, UN COMTRADE trade flows, World Bank agricultural indicators, GBIF biodiversity occurrence records, FRED commodity price series, and Nominatim geocoding. It synthesises these into four quantified scoring models and a composite Commodity Risk Score (0–100) with actionable recommendations. No API keys for downstream sources are required — the server handles all orchestration.

⬇️ What data can you access?

| Data Point | Source | Coverage |
|---|---|---|
| 📡 Severe weather alerts (drought, flood, frost, heat, hurricane) | NOAA Weather Alerts | US and global |
| 🌡 Temperature extremes and precipitation forecasts | Weather Forecast Search | Global locations |
| 🌊 Active disasters with agricultural impact (flood, cyclone, drought) | GDACS Disaster Alerts | Worldwide, near real-time |
| 🚢 Commodity trade flows by HS code and partner country | UN COMTRADE | 200+ countries |
| 📊 Agricultural GDP share, cereal yields, food production indices | World Bank Indicators | 200+ countries |
| 🦟 Pest and disease species occurrence and spread velocity | GBIF Biodiversity | 2B+ occurrence records |
| 💹 Commodity price indices, food CPI, and price trend series | FRED Economic Data | All major commodities |
| 📍 Growing region geocoding and coordinate resolution | Nominatim Geocoder | Global coverage |

MCP Tools

| Tool | Price | Data Sources | Description |
|---|---|---|---|
| crop_region_risk_assessment | $0.045 | NOAA + Forecast + GDACS + Nominatim | Assess crop region weather risk: severe alerts, temperature extremes, drought indicators, disaster exposure. Returns Weather Stress Index with signals. |
| weather_yield_threat_monitor | $0.045 | NOAA + Forecast + GDACS | Monitor weather threats to crop yields: drought, frost, flood, heat stress. Returns yield threat score and level. |
| pest_emergence_alert | $0.045 | GBIF + World Bank | Detect pest and disease emergence. GBIF species observations scored for invasive keywords; World Bank agricultural vulnerability overlaid. |
| trade_dependency_analysis | $0.045 | UN COMTRADE + FRED | Analyze commodity trade dependency with HHI partner concentration, price volatility, and supply chain concentration scoring. |
| price_shock_probability | $0.045 | FRED + NOAA + GDACS + COMTRADE | Estimate price shock probability from FRED price trends, weather supply disruption signals, and trade flow concentration. |
| growing_season_forecast | $0.045 | Forecast + NOAA + Nominatim | Forecast growing season conditions: temperature patterns, precipitation outlook, frost/heat risk windows. |
| food_security_vulnerability | $0.045 | World Bank + COMTRADE + GDACS + FRED | Assess national food security vulnerability: agricultural GDP dependency, trade concentration, disaster exposure, food price inflation. |
| compare_commodity_risks | $0.045 | All 8 sources | Full composite analysis. Runs all four scoring models and returns Commodity Risk Score (0–100) with verdict and hedging recommendations. |

Why use Agricultural Commodity Climate MCP?

Commodity buyers, traders, underwriters, and food security analysts face the same problem: relevant risk signals are scattered across NOAA, GDACS, COMTRADE, FRED, and GBIF — all in different formats, all requiring separate queries. Building a unified view manually takes hours. By the time the data is assembled, weather conditions have shifted.

This MCP server puts all eight sources into a single tool call. Ask your AI agent "What is the wheat price shock probability given current Kansas growing conditions?" and it runs FRED price analysis, NOAA weather alerts, GDACS disaster checks, and COMTRADE concentration scoring simultaneously, returning a scored result in 30–90 seconds.

- Scheduling — run daily growing region checks and push results to your risk dashboard on Apify Schedules
- API access — trigger tool calls from Python, JavaScript, or any HTTP client via the Apify API
- Proxy infrastructure — all downstream data source calls use Apify's built-in proxy and retry infrastructure
- Monitoring — get Slack or email alerts when weather stress scores exceed thresholds via Apify Webhooks
- Integrations — pipe results to Zapier, Make, Google Sheets, trading systems, or HubSpot

Features

- Weather Stress Index (0–100) — scores growing regions across four components: NOAA severe crop-threat alerts (drought, flood, frost, freeze, heat, hail, tornado, hurricane, wildfire), forecast temperature extremes above 38°C or below freezing, GDACS agricultural-impact disasters, and compound weather stress when multiple factors coincide
- 9 crop-threat alert categories — the alert parser matches against: drought, flood, frost, freeze, heat, hail, tornado, hurricane, and wildfire for targeted crop relevance
- Pest Emergence Score (0–100) — uses GBIF species occurrence records to detect 10 invasive agricultural threat keywords: locust, armyworm, borer, weevil, aphid, rust, blight, fusarium, phytophthora, and whitefly; overlays World Bank cereal yield and agricultural GDP data for vulnerability amplification
- Spread velocity detection — filters GBIF observations from 2024 onward to distinguish active spread from historical records
- Trade Disruption Score with HHI — computes Herfindahl-Hirschman Index from UN COMTRADE partner trade values; HHI above 2,500 triggers concentrated supply chain signal; identifies 2-partner critical dependencies
- FRED price volatility model — detects period-over-period changes above 5% and 15% thresholds; compares recent third of price history against earlier third to identify trend direction
- Price Shock Probability (0–100) — four-component model: FRED price trend analysis, weather/disaster supply risk factor count, trade flow concentration, and compound shock probability when multiple factors align
- Composite Commodity Risk Score — weighted average: weather stress 30%, price shock 30%, trade disruption 25%, pest emergence 15%; override to CRITICAL when crop failure risk and imminent price shock both present
- Five-level verdict scale — LOW_RISK / MANAGEABLE / ELEVATED / HIGH_RISK / CRITICAL with hedge recommendations auto-generated at each threshold
- Parallel data fetching — all upstream actor calls run via Promise.all, reducing 8 sequential calls to concurrent fetch; each sub-actor allocated 512 MB and 120-second timeout
- Per-tool spending limits — each tool checks eventChargeLimitReached before running; never over-spends the budget cap you set at run time
- Standby mode operation — server runs persistently on Apify's standby infrastructure, eliminating cold-start latency for agent workflows

Use cases for agricultural commodity risk analysis

Commodity trading and futures desks

Traders managing wheat, soybeans, corn, or coffee positions need early warning of supply disruptions before they materialize in price. Run price_shock_probability each morning on your active commodity positions. The FRED trend analysis combined with NOAA and GDACS supply disruption signals gives a quantified probability of a price move before exchange open.

Crop insurance underwriting

Underwriters pricing weather-index insurance products need a current Weather Stress Index for each insured region. Call crop_region_risk_assessment to get a scored assessment for a specific growing region, pulling NOAA alerts, multi-day forecasts, and GDACS disaster events into a single 0–100 score. The signals output tells you which specific conditions are driving the risk.

Food company supply chain planning

Procurement teams running just-in-time commodity supply chains need to know their supplier concentration risk before a weather event hits. Use trade_dependency_analysis to compute the HHI concentration score for each commodity. When HHI exceeds 2,500, you have a concentrated dependency that warrants safety stock or alternative supplier qualification.

Agricultural investment portfolio management

Portfolio managers allocating across commodity-linked equities or structured products need comparable risk metrics across different crops. compare_commodity_risks returns the full composite Commodity Risk Score for any commodity, enabling apples-to-apples comparison of wheat vs. soybeans vs. palm oil risk in a single call.

Government and NGO food security monitoring

Food security analysts in international organizations need country-level vulnerability assessments combining trade dependency, agricultural GDP share, and disaster exposure. food_security_vulnerability queries World Bank agricultural indicators, COMTRADE food import data, GDACS recent disasters, and FRED food price series for any country and returns a composite assessment with actionable signals.

Pest and invasive species early warning

Crop protection teams and agricultural extension services can use pest_emergence_alert to detect emerging pest and disease pressure in any growing region. GBIF observation data for locusts, armyworms, rust fungi, Phytophthora, and other crop pathogens is filtered for recent spread velocity and cross-referenced against regional agricultural vulnerability.

How the scoring models work

Weather Stress Index

The scoreWeatherStress function builds a 100-point score across four components. NOAA alerts are scanned for 9 crop-threat event types; each matching alert adds 5 points and each extreme/severe severity rating adds an additional point, capped at 30. Forecast data is parsed for temperature extremes above 38°C (approximate crop heat damage threshold) and below 0°C (frost), with drought indicators triggered when high temperatures exceed 35°C and precipitation is below 1mm; capped at 25. GDACS events are filtered for flood, drought, cyclone, and storm event types and red/orange alert levels; capped at 25. A compound bonus of up to 20 points is awarded when both severe alerts and temperature extremes are present, or when drought indicators and active disasters co-occur. The final score maps to: FAVORABLE (0–19), MILD_STRESS (20–39), MODERATE_STRESS (40–59), SEVERE (60–79), CROP_FAILURE_RISK (80–100).

Pest Emergence Score

scorePestEmergence queries GBIF species occurrence records and scans scientific names against 10 invasive pest/pathogen keywords. Each invasive species detection adds 8 points, capped at 40 via the species component. World Bank indicators are checked for agricultural-GDP-share above 20%, cereal yields below 2,000 kg/ha, and low arable land percentage to score regional agricultural vulnerability; capped at 30. Spread velocity is measured by filtering GBIF records with observation dates from 2024 onward — each recent observation adds 2 points, capped at 20. A 10-point compound bonus applies when invasive species detections and agricultural vulnerability both register. Final scale: CLEAR / LOW / MODERATE / HIGH / OUTBREAK.

Trade Disruption Score and HHI

scoreTradeDisruption extracts trade partner names and values from COMTRADE records, computes each partner's share of total trade value, and calculates the Herfindahl-Hirschman Index as the sum of squared market shares (×10,000). HHI above 2,500 triggers a concentrated supply chain signal. The HHI score is capped at 35 points. FRED price data is then scanned for period-to-period changes exceeding 5% (1 volatility point) and 15% (2 additional points), capped at 30. Trade volume and cascade risk add up to 35 more points. Final scale: DIVERSIFIED / LOW / MODERATE / CONCENTRATED / CRITICAL_DEPENDENCY.

Price Shock Probability

scorePriceShock divides FRED price series into thirds and compares the recent-third average against the earlier-third average. A 15%+ upward trend adds 3 volatile indicators; a 30%+ trend adds 3 more. Supply risk factors are counted by scanning NOAA and GDACS events for 6 crop-threat keywords (drought, flood, frost, freeze, heat, storm). Trade concentration with 3 or fewer partners adds a trade risk multiplier. A compound bonus of up to 15 points is applied when price trends and supply disruption signals co-occur. Final scale: STABLE / MILD / MODERATE / HIGH / IMMINENT.

Composite Commodity Risk Score

generateCommodityRisk combines the four models with fixed weights: weather stress 30%, price shock 30%, trade disruption 25%, pest emergence 15%. There is one hard override rule: when weatherLevel === 'CROP_FAILURE_RISK' and shockLevel === 'IMMINENT' both trigger simultaneously, the verdict is forced to CRITICAL regardless of the weighted score. Auto-generated hedge recommendations are appended when: weather score ≥ 60 (activate crop insurance), pest level = OUTBREAK (source alternative regions), HHI ≥ 2,500 (diversify supplier base), price shock score ≥ 50 (consider futures hedging), composite ≥ 55 (increase inventory buffers).

| Composite Score | Verdict | Action Signal |
|---|---|---|
| 75–100 | CRITICAL | Multiple active risk factors — supply disruption likely. Execute hedges now. |
| 55–74 | HIGH_RISK | Significant weather or trade risk, elevated price volatility. Review positions. |
| 35–54 | ELEVATED | Some risk factors present. Monitoring and contingency planning recommended. |
| 15–34 | MANAGEABLE | Stable conditions with minor risk indicators. Normal operations. |
| 0–14 | LOW_RISK | No significant risk signals detected across all four dimensions. |

How to connect this MCP server

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "agricultural-commodity-climate": {
      "url": "https://agricultural-commodity-climate-mcp.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}

Cursor, Windsurf, or Cline

In your MCP settings, add a new server with:

- URL: https://agricultural-commodity-climate-mcp.apify.actor/mcp
- Transport: Streamable HTTP
- Auth: Bearer token (your Apify API token)

Programmatic HTTP call

curl -X POST https://agricultural-commodity-climate-mcp.apify.actor/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "compare_commodity_risks",
      "arguments": {
        "commodity": "wheat",
        "region": "Kansas"
      }
    },
    "id": 1
  }'

Python (apify-client)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("ryanclinton/agricultural-commodity-climate-mcp").call(run_input={})

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.