A trader drives from Nairobi to Nakuru on Monday morning. Before leaving, he checks wholesale prices at Wakulima Market. He knows maize is 12% higher in Nairobi this week than last.
The farmer he buys from doesn't know this.
That information gap is not accidental. It's structural, persistent, and extractable by anyone with market access. The World Bank estimated in 2016 that price information asymmetries account for 10–15% of post-harvest losses in Sub-Saharan Africa. For Kenya's 8M+ smallholder farmers, that's billions in foregone income annually.
soko-mcp is a commodity price intelligence MCP server that begins to close this gap.
The Research Basis
Suri & Jack (2016): M-PESA adoption in Kenya lifted 194,000 households out of poverty, disproportionately women — primarily through improved market access and ability to store value. The mechanism: reduced friction in market participation.
World Bank "ICT and Agricultural Markets" (2016): In markets where farmers received SMS price updates, they achieved 8–10% higher farm-gate prices by timing sales or traveling to better markets.
EAGC East Africa Regional Market Monitor: The East Africa Grain Council publishes weekly price data for 12 commodities across 8 countries. This data exists. It's just not integrated into tools farmers actually use.
The Sell/Hold Problem
The core decision a farmer faces post-harvest:
"Should I sell my 50 bags of maize now, or store them for 2 months?"
This requires three inputs:
- Current market price vs. historical average
- Expected price trajectory (seasonal pattern)
- Cost of storage (per bag per month)
from soko_mcp import sell_hold_decision
result = sell_hold_decision(
commodity="maize",
market="nakuru",
quantity_bags=50,
storage_cost_per_month_kes=500,
months_can_store=3
)
# → recommendation: "HOLD 2 MONTHS"
# → expected_gain_kes: 8500 (net of storage costs)
# → confidence: "MODERATE"
# → caveat: "DEMO — based on synthetic seasonal patterns"
What the Model Does
The price model uses three signals:
Seasonal index: Maize prices in Kenya follow a predictable post-harvest depression (March–May) and pre-harvest premium (October–December). This is well-documented in EAGC data.
Regional spread: Nairobi-Nakuru price differentials average 12–18% depending on road conditions and fuel costs. A farmer 200km from Nairobi can calculate whether the transport cost is worth it.
Storage break-even: At KES 500/bag/month, a 15% price increase over 2 months yields KES 7,500 net gain on 50 bags. If expected increase is 8%, don't store — sell now.
Trust Integrity Note
All price data in soko-mcp is DEMO — synthetic data modeled on EAGC seasonal patterns. It does not connect to live market feeds.
Production integration requires:
- EAGC API subscription (available to NGOs and research institutions)
- NAFIS (National Agriculture and Food Information System) real-time feeds
- Kenya National Bureau of Statistics retail price data
The model architecture is production-ready. The data connections are the next step.
Five Tools
pip install soko-mcp
-
commodity_price_query— current price + 30-day trend -
regional_price_comparison— prices across 8 East Africa markets -
price_trend_analysis— 12-month historical pattern -
sell_hold_decision— net-of-storage recommendation -
market_overview— full commodity dashboard
github.com/gabrielmahia/soko-mcp · MIT License
Top comments (0)