agroagent
AgroAgent
チリ農業分野に特化したAIエージェント。Model Context Protocol(MCP) を介したエージェントアーキテクチャで構築。モノリシックなバックエンドの代わりに、4つの独立したMCPサーバーが専門ツールを公開し、オーケストレーターがAnthropic SDKによるエージェントループを通じて調整する。
アーキテクチャ
apps/
web/ Next.js 16 + TypeScript + Tailwind v4 + Recharts
orchestrator/ FastAPI -- MCP host + agent loop (Anthropic SDK) + rutas REST de dashboard
mcp-servers/
mcp-weather/ tool: get_weather_forecast (Open-Meteo)
mcp-prices/ tool: get_commodity_price (datos abiertos ODEPA)
mcp-db/ tools: get_farmer_history, register_planting (PostgreSQL/SQLAlchemy async)
mcp-rag/ tool: search_sag_documents (RAG sobre normativa SAG -- Pinecone + Voyage AI)
packages/
shared-types/ Modelos Pydantic compartidos entre orchestrator y mcp-serversオーケストレーターはMCPクライアントとして4つのサーバーに接続し、それらのツールカタログを1つに集約して、以下を公開する:
POST /chat-- 会話エンドポイント(Claudeがコンテキストに応じて使用するツールを決定)GET /weather、GET /farmers/{id}/history、GET /prices/trend-- ダッシュボード用の決定論的RESTルート。LLMを介さずにツールを直接呼び出す
このプロジェクトの価値は各ソースを個別に公開することではなく、エージェントがそれらをクロス参照することにある。例えば、農家の作付け履歴を地域の予報や製品の現在価格と関連付け、該当する場合は正確なSAG決議を引用しながら具体的な意思決定を提案する。
Related MCP server: leafengines-mcp-server
スタック
バックエンド: Python 3.12+、FastAPI、
mcpSDK(v2)、SQLAlchemy async + asyncpg、Pinecone、Voyage AI、Anthropic SDK、uv(モノレポワークスペース)フロントエンド: Next.js(App Router)、TypeScript、Tailwind CSS v4、Recharts、pnpm
データ: PostgreSQL(Docker)、Open-Meteo API、ODEPA(CKAN datastore API)、SAG規制文書
要件
Python 3.12+ および
uvNode 20+ および
pnpmDocker(PostgreSQL用)
APIキー: Anthropic、Pinecone、Voyage AI
セットアップ
# Backend (Python workspace completo)
uv sync --all-packages
# Frontend
cd apps/web && pnpm install && cd ../..
# Base de datos
docker compose up -d postgresapps/web/.env.local を作成:
NEXT_PUBLIC_ORCHESTRATOR_URL=http://localhost:3001プロジェクトの起動(6プロセス)
# Terminal 1
uv run --package mcp-weather uvicorn mcp_weather.app:app --reload --port 4001
# Terminal 2
uv run --package mcp-prices uvicorn mcp_prices.app:app --reload --port 4002
# Terminal 3 (ajusta el puerto de Postgres si no usas el 5432 por defecto)
DATABASE_URL="postgresql+asyncpg://agroagent:agroagent@localhost:5432/agroagent" \
uv run --package mcp-db uvicorn mcp_db.app:app --reload --port 4004
# Terminal 4
PINECONE_API_KEY="..." VOYAGE_API_KEY="..." \
uv run --package mcp-rag uvicorn mcp_rag.app:app --reload --port 4005
# Terminal 5
ANTHROPIC_API_KEY="..." \
uv run --package orchestrator uvicorn orchestrator.app:app --reload --port 3001
# Terminal 6
cd apps/web && pnpm devフロントエンド: http://localhost:3000
アーキテクチャ上の決定事項
MCPトランスポート: stdioではなくstreamable-HTTP -- 各MCPサーバーは独自のポート/コンテナを持つ独立したサービスであり、実際のマイクロサービスデプロイメントにより忠実。
NestJS/TypeScriptではなくPython/FastAPIバックエンド: 市場の需要とポリグロットな汎用性を示すための意図的な決定(フロントエンドはTS/Reactのまま)。
RAG: チャンク分割は固定文字数ではなく、チリの法的決議の番号構造(
2.1、3.1.1など)を尊重。各チャンクのメタデータには決議番号が含まれ、エージェントがソースを引用できるようにしている。エージェントから分離されたRESTルート: ダッシュボードは決定論的データ(天候、履歴、価格)にLLMを介さない -- 不要なコストとレイテンシーを回避。両レイヤーは基盤となる同じMCPツールを再利用する。
既知の制限事項 / 未対応事項
認証なし:
farmer_idは明示的に渡され、ユーザーセッションはない。新しい農家を作成するルート(
POST /farmers)は存在しない -- テストレコードは手動で挿入された。mcp-ragはテキストレイヤーのないスキャンPDFをサポートしていない(OCRが必要)。サービスごとの個別の
Dockerfileはない --docker-compose.ymlはPostgreSQLのみをカバーしている。mcp-dbの作物名は、mcp-pricesのODEPA製品名に対して正規化されていない。
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server enabling AI agents to manage Bitrix24 features via standardized protocol
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Related MCP Servers
- AlicenseAqualityBmaintenanceAn 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.14150 PyPI28MIT
- AlicenseNot gradedqualityCmaintenanceAgricultural intelligence MCP server providing soil analysis, crop recommendations, weather forecasts, and environmental impact assessment.5MIT
- AlicenseNot gradedqualityBmaintenanceEU Crop Intelligence MCP Server — Yield forecasts, weather analysis, and phenology models for 15 countries. AI agent-native, multi-source intelligence (NASA POWER, Eurostat, Open-Meteo).MIT
- AlicenseAqualityDmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.6MIT