Back to MCP directory
publicPublicdnsLocal runtime

agrobr-mcp

一个MCP服务器,为LLM提供实时巴西农业数据访问,包括价格、作物估算、气候、森林砍伐等10个公共来源的数据。

article

README

🚀 agrobr-mcp

agrobr-mcp 是一个MCP服务器,它能让大语言模型(LLMs)访问实时的巴西农业数据,这些数据涵盖了价格、作物预估、气候、森林砍伐等多个方面,数据来源于10个公开数据源。

Demo

PyPI Tests License: MIT Python 3.11+

🚀 快速开始

安装

pip install agrobr-mcp

配置

Claude Desktop

claude_desktop_config.json 中添加以下内容:

{
  "mcpServers": {
    "agrobr": {
      "command": "python",
      "args": ["-m", "agrobr_mcp"]
    }
  }
}

Cursor

Settings > MCP Servers > Add 中添加以下内容:

{
  "agrobr": {
    "command": "python",
    "args": ["-m", "agrobr_mcp"]
  }
}

Claude Code

claude mcp add agrobr python -- -m agrobr_mcp

⚠️ 重要提示

如果由于 -m 标志解析问题导致上述操作失败,可以创建一个包装脚本:

Linux/macOSecho 'python -m agrobr_mcp' > run.sh && chmod +x run.sh && claude mcp add agrobr ./run.sh

Windowsecho python -m agrobr_mcp > run.bat && claude mcp add agrobr run.bat

Docker

docker build -t agrobr-mcp .
docker run --rm -i agrobr-mcp

claude_desktop_config.json 中添加以下内容:

{
  "mcpServers": {
    "agrobr": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "agrobr-mcp"]
    }
  }
}

✨ 主要特性

agrobr-mcp 提供了10种工具,可分为以下几类:

价格与市场

| 工具 | 描述 | |------|-------------| | preco_diario | 农产品每日现货价格(CEPEA/ESALQ) | | futuros_b3 | B3 交易所农产品期货每日结算价格 |

生产与作物

| 工具 | 描述 | |------|-------------| | estimativa_safra | 按州划分的当前作物季节预估(CONAB/IBGE) | | producao_anual | 按州划分的历史年产量(IBGE PAM) | | balanco | 供需平衡 — 库存、消费、出口(CONAB) | | progresso_safra | 按州划分的每周种植和收获进度(CONAB) |

气候与环境

| 工具 | 描述 | |------|-------------| | clima | 按州划分的气候数据 — 温度、降水、辐射(NASA POWER) | | desmatamento | 按生物群落划分的森林砍伐率和实时警报(INPE) |

元数据

| 工具 | 描述 | |------|-------------| | listar_produtos | 列出每个工具的有效产品 | | health_check | 检查所有数据源的状态 |

💻 使用示例

以下是一些示例查询:

"Qual o preço da soja nos últimos 5 dias?"
"Estimativa de safra de milho por estado"
"Progresso da colheita de soja"
"Dados de desmatamento na Amazônia"
"Quais produtos estão disponíveis?"

🔧 技术细节

User (natural language)
    │
MCP Client (Claude Desktop / Cursor / Claude Code)
    │
agrobr-mcp (this server — thin layer, text formatting)
    │
agrobr library (data collection, parsing, caching)
    │
19 public APIs (CEPEA, CONAB, IBGE, INPE, B3, NASA POWER…)

agrobr-mcp 是一个轻量级包装器,所有数据逻辑都位于 agrobr 库中。

🛠️ 开发

git clone https://github.com/bruno-portfolio/agrobr-mcp.git
cd agrobr-mcp
pip install -e ".[dev]"

# 运行测试
pytest tests/ -m "not integration" -v

# 代码检查
ruff check src/ tests/
ruff format src/ tests/

📄 许可证

本项目采用 MIT 许可证。

🇵🇹 葡萄牙语说明

什么是 agrobr-mcp?

agrobr-mcp 是一个 MCP 服务器,它能让大语言模型(LLMs)访问实时的巴西农业数据。这些数据包括价格、作物、气候、森林砍伐等,所有数据都来自 CEPEA、CONAB、IBGE、INPE 和 B3 等公开数据源。

安装

pip install agrobr-mcp

配置

按照上述说明将其添加到您的 MCP 客户端(Claude Desktop、Cursor 或 Claude Code)中。

Docker

docker build -t agrobr-mcp .
docker run --rm -i agrobr-mcp

10 种可用工具

  • preco_diario — 农产品现货价格(CEPEA/ESALQ)
  • futuros_b3 — B3 交易所农产品期货每日结算
  • estimativa_safra — 按州划分的当前作物季节预估(CONAB/IBGE)
  • producao_anual — 按州划分的历史产量(IBGE PAM)
  • balanco — 供需平衡(CONAB)
  • progresso_safra — 每周种植和收获进度(CONAB)
  • clima — 按州划分的气候数据(NASA POWER)
  • desmatamento — 按生物群落划分的森林砍伐率和警报(INPE)
  • listar_produtos — 列出每个工具的有效产品
  • health_check — 检查数据源的状态

链接

mcp-name: io.github.bruno-portfolio/agrobr

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