Skip to main content
Glama
DasClown
by DasClown

🌾 crop-mcp

Smithery Python 3.10+ License: MIT GitHub stars

欧盟作物情报 MCP 服务器 — 提供 25 个欧盟国家的产量预测、市场价值及风险分析。

让 AI 智能体回答:“今年巴登-符腾堡州的小麦表现如何?按当前市场价格计算价值多少?”

pip install git+https://github.com/DasClown/CropProphEU.git
# or try it on Smithery: https://smithery.ai/servers/crop-mcp/CropProphEU

功能 (10 个 MCP 工具)

工具

功能描述

yield_and_value

新增 — 结合产量 + 市场价值 (€/ha),并提供德语或英语的简明摘要(通过 language 参数自动检测)

europe_yield_forecast

泛欧产量预测(3 种作物,25 个国家)及风险产量 (Yield-at-Risk)

crop_forecast

当前季节状况:温度、降雨、土壤湿度、干旱指数

season_comparison

将本季与历史年份进行比较

region_health

一次调用即可获取一个地区所有作物的健康状况

weather_outlook

16 天天气预报

climate_scenario

假设情景:+2°C,降雨量 -20%?

yield_forecast

模拟年份产量匹配(侧重德国)

list_regions

120 个 NUTS2 地区

list_crops

作物参数(GDD 基准、季节等)

Related MCP server: agriculture-mcp-server

快速入门

1. 安装

pip install git+https://github.com/DasClown/CropProphEU.git

2. 作为 MCP 服务器使用

通过 CLI (stdio):

crop-mcp

或通过 Python:

from crop_mcp import predict_europe_yield

result = predict_europe_yield("DE11", "DE", crop="wheat", gdd=3050, precip_mm=650)
print(f"Yield: {result['predicted_yield_t_ha']} t/ha")
print(f"Revenue: ~{result['predicted_yield_t_ha'] * 235:.0f} €/ha")

3. Claude Desktop / Cursor / 任何 MCP 客户端

添加到您的 MCP 配置文件中:

{
  "mcpServers": {
    "crop": {
      "command": "python3",
      "args": ["-m", "crop_mcp.server"]
    }
  }
}

4. HTTP 服务器(用于远程访问 / Smithery)

pip install crop-mcp[http]
crop-mcp --http --port 8080

通过 SSE 连接:http://your-server:8080/sse

5. Docker

docker build -t crop-mcp .
docker run -p 8080:8080 crop-mcp crop-mcp --http --port 8080

已验证作物

作物

Eurostat 代码

样本量

国家

MAE (LOYO)

🌾 小麦

C1100

1,483

25

11.2%

🌽 玉米

C1500

1,648

20

11.6%

🌿 大麦

C1300

1,841

25

11.3%

油菜籽和向日葵:不支持 — 无 Eurostat 产量数据。工具会明确报错拒绝(不会产生虚假信息)。


输出示例

德语(默认):

Weizen – Region DE11 (DE)
Ertrag: 7.68 t/ha (Spanne 6.67–8.63)
...

英语(使用 language="en"):

Wheat – Region DE11 (DE)
Yield: 7.68 t/ha (range 6.67–8.63)
Temperature: warm (3050°C GDD)
...

所有输出均提供德语(默认)或英语版本。调用 yield_and_value 时设置 language="en" 即可获取英语输出。JSON 数据始终以英文键名返回;summary 字段会根据请求的语言进行调整。


数据来源

来源

数据

访问方式

Eurostat

作物产量 (apro_cpshr)

免费,无需密钥

NASA POWER

GDD、降水、太阳辐射、土壤湿度

免费,无速率限制

Open-Meteo

16 天预报

免费,无需密钥

SoilGrids v2

SOC、pH、N、CEC、质地

免费 REST API

Yahoo Finance

实时 CBOT 小麦/玉米期货 + 欧元/美元汇率

免费,无需密钥


模型准确性

指标

数值

LOYO MAE (小麦)

0.598 t/ha (11.2%)

前向验证 (训练 ≤2022, 测试 2023-24)

0.794 t/ha (15.0%)

R² (LOYO)

0.877

R² (前向)

0.628

含义:LOYO 指标较为乐观,因为它使用了包括未来年份在内的所有数据进行训练。前向验证(使用 2000-2022 年数据训练,预测 2023-2024 年)是实际基准:±15%

该模型在欧盟核心国家(德国、法国、比利时、荷兰、奥地利、捷克)表现最准确,因为这些地区的训练数据密集;对于像 2024 年荷兰/比利时 这样因异常天气导致系统性高估的异常值,准确性较低。


架构

crop-mcp/
├── crop_mcp/
│   ├── server.py              # 10 MCP tools
│   ├── europe_model_api.py    # Random Forest (200 trees) + Yield-at-Risk
│   ├── market_prices.py       # Live prices via Yahoo Finance + reference
│   ├── core/regions.py        # 120 NUTS2 regions
│   └── sources/               # Weather, soil, NDVI data fetchers
├── models/                    # .pkl files (download from Releases)
├── data/                      # Training data (generated by build)
├── pyproject.toml
└── README.md

核心设计原则:

  • 无幻觉 — 每次产量预测均可追溯至已验证的 Eurostat 数据

  • 实时价格 — 通过 Yahoo Finance 获取 CBOT 小麦/玉米价格,每小时更新

  • 自动更新 — 每月通过 cron 任务使用最新的 Eurostat 数据重建模型

  • 零外部 API 密钥 — 所有数据源均为免费且公开


商业化应用

该工具目前已可用于生产环境:

  • 农业交易台 — “皮卡第地区的小麦按当前 MATIF 价格值多少钱?”

  • 农业咨询 — “本季与过去 5 年相比如何?”

  • 保险/风险 — 每个地区的风险产量 (P10/P50/P90)

  • 欧盟政策分析 — 气候情景对国家产量的影响

后续商业功能:各国市场价格、历史价格相关性、自动 PDF 报告、多年作物轮作规划。


构建与训练

# Build training data for a specific crop (25 min)
python3 build_europe.py --crop corn

# Train the model (2 min)
python3 train_europe_fast.py --crop corn

# Automatic monthly update (cron)
# Runs every 1st of the month at 06:00

许可证

MIT — 可免费使用、修改和分发。

专为需要真实、可验证作物情报的 AI 智能体而打造 ❤️。

A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
1dRelease cycle
6Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that provides real-time access to Brazilian agricultural data, including commodity prices, crop estimates, climate information, and deforestation rates. It integrates data from 19 public sources like CEPEA, CONAB, and IBGE to enable LLMs to analyze the Brazilian agribusiness sector.
    10
    26
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server for agriculture and farming data. 8 tools: soil conditions (temperature, moisture), crop weather forecasts, historical climate data (NASA POWER, since 1981), global agriculture statistics (World Bank, 20+ indicators), and food product database (Open Food Facts, 3M+ products). All APIs free, no keys required.
    8
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server providing agricultural market intelligence tools (price, margin, trend, report generation) that can be used by any MCP client to answer multi-step queries about commodity markets.
    5
    MIT

View all related MCP servers

Related MCP Connectors

  • Open-Meteo MCP — weather forecast + historical reanalysis + sister APIs

  • MCP server connecting AI agents to non-custodial staking data across 130+ networks.

  • Meteostat MCP — historical weather from 11k+ stations (no auth)

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DasClown/CropProphEU'

If you have feedback or need assistance with the MCP directory API, please join our Discord server