Skip to main content
Glama
README.md
# kilimo-mcp
<!-- mcp-name: io.github.gabrielmahia/kilimo-mcp -->

[![kilimo-mcp Glama score](https://glama.ai/mcp/servers/gabrielmahia/kilimo-mcp/badges/score.svg)](https://glama.ai/mcp/servers/gabrielmahia/kilimo-mcp)
[![smithery badge](https://smithery.ai/badge/@gabrielmahia/kilimo-mcp)](https://smithery.ai/server/@gabrielmahia/kilimo-mcp)


Install: `pip install kilimo-mcp` · Use with any MCP client.



> Kenya precision agriculture via MCP — crop calendar, fertilizer, pest alerts, KALRO varieties

[![PyPI](https://img.shields.io/badge/PyPI-v0.1.0-blue)](https://github.com/gabrielmahia/kilimo-mcp)
[![License](https://img.shields.io/badge/License-MIT-green)](https://github.com/gabrielmahia/kilimo-mcp)
[![Layer](https://img.shields.io/badge/Layer-Social-purple)](https://github.com/gabrielmahia/kilimo-mcp)


## AI Architecture: Agricultural Domain RAG

Agricultural AI for East Africa requires domain-specific retrieval — generic
models hallucinate crop varieties, soil types, and local market conditions.

**Research basis:**
- **AgriIR** (Springer 2026): configurable RAG framework for agricultural knowledge
  retrieval — validates domain-specific retrieval over monolithic agricultural models.
  Key finding: low computational cost with high accuracy when knowledge base is curated.
- **RAG vs Fine-tuning on Agriculture** (arXiv 2401.08406): RAG outperforms fine-tuning
  for dynamic agricultural knowledge (seasonal, location-specific, real-time market).
- **DPGA 2026 focus**: Domain-specific DPGs in agriculture and climate are a
  2026 strategic priority for Co-Develop and DPGA members.

**Knowledge base pairing:**
- Kenya National Drought Management Authority (NDMA) data → drought → crop risk
- Kenya Meteorological Department seasonal forecasts → planting calendar
- East Africa agricultural historical data (1906-1925, HuggingFace: gmahia)

**Coordination:**
Pairs with `wapimaji-mcp` (water), `bima-mcp` (insurance), `soko-mcp` (markets)
via `africa-coord-bus` for full drought response cascade.

## Install

```bash
pip install kilimo-mcp
```

## What it does

8 MCP tools covering Kenya precision agriculture. 1st world equivalent: **Climate Corp / Granular**.

| Tool | Description |
|------|-------------|
| `crop_calendar` | Kenya crop planting and harvesting calendar by region |
| `fertilizer_guide` | Fertilizer recommendations by crop and soil type |
| `pest_disease_alert` | Crop pest and disease identification and management |
| `market_timing_guide` | Best timing to sell produce based on price cycles |
| `kalro_varieties` | KALRO improved crop variety recommendations |
| `input_cost_calculator` | Kenya farm input cost calculator and comparison |
| `rainfall_forecast` | Daily rain forecast (mm, chance) for any location, from Open-Meteo |
| `food_market_prices` | Latest WFP market prices in Kenya for a commodity, via HDX HAPI |

## Usage

```bash
# Run as standalone MCP server
kilimo-mcp

# Or add to Claude Desktop / any MCP client
# Add to your MCP config: {"command": "kilimo-mcp"}
```

## Part of the Kenya Coordination Infrastructure Stack

This is one of the MCP servers covering the coordination infrastructure of East Africa:

**Economic:** mpesa · mkopo · bima · soko · sifa · remit · kra · faida  
**Physical:** wapimaji · nishati · usafiri · ardhi  
**Social:** afya · afya-ya-akili · elimu · kazi · haki-ya-kazi · kilimo · jumuia  
**Civic:** nyumba · habari · mazingira · civic-agent-kit  

→ [The Nairobi Stack](https://gabrielmahia.github.io/nairobi-stack)  
→ [Full Portfolio](https://gabrielmahia.github.io)

## Trust Integrity

All data in this server is **clearly labeled DEMO** where synthetic. Verify all operational data with the relevant Kenyan government authority before use.

## License

MIT © Gabriel Mahia | [AI-KungFU](https://github.com/gabrielmahia) | contact@aikungfu.dev

> *Decision infrastructure for East Africa*

## Live data

- `rainfall_forecast`: daily rain (mm) and chance of rain for up to 16 days at any location, from [Open-Meteo](https://open-meteo.com) (CC BY 4.0; free API for non-commercial use).
- `food_market_prices`: the latest WFP-monitored market prices in Kenya for a commodity, optionally by county, via [HDX HAPI](https://hapi.humdata.org) (WFP data CC BY-IGO).

Each live answer names its source, attribution and retrieval time; if a service does not answer, the tool returns an error instead of a number. The other tools are unchanged.

## Part of the East Africa Coordination Stack

This MCP server is part of the Kenya coordination infrastructure.
It connects to [`africa-coord-bus`](https://github.com/gabrielmahia/africa-coord-bus) — the coordination
event bus that routes signals between domains automatically.

When this server detects a threshold condition, the bus notifies:
- `bima-mcp` — parametric insurance evaluation
- `kilimo-mcp` — agricultural advisory
- `afya-mcp` — health surveillance activation
- `county-mcp` — county office alert

```python
pip install africa-coord-bus
```

All servers: [pypi.org/user/gmahia](https://pypi.org/user/gmahia/)

## IP & Collaboration

MIT licensed. Feedback via GitHub Issues only — pull requests are not accepted. Demo data is labeled DEMO and is not suitable for operational decisions. Full policy: [docs/architecture/IP_POLICY.md](docs/architecture/IP_POLICY.md). Security reports: see [SECURITY.md](SECURITY.md).

<!-- interconnect:v2 -->
## Part of the East Africa coordination stack

- **Install & run:** `pip install reli-cli && reli list` — the MCP servers on the [official MCP Registry](https://registry.modelcontextprotocol.io) under `io.github.gabrielmahia`
- **Evaluate any model on Swahili agent tasks:** [kipimo](https://github.com/gabrielmahia/kipimo) · [dataset](https://huggingface.co/datasets/gmahia/kipimo) · [leaderboard](https://huggingface.co/spaces/gmahia/kipimo-leaderboard)
- **Coordinate across servers:** [africa-coord-bus](https://pypi.org/project/africa-coord-bus/) — offline-first event bus with a built-in Kenya routing table
- **Datasets:** [huggingface.co/gmahia](https://huggingface.co/gmahia) · **Docs hub:** [nairobi-stack](https://github.com/gabrielmahia/nairobi-stack)

Model-agnostic by design: closed APIs, open-weight models, and small distilled models are all first-class citizens.
<!-- /interconnect:v2 -->

TDQS

B3.2/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct agricultural domain: planting schedule, fertilizer, pests, market timing, varieties, and input costs. No overlap in purpose, making tool selection unambiguous.

Naming Consistency5/5

All tool names use a consistent lowercase snake_case pattern with noun-noun combinations (e.g., crop_calendar, fertilizer_guide). The naming is uniform and descriptive, making it easy to predict tool functions.

Tool Count5/5

Six tools is a well-scoped set for an agricultural advisory server, covering key aspects without being overwhelming. Each tool has a clear purpose, and the count is within the ideal range.

Completeness4/5

The tools cover the core planting-to-selling lifecycle: planting calendar, fertilizer, pest/disease management, market timing, variety selection, and cost calculation. Minor gaps exist (e.g., weather or irrigation guidance), but the surface is largely complete for its stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing