<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gabriel Mahia</title>
    <description>The latest articles on DEV Community by Gabriel Mahia (@gabrielmahia).</description>
    <link>https://dev.to/gabrielmahia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3816762%2Fa0204949-e28c-4d88-862d-f8723ceddf03.jpeg</url>
      <title>DEV Community: Gabriel Mahia</title>
      <link>https://dev.to/gabrielmahia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gabrielmahia"/>
    <language>en</language>
    <item>
      <title>How a Community Health Worker in Turkana Coordinates With 1,200 Households — And What AI Could Change</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/how-a-community-health-worker-in-turkana-coordinates-with-1200-households-and-what-ai-could-29ne</link>
      <guid>https://dev.to/gabrielmahia/how-a-community-health-worker-in-turkana-coordinates-with-1200-households-and-what-ai-could-29ne</guid>
      <description>&lt;p&gt;A community health worker (CHW) in Turkana County manages a household register that covers, on average, 1,200 households. That register is a paper notebook.&lt;/p&gt;

&lt;p&gt;She visits each household on a rotating schedule determined by a system that exists in her head — the households with pregnant women, the ones with under-5 children, the ones where she noticed signs of malnutrition last time, the ones that are far away and require a full day of walking to reach.&lt;/p&gt;

&lt;p&gt;The scheduling problem she solves every week is a variant of the travelling salesman problem with added constraints: time windows, health priority weights, family relationships, and geographic access that changes with seasonal rainfall.&lt;/p&gt;

&lt;h2&gt;
  
  
  What AI coordination adds
&lt;/h2&gt;

&lt;p&gt;AI coordination does not replace the CHW. It cannot. The knowledge she has built about her community over years of visits is irreducible context that no model can replicate from registry data.&lt;/p&gt;

&lt;p&gt;What AI coordination can add:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Priority routing&lt;/strong&gt; — If &lt;code&gt;wapimaji-mcp&lt;/code&gt; has issued a drought alert for her sub-county and &lt;code&gt;afya-mcp&lt;/code&gt; has activated malnutrition surveillance, a routing algorithm that surfaces the highest-risk households first changes her schedule without requiring her to discover the risk signal herself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Supply chain visibility&lt;/strong&gt; — If her facility is approaching stockout on oral rehydration salts, and an outbreak flag has been raised in the area, the coordination layer can surface that conflict before she sends a patient to a facility that cannot treat them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aggregate signal&lt;/strong&gt; — If 12 CHWs in a sub-county have each flagged one case of suspected cholera, those signals are individually below a response threshold. Aggregated, they cross it. The aggregation requires a coordination layer the paper notebook cannot provide.&lt;/p&gt;

&lt;h2&gt;
  
  
  The coordination infrastructure
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;afya-mcp&lt;/code&gt; (&lt;a href="https://github.com/gabrielmahia/afya-mcp" rel="noopener noreferrer"&gt;github.com/gabrielmahia/afya-mcp&lt;/a&gt;) provides structured health coordination tools. &lt;code&gt;africa-coord-bus&lt;/code&gt; routes signals between the health domain and the water, agriculture, and county response domains.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;afya-mcp africa-coord-bus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The CHW is not a problem to be automated. She is a coordination node that currently operates with insufficient information flow. The infrastructure question is how to improve that flow without adding friction to her work.&lt;/p&gt;

</description>
      <category>health</category>
      <category>africa</category>
      <category>coordination</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Land Registration in Kenya Takes Months. Here Is What the Data Problem Actually Is.</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/land-registration-in-kenya-takes-months-here-is-what-the-data-problem-actually-is-4hbm</link>
      <guid>https://dev.to/gabrielmahia/land-registration-in-kenya-takes-months-here-is-what-the-data-problem-actually-is-4hbm</guid>
      <description>&lt;p&gt;Land disputes are one of the most common legal conflicts in Kenya. Titles are lost, boundaries are disputed, and sales are contested. Resolution moves through courts for years.&lt;/p&gt;

&lt;p&gt;The land registration problem is frequently described as a technology problem. It is not. It is a data structure problem.&lt;/p&gt;

&lt;p&gt;The core issue: land records exist in multiple systems that do not share identifiers. A parcel appears in the Lands Registry under one reference number, in county GIS systems under a different boundary polygon, in property tax records under a different owner ID, and in court records under a case number that references none of the above.&lt;/p&gt;

&lt;p&gt;No single query returns the complete picture of a parcel's status.&lt;/p&gt;

&lt;h2&gt;
  
  
  What AI can and cannot do
&lt;/h2&gt;

&lt;p&gt;An AI agent connected to the Lands Registry API can retrieve a parcel record. It cannot determine whether that record conflicts with an adjacent parcel's surveyed boundary. It cannot determine whether a case filed at the Environment and Land Court two years ago affects the title. It cannot determine whether the property tax payments reflect the registered owner or a subsequent purchaser.&lt;/p&gt;

&lt;p&gt;These limitations are not AI limitations. They are data integration limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the coordination layer addresses
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;ardhi-mcp&lt;/code&gt; (&lt;a href="https://github.com/gabrielmahia/ardhi-mcp" rel="noopener noreferrer"&gt;github.com/gabrielmahia/ardhi-mcp&lt;/a&gt;) provides structured access to land registry coordination tools for Kenya. It does not solve the data integration problem — that requires years of government data work. What it provides is a structured interface layer that can grow as data integration improves.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;east-africa-legal-historical-pd&lt;/code&gt; dataset at &lt;a href="https://huggingface.co/datasets/gmahia/east-africa-legal-historical-pd" rel="noopener noreferrer"&gt;huggingface.co/datasets/gmahia/east-africa-legal-historical-pd&lt;/a&gt; provides historical customary land law records (pre-1928, public domain) that give AI agents context for the parallel customary land tenure systems that operate alongside formal registration.&lt;/p&gt;

&lt;p&gt;The land registration problem is a data problem. The tools that address it must be built at the data layer, not the AI layer.&lt;/p&gt;

</description>
      <category>africa</category>
      <category>kenya</category>
      <category>land</category>
      <category>mcp</category>
    </item>
    <item>
      <title>Swahili Has 200 Million Speakers. Here Is Why AI Gets It Wrong.</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 26 Oct 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/swahili-has-200-million-speakers-here-is-why-ai-gets-it-wrong-m3n</link>
      <guid>https://dev.to/gabrielmahia/swahili-has-200-million-speakers-here-is-why-ai-gets-it-wrong-m3n</guid>
      <description>&lt;p&gt;Two hundred million people speak Swahili. It is the most widely spoken language in sub-Saharan Africa. It is an official language of the African Union.&lt;/p&gt;

&lt;p&gt;The AI systems most people use were predominantly trained on English text. The result is predictable: Swahili queries get lower-quality responses, higher error rates, and less contextually appropriate answers.&lt;/p&gt;

&lt;p&gt;This is not a mystery. It is a data gap.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the data gap looks like in practice
&lt;/h2&gt;

&lt;p&gt;The Common Crawl — the web scrape that underlies most large language model pretraining — is estimated to be roughly 45-50% English by volume. Swahili represents a fraction of a percent.&lt;/p&gt;

&lt;p&gt;This means a Swahili-speaking community health worker asking an AI system for guidance on pediatric malnutrition gets a response built on a foundation of English medical literature, translated into Swahili. The clinical accuracy may be adequate. The cultural context, communication style, and local health system specifics are not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What structured Swahili data looks like
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;swahili-civic-nlp&lt;/code&gt; MCP server (&lt;a href="https://github.com/gabrielmahia/swahili-civic-nlp" rel="noopener noreferrer"&gt;github.com/gabrielmahia/swahili-civic-nlp&lt;/a&gt;) provides structured Swahili NLP tools specifically for civic and health coordination contexts.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;swahili-historical-corpus-pd&lt;/code&gt; dataset at &lt;a href="https://huggingface.co/datasets/gmahia/swahili-historical-corpus-pd" rel="noopener noreferrer"&gt;huggingface.co/datasets/gmahia/swahili-historical-corpus-pd&lt;/a&gt; provides structured historical Swahili text from Krapf (1882), Taylor (1891), and Steere (1870) — all public domain, all pre-colonial, all grounded in Swahili as a living language before colonial administrative influence.&lt;/p&gt;

&lt;p&gt;This is not a solution to the training data gap at the frontier model level. It is a domain-specific tool layer that adds structured Swahili context to AI coordination tools operating in East Africa.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;swahili-civic-nlp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The data gap is real. Structured domain tools are one way to work around it at the application level while larger structural changes happen elsewhere.&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>africa</category>
      <category>swahili</category>
      <category>ai</category>
    </item>
    <item>
      <title>Building a Coordination Layer When Nobody Else Is</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 12 Oct 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/the-coordination-stack-for-kenya-what-32-mcp-servers-look-like-as-a-system-26p4</link>
      <guid>https://dev.to/gabrielmahia/the-coordination-stack-for-kenya-what-32-mcp-servers-look-like-as-a-system-26p4</guid>
      <description>&lt;p&gt;Building AI tools for Africa one at a time solves individual problems. The coordination problems that cost lives require tools that work together.&lt;/p&gt;

&lt;p&gt;Most AI tooling for the region treats each domain — finance, water, health, agriculture — as a separate problem with a separate tool. The tools work in isolation. The crises they're meant to help with don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The domain layer
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Finance&lt;/strong&gt;: &lt;code&gt;mpesa-mcp&lt;/code&gt;, &lt;code&gt;kra-mcp&lt;/code&gt;, &lt;code&gt;faida-mcp&lt;/code&gt;, &lt;code&gt;mkopo-mcp&lt;/code&gt;, &lt;code&gt;sifa-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Water&lt;/strong&gt;: &lt;code&gt;wapimaji-mcp&lt;/code&gt; (drought intelligence)&lt;br&gt;
&lt;strong&gt;Agriculture&lt;/strong&gt;: &lt;code&gt;kilimo-mcp&lt;/code&gt;, &lt;code&gt;bima-mcp&lt;/code&gt;, &lt;code&gt;soko-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Health&lt;/strong&gt;: &lt;code&gt;afya-mcp&lt;/code&gt;, &lt;code&gt;afya-ya-akili-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Education&lt;/strong&gt;: &lt;code&gt;elimu-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Transport&lt;/strong&gt;: &lt;code&gt;usafiri-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Land&lt;/strong&gt;: &lt;code&gt;ardhi-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Language&lt;/strong&gt;: &lt;code&gt;swahili-civic-nlp&lt;/code&gt;, &lt;code&gt;tafsiri-mcp&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Civic&lt;/strong&gt;: &lt;code&gt;county-mcp&lt;/code&gt;, &lt;code&gt;fomu-mcp&lt;/code&gt;, &lt;code&gt;haki-ya-kazi-mcp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;All installable from PyPI: &lt;code&gt;pip install wapimaji-mcp kilimo-mcp bima-mcp&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The coordination layer
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;africa-coord-bus&lt;/code&gt; connects the domain servers. When &lt;code&gt;wapimaji-mcp&lt;/code&gt; detects drought, the bus routes it to the servers that need to respond: insurance evaluation, crop advisory, malnutrition surveillance, county alerts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DomainCascade&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CoordinationEvent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventSeverity&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queue_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/var/coord-bus/events.jsonl&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nc"&gt;DomainCascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;wire_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CoordinationEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WATER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drought_alert&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wapimaji-mcp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ALERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ndvi_anomaly&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;spi_3month&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.8&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Five tools respond automatically
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pip install africa-coord-bus&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The knowledge layer
&lt;/h2&gt;

&lt;p&gt;Public domain datasets at &lt;a href="https://huggingface.co/gmahia" rel="noopener noreferrer"&gt;huggingface.co/gmahia&lt;/a&gt; provide historical grounding: agricultural baselines from 1906–1925, Swahili-language corpora, and legal and climate records — material that exists but was never structured for AI training or retrieval before.&lt;/p&gt;

&lt;p&gt;The domain servers referenced above are on PyPI individually; browse &lt;a href="https://pypi.org/user/gmahia/" rel="noopener noreferrer"&gt;pypi.org/user/gmahia&lt;/a&gt; for the current list.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>africa</category>
      <category>coordination</category>
      <category>python</category>
    </item>
    <item>
      <title>Why East Africa's Public Domain Agricultural Data Is the Most Underused AI Asset in the Region</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 28 Sep 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/why-east-africas-public-domain-agricultural-data-is-the-most-underused-ai-asset-in-the-region-o2g</link>
      <guid>https://dev.to/gabrielmahia/why-east-africas-public-domain-agricultural-data-is-the-most-underused-ai-asset-in-the-region-o2g</guid>
      <description>&lt;p&gt;East Africa has a precise and detailed agricultural data record covering soil types, rainfall patterns, crop varieties, market conditions, and production methods across the region's major farming areas.&lt;/p&gt;

&lt;p&gt;It was written between 1906 and 1925.&lt;/p&gt;

&lt;p&gt;The USDA Foreign Agriculture Service published systematic crop surveys across Kenya, Uganda, and Tanganyika during this period. The Royal Botanic Gardens at Kew published botanical surveys throughout East Africa. Colonial agricultural departments published monthly bulletins covering rainfall, market prices, planting calendars, and extension notes.&lt;/p&gt;

&lt;p&gt;All of it is public domain. None of it is structured for AI access.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the record
&lt;/h2&gt;

&lt;p&gt;The USDA surveys from 1910-1920 document varietal performance by altitude and rainfall zone, soil type classifications by district, market price series for maize and other staples, planting and harvest calendars, and pest and disease records.&lt;/p&gt;

&lt;p&gt;These records predate synthetic fertilizers and irrigation as primary inputs. They document how crops performed under natural rainfall conditions across the same climate zones that East African smallholder farmers still farm today. For AI-assisted crop advisory without irrigation infrastructure — which describes most East African smallholder farming — this is directly relevant baseline data.&lt;/p&gt;

&lt;h2&gt;
  
  
  The structuring problem
&lt;/h2&gt;

&lt;p&gt;The data is not in a format an AI agent can query. It's in PDFs, some scanned from physical documents. It's in library archives. Structuring it for AI access is the missing work. Not generating it — it already exists.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;east-africa-agricultural-pd&lt;/code&gt; dataset at &lt;a href="https://huggingface.co/gmahia" rel="noopener noreferrer"&gt;huggingface.co/datasets/gmahia&lt;/a&gt; is the beginning of that structuring work. It feeds &lt;code&gt;kilimo-mcp&lt;/code&gt;, &lt;code&gt;wapimaji-mcp&lt;/code&gt;, and &lt;code&gt;bima-mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The constraint is not data availability. It's the engineering work of converting what exists into what AI agents can use.&lt;/p&gt;

</description>
      <category>africa</category>
      <category>agriculture</category>
      <category>ai</category>
      <category>datasets</category>
    </item>
    <item>
      <title>How Satellite Data Closes the Insurance Gap for Kenya's Smallholder Farmers</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 14 Sep 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/how-satellite-data-closes-the-insurance-gap-for-kenyas-smallholder-farmers-3j65</link>
      <guid>https://dev.to/gabrielmahia/how-satellite-data-closes-the-insurance-gap-for-kenyas-smallholder-farmers-3j65</guid>
      <description>&lt;p&gt;Kenya has roughly 7 million smallholder farming households. Most have no crop insurance.&lt;/p&gt;

&lt;p&gt;The barriers are not primarily financial. They're informational. Traditional insurance requires claims adjusters who visit farms, assess damage, and submit reports. At 7 million farms, that's not a business model.&lt;/p&gt;

&lt;p&gt;Parametric insurance removes the claims adjuster. The contract specifies a measurable trigger: when satellite-observed rainfall drops below X% of the seasonal mean for Y weeks, the payout fires automatically. No farm visit. No claims form.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CHIRPS&lt;/strong&gt; produces daily rainfall estimates at 0.05° resolution — roughly 5km grid cells — free and open, updated daily. &lt;strong&gt;MODIS NDVI&lt;/strong&gt; measures plant health from space; a consistent drop in NDVI against the seasonal baseline is a drought signal 6-8 weeks before visible crop failure. &lt;strong&gt;SPI&lt;/strong&gt; normalizes rainfall against historical distribution, making drought severity comparable across different climates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The coordination gap
&lt;/h2&gt;

&lt;p&gt;None of this data is currently connected to insurance contracts at the smallholder level.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wapimaji-mcp&lt;/code&gt; reads CHIRPS and NDVI data and fires drought alerts when thresholds cross. &lt;code&gt;bima-mcp&lt;/code&gt; holds parametric contracts. These two tools don't talk to each other.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;africa-coord-bus&lt;/code&gt; closes that gap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CoordinationEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DomainCascade&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="nc"&gt;DomainCascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;wire_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CoordinationEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WATER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drought_alert&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wapimaji-mcp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ALERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ndvi_anomaly&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;spi_3month&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.8&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# bima-mcp receives the event and evaluates insurance triggers automatically
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;africa-coord-bus wapimaji-mcp bima-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The data exists. The contracts can be written. The missing piece was the routing between them.&lt;/p&gt;

</description>
      <category>python</category>
      <category>africa</category>
      <category>insurance</category>
      <category>mcp</category>
    </item>
    <item>
      <title>East Africa's AI Coordination Tools Don't Talk to Each Other. This Is the Missing Layer.</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Tue, 01 Sep 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/east-africas-ai-coordination-tools-dont-talk-to-each-other-this-is-the-missing-layer-19ka</link>
      <guid>https://dev.to/gabrielmahia/east-africas-ai-coordination-tools-dont-talk-to-each-other-this-is-the-missing-layer-19ka</guid>
      <description>&lt;p&gt;When a drought early warning fires in Turkana County, six systems should respond.&lt;/p&gt;

&lt;p&gt;The insurance contract covering 40,000 smallholder farmers has a parametric clause: when the Standardized Precipitation Index drops below -1.5 for three consecutive months, payouts trigger automatically. No claims adjuster. No farm visit. The satellite confirms it.&lt;/p&gt;

&lt;p&gt;The agricultural extension system should send drought-resistant variety advisories to registered farmers. Planting decisions made now — six weeks before harvest failure is visible — still matter.&lt;/p&gt;

&lt;p&gt;The community health worker network should activate malnutrition surveillance. Drought becomes malnutrition in six to ten weeks. If the surveillance begins then, it's too late.&lt;/p&gt;

&lt;p&gt;The county health office should begin procurement of therapeutic foods. Lead time on procurement is four to six weeks.&lt;/p&gt;

&lt;p&gt;None of this happens.&lt;/p&gt;

&lt;p&gt;The drought early warning fires into silence. The signal exists. The tools exist. The data exists. The coordination does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The isolation problem
&lt;/h2&gt;

&lt;p&gt;East Africa's AI coordination stack now includes 31 MCP (Model Context Protocol) servers — tools for payments, water monitoring, agricultural coordination, health services, land records, education, tax compliance, labor rights, insurance, and more. Every one of these tools is deployed. Every one operates in isolation.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wapimaji-mcp&lt;/code&gt; generates drought alerts from NASA NDVI and NOAA CHIRPS data. It knows what's coming. It knows which counties are at risk. It knows the severity and the timeline.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bima-mcp&lt;/code&gt; manages parametric insurance contracts. It can evaluate triggers. It can initiate payouts. It does not receive signals from &lt;code&gt;wapimaji-mcp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;afya-mcp&lt;/code&gt; coordinates community health workers. It can activate surveillance protocols. It can route CHW household visits. It does not know a drought is coming.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;kilimo-mcp&lt;/code&gt; connects farmers to agricultural advisory services. It can send SMS advisories through Africa's Talking. It does not receive drought signals.&lt;/p&gt;

&lt;p&gt;The tools exist. The coordination layer does not.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the missing layer looks like
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/gabrielmahia/africa-coord-bus" rel="noopener noreferrer"&gt;africa-coord-bus&lt;/a&gt; is the coordination event bus that connects these tools.&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;wapimaji-mcp&lt;/code&gt; detects a drought signal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CoordinationEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DomainCascade&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;KenyaLocation&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;EventBus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;queue_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/var/coord-bus/events.jsonl&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cascade&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DomainCascade&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cascade&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;wire_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;CoordinationEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;WATER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;drought_alert&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;wapimaji-mcp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;severity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ALERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;KenyaLocation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;county&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Turkana&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;county_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ndvi_anomaly&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;0.28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;spi_3month&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;1.8&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cascade fires automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;bima-mcp.evaluate_parametric_payout&lt;/code&gt; — insurance evaluation begins&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kilimo-mcp.issue_drought_advisory&lt;/code&gt; — farmers receive SMS&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;afya-mcp.activate_malnutrition_watch&lt;/code&gt; — CHW surveillance activates&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;county-mcp.alert_county_health&lt;/code&gt; — county health office notified&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;soko-mcp.price_alert&lt;/code&gt; — market price monitoring intensified&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Six weeks earlier than the current state. Before the damage is visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Offline-first by design
&lt;/h2&gt;

&lt;p&gt;Rural Kenya does not have reliable internet. The coordination bus writes every event to a local JSONL queue before dispatch. If connectivity fails, events persist. When connectivity restores, the queue replays.&lt;/p&gt;

&lt;p&gt;The coordination layer works at the edge. It does not require a data center.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;africa-coord-bus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://github.com/gabrielmahia/coord-cascade-demo" rel="noopener noreferrer"&gt;full demonstration&lt;/a&gt; shows the cascade across all Kenya domains. All 31 MCP servers are available at &lt;a href="https://pypi.org/user/gmahia/" rel="noopener noreferrer"&gt;pypi.org/user/gmahia&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The coordination gap is real. The tools to close it now exist.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>africa</category>
      <category>python</category>
      <category>coordination</category>
    </item>
    <item>
      <title>The Agricultural Data Africa Needs Already Exists. It's Just 100 Years Old.</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Tue, 11 Aug 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/the-agricultural-data-africa-needs-already-exists-its-just-100-years-old-1l1f</link>
      <guid>https://dev.to/gabrielmahia/the-agricultural-data-africa-needs-already-exists-its-just-100-years-old-1l1f</guid>
      <description>&lt;p&gt;The data problem for AI in African agriculture is not a lack of data.&lt;/p&gt;

&lt;p&gt;It is a structural absence of &lt;em&gt;structured&lt;/em&gt; data — the kind that AI agents can query, validate, and reason with.&lt;/p&gt;

&lt;p&gt;The raw material exists. It has existed for over a century. It sits in the public domain, digitized by libraries and archives, waiting to be structured.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the public domain contains
&lt;/h2&gt;

&lt;p&gt;The British East Africa Protectorate agricultural reports from 1910-1922 document, county by county, which crops grew where, what yields looked like in drought years versus good years, which soil types supported what cultivation, and which traditional practices survived contact with colonial agricultural extension.&lt;/p&gt;

&lt;p&gt;The Kew Gardens Economic Botany Series from 1906-1920 contains botanical surveys of East African crops — sorghum, millet, cassava, cowpea, moringa — with documented water requirements, storage characteristics, and soil tolerances.&lt;/p&gt;

&lt;p&gt;The East Africa Meteorological Department records from 1900-1940 show rainfall patterns before the satellite era: where the long rains reliably arrive, where they don't, where the variability is structurally high.&lt;/p&gt;

&lt;p&gt;These documents are free. They are in the public domain. They are not behind paywalls. They are in libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  The structural absence
&lt;/h2&gt;

&lt;p&gt;The problem: they are in the format of 1910.&lt;/p&gt;

&lt;p&gt;Scanned PDFs. Handwritten tables. Narrative reports in colonial English. Measurement systems that predated standardization.&lt;/p&gt;

&lt;p&gt;No AI agent built in 2025 can query them the way it needs to. "What is the planting calendar for sorghum in semi-arid Kenya?" requires that someone has extracted, structured, validated, and made available the answer in a format that agents can use.&lt;/p&gt;

&lt;p&gt;That structured layer is what's missing. Not the underlying knowledge.&lt;/p&gt;

&lt;h2&gt;
  
  
  What structured public domain data enables
&lt;/h2&gt;

&lt;p&gt;The MCP servers in the East Africa coordination stack (&lt;a href="https://pypi.org/project/wapimaji-mcp/" rel="noopener noreferrer"&gt;wapimaji-mcp&lt;/a&gt;, &lt;a href="https://pypi.org/project/kilimo-mcp/" rel="noopener noreferrer"&gt;kilimo-mcp&lt;/a&gt;, &lt;a href="https://pypi.org/project/bima-mcp/" rel="noopener noreferrer"&gt;bima-mcp&lt;/a&gt;) need grounded knowledge to reason correctly.&lt;/p&gt;

&lt;p&gt;When a farmer asks an AI agent about optimal planting dates for a semi-arid county, the agent needs historical knowledge of rainfall patterns and crop tolerances — not just a general LLM approximation.&lt;/p&gt;

&lt;p&gt;That knowledge exists in the 1910 Kew surveys. The work is structuring it so the MCP can use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What was structured this week
&lt;/h2&gt;

&lt;p&gt;Six public domain datasets now available on HuggingFace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;East Africa agricultural data&lt;/strong&gt; — crop profiles, rainfall zones, soil types from USDA and Kew (1906-1922)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swahili historical corpus&lt;/strong&gt; — Krapf 1882, Taylor 1891, Steere 1870: the vocabulary of East African coordination in the language 200 million people speak&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;East Africa health historical&lt;/strong&gt; — disease patterns, altitude factors, traditional medicine documentation (1895-1920)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;East Africa legal and land tenure&lt;/strong&gt; — customary systems, colonial legislation, dispute resolution (pre-1928)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Africa historical maps catalog&lt;/strong&gt; — metadata for PD maps from Library of Congress, National Archives, Kew (1688-1925)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open government climate catalog&lt;/strong&gt; — NASA, NOAA, USDA datasets structured for African agricultural use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All public domain. All structured for AI agent use. All connected to the coordination infrastructure stack.&lt;/p&gt;

&lt;p&gt;The knowledge infrastructure problem in Africa is not a lack of knowledge. It is a lack of structured access to knowledge that already exists.&lt;/p&gt;

&lt;p&gt;Public domain works published before 1928 are the closest thing to free raw material in the information economy. The opportunity is not to extract value from them. It is to structure them so they can flow.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;These datasets are available at &lt;a href="https://huggingface.co/gmahia" rel="noopener noreferrer"&gt;huggingface.co/gmahia&lt;/a&gt;. Related coordination tools at &lt;a href="https://pypi.org/user/gmahia/" rel="noopener noreferrer"&gt;pypi.org/user/gmahia&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>africa</category>
      <category>opendata</category>
      <category>agriculture</category>
    </item>
    <item>
      <title>Building Coordination Infrastructure: What 32 MCP Servers Without a Bus Look Like</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Mon, 03 Aug 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/building-coordination-infrastructure-what-32-mcp-servers-without-a-bus-look-like-243c</link>
      <guid>https://dev.to/gabrielmahia/building-coordination-infrastructure-what-32-mcp-servers-without-a-bus-look-like-243c</guid>
      <description>&lt;p&gt;Thirty-two MCP servers for Kenya's coordination domains.&lt;/p&gt;

&lt;p&gt;Water. Health. Agriculture. Insurance. Land. Education. Transport. Tax. Labor. Market prices.&lt;/p&gt;

&lt;p&gt;Each one works. None talks to any other.&lt;/p&gt;

&lt;p&gt;This is what 32 isolated tools looks like in practice: a CHW in Kisumu flags a cholera cluster. The water quality system doesn't know. The county procurement system doesn't know. The emergency medicine supply chain doesn't know. The tools that need to respond are all present. The coordination between them doesn't exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architectural problem
&lt;/h2&gt;

&lt;p&gt;The Model Context Protocol ecosystem is growing fast. For most of the world, it's growing in domains that already have coordination infrastructure: calendar apps, email clients, project management tools. These tools coordinate with each other through years of API integrations, webhooks, Zapier connections, and shared data stores.&lt;/p&gt;

&lt;p&gt;African coordination domains don't have that legacy. They're being built now, from scratch, on MCP.&lt;/p&gt;

&lt;p&gt;That means the coordination layer has to be built at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a coordination layer looks like at the MCP level
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/gabrielmahia/africa-coord-bus" rel="noopener noreferrer"&gt;&lt;code&gt;africa-coord-bus&lt;/code&gt;&lt;/a&gt; defines a &lt;code&gt;CoordinationEvent&lt;/code&gt; — a standard cross-domain signal schema — and an &lt;code&gt;EventBus&lt;/code&gt; that routes events to the tools that need to respond.&lt;/p&gt;

&lt;p&gt;The routing table is explicit:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Trigger&lt;/th&gt;
&lt;th&gt;Cascade&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;water.drought_alert&lt;/code&gt; (Warning+)&lt;/td&gt;
&lt;td&gt;bima-mcp, kilimo-mcp, soko-mcp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;water.drought_alert&lt;/code&gt; (Alert+)&lt;/td&gt;
&lt;td&gt;+ afya-mcp, county-mcp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;health.disease_outbreak&lt;/code&gt; (cholera)&lt;/td&gt;
&lt;td&gt;wapimaji-mcp water quality check&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;agriculture.price_spike&lt;/code&gt; (&amp;gt;30%)&lt;/td&gt;
&lt;td&gt;afya-mcp food security watch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;water.flood_alert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;afya-mcp waterborne watch, county-mcp&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Custom rules take three lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;africa_coord_bus&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;RoutingRule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EventSeverity&lt;/span&gt;

&lt;span class="n"&gt;bus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;routing&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;RoutingRule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;locust→emergency_procurement&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;trigger_domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventDomain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AGRICULTURE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;trigger_event_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;locust_swarm&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;trigger_min_severity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;EventSeverity&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ALERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;target_actions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fomu-mcp.emergency_procurement&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;county-mcp.agriculture_alert&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The composable coordination stack
&lt;/h2&gt;

&lt;p&gt;The pattern that's emerging for East Africa:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Public domain datasets (HuggingFace)
        │ grounding knowledge
        ▼
32 MCP servers (PyPI) ←── africa-coord-bus
        │
        ▼
A2A + ADK agents
        │
        ▼
Streamlit coordination interfaces
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each layer is replaceable. The models are replaceable. The MCP servers are replaceable. What persists is the coordination architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;africa-coord-bus
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source: &lt;a href="https://github.com/gabrielmahia/africa-coord-bus" rel="noopener noreferrer"&gt;github.com/gabrielmahia/africa-coord-bus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The coordination gap was the last missing layer. It's now installable.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://pypi.org/project/africa-coord-bus/" rel="noopener noreferrer"&gt;africa-coord-bus on PyPI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>africa</category>
      <category>coordination</category>
      <category>python</category>
    </item>
    <item>
      <title>MCP, A2A, and Google ADK for East Africa: What the Coordination Stack Looks Like</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Fri, 31 Jul 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/mcp-a2a-and-google-adk-for-east-africa-what-the-coordination-stack-looks-like-3f0n</link>
      <guid>https://dev.to/gabrielmahia/mcp-a2a-and-google-adk-for-east-africa-what-the-coordination-stack-looks-like-3f0n</guid>
      <description>&lt;p&gt;Three protocols landed in 2024 that change what AI agents can do in production: MCP (Model Context Protocol), A2A (Agent-to-Agent), and Google ADK (Agent Development Kit).&lt;/p&gt;

&lt;p&gt;The question for Africa's coordination infrastructure is not whether these protocols are technically interesting. The question is: what does the absence of domain-specific implementations mean for the coordination problems — health, water, agriculture, land, education — that remain unsolved at scale?&lt;/p&gt;

&lt;h2&gt;
  
  
  The structural absence
&lt;/h2&gt;

&lt;p&gt;Most MCP implementations connect to platforms that already exist in rich countries: Slack, Google Calendar, GitHub, Stripe, Salesforce. The ecosystems those tools coordinate are already coordinated. The problem is solved.&lt;/p&gt;

&lt;p&gt;The structural absence is in the domains where coordination is genuinely broken:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A community health worker in Turkana County manages 1,200 households with a paper register. No MCP server for CHW coordination.&lt;/li&gt;
&lt;li&gt;A smallholder farmer in Embu has no way to know today's market price at the Meru collection point before deciding to sell. No MCP server for farm-gate price information.&lt;/li&gt;
&lt;li&gt;Drought early warning data exists (NASA NDVI, NOAA CHIRPS) but there is no structured AI-accessible interface to it. No MCP server for drought intelligence.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not technical problems. They are data structuring and interface design problems. The protocols exist. The domain implementations don't.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the stack looks like
&lt;/h2&gt;

&lt;p&gt;The East Africa coordination stack now includes 31 MCP servers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Payments&lt;/strong&gt;: M-Pesa API via Daraja (mpesa-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Water/drought&lt;/strong&gt;: Satellite data integration (wapimaji-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agriculture&lt;/strong&gt;: Market coordination, crop advisory (kilimo-mcp, soko-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parametric insurance&lt;/strong&gt;: Satellite-triggered coverage (bima-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health&lt;/strong&gt;: County health service coordination (afya-mcp, county-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Land&lt;/strong&gt;: Registry coordination (ardhi-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tax compliance&lt;/strong&gt;: Kenya Revenue Authority (kra-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capital markets&lt;/strong&gt;: NSE data access (faida-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Labor rights&lt;/strong&gt;: Worker compliance (haki-ya-kazi-mcp)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Language&lt;/strong&gt;: Swahili NLP infrastructure (swahili-civic-nlp, tafsiri-mcp)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The A2A pattern enables agents built on these servers to coordinate without bespoke integration code. The ADK pattern provides the framework for agents that can plan multi-step tasks — necessary for coordination workflows spanning multiple API calls and decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture gap this addresses
&lt;/h2&gt;

&lt;p&gt;The composable model future assumes domain knowledge is accessible to AI agents through structured interfaces. For most African coordination domains, it is not.&lt;/p&gt;

&lt;p&gt;The problem is not a model problem. GPT-4, Claude, and Gemini are accessible. The problem is that there is no structured interface between those models and the data that would make them useful for a CHW in Turkana, a farmer in Embu, or a water officer in Wajir.&lt;/p&gt;

&lt;p&gt;MCP, A2A, and ADK are the protocol layer. The East Africa implementations are the domain layer. The work is connecting them.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;All servers available at &lt;a href="https://pypi.org/user/gmahia/" rel="noopener noreferrer"&gt;pypi.org/user/gmahia&lt;/a&gt; and indexed at Glama.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>africa</category>
      <category>python</category>
    </item>
    <item>
      <title>Build Your First East Africa MCP Server in 30 Minutes</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Tue, 28 Jul 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/build-your-first-east-africa-mcp-server-in-30-minutes-2nj6</link>
      <guid>https://dev.to/gabrielmahia/build-your-first-east-africa-mcp-server-in-30-minutes-2nj6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Correction (2026-10-08):&lt;/strong&gt; NHIF was replaced by the Social Health Authority (SHA) and its SHIF contribution in October 2024. Where this post uses NHIF coverage as an example, read SHA/SHIF. &lt;code&gt;bima-mcp&lt;/code&gt; and &lt;code&gt;afya-mcp&lt;/code&gt; now label NHIF-era figures accordingly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every tool in the East Africa coordination infrastructure stack started from the same scaffold. Here's exactly how to build and publish one yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You're Building
&lt;/h2&gt;

&lt;p&gt;An MCP server is a Python package that exposes tools to AI assistants. When a user installs it and connects it to Claude, the AI can call your tools as naturally as answering a question.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;your-mcp-server
&lt;span class="c"&gt;# Then Claude can:&lt;/span&gt;
&lt;span class="c"&gt;# "Check NHIF coverage for outpatient surgery" → calls your tool → returns structured result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1: Set Up the Project (2 min)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;your-mcp-server/
├── src/
│   └── your_package/
│       ├── __init__.py
│       └── main.py
├── pyproject.toml
├── README.md
└── .github/
    └── workflows/
        └── publish.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;your-mcp-server &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;your-mcp-server
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; src/your_package
&lt;span class="nb"&gt;touch &lt;/span&gt;src/your_package/__init__.py src/your_package/main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Write Your Tool (10 min)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# src/your_package/main.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;__future__&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;annotations&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastmcp&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastMCP&lt;/span&gt;

&lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastMCP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-mcp-server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;instructions&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Describe what your server does in one paragraph.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@mcp.tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What this tool does in plain language. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Include the Western parallel if applicable. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Note if it uses DEMO data.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;your_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;param1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Description of param1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;param2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Annotated&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Description of param2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# Your logic here
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;result&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Processed &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;param1&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;note&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DEMO — replace with real data source in production&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-mcp-server&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Configure pyproject.toml (3 min)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;build-system&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;requires&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"setuptools&amp;gt;=61.0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;build-backend&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"setuptools.build_meta"&lt;/span&gt;  &lt;span class="c"&gt;# ← exact string, no variation&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"your-mcp-server"&lt;/span&gt;
&lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="n"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"One-line description"&lt;/span&gt;
&lt;span class="n"&gt;authors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Your Name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"you@example.com"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="n"&gt;license&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"MIT"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;readme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"README.md"&lt;/span&gt;
&lt;span class="n"&gt;requires-python&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"&amp;gt;=3.9"&lt;/span&gt;
&lt;span class="n"&gt;dependencies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"fastmcp&amp;gt;=2.0.0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;project&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scripts&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;your-mcp-server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"your_package.main:main"&lt;/span&gt;  &lt;span class="c"&gt;# CLI entry point&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setuptools&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;packages&lt;/span&gt;&lt;span class="k"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="k"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;where&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c"&gt;# ← required for src/ layout&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Common mistake:&lt;/strong&gt; &lt;code&gt;build-backend = "setuptools.backends.legacy:build"&lt;/code&gt; is not valid. Use exactly &lt;code&gt;"setuptools.build_meta"&lt;/code&gt;. This error causes &lt;code&gt;python -m build&lt;/code&gt; to fail silently in CI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Set Up CI Publishing (5 min)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Option A: API Token (faster)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a PyPI API token at &lt;a href="https://pypi.org/manage/account/#api-tokens" rel="noopener noreferrer"&gt;pypi.org/manage/account/#api-tokens&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add as &lt;code&gt;PYPI_API_TOKEN&lt;/code&gt; in your GitHub repo → Settings → Secrets&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Option B: OIDC Trusted Publisher (more secure, recommended)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create the package on PyPI first (one push via token)&lt;/li&gt;
&lt;li&gt;Go to &lt;code&gt;pypi.org/manage/project/{name}/settings/publishing/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add GitHub Actions publisher: owner, repo, &lt;code&gt;publish.yml&lt;/code&gt;, environment &lt;code&gt;pypi&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;.github/workflows/publish.yml:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish to PyPI&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;v*"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;publish&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-python@v5&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;python-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3.11"&lt;/span&gt;&lt;span class="pi"&gt;}&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pip install build&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python -m build&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pypa/gh-action-pypi-publish@release/v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.PYPI_API_TOKEN }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5: Publish (2 min)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git add &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"initial commit"&lt;/span&gt;
git remote add origin https://github.com/yourusername/your-mcp-server
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main

git tag v0.1.0 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push origin v0.1.0
&lt;span class="c"&gt;# → GitHub Actions runs → pip install your-mcp-server works in 2-3 minutes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6: Connect to Claude (1 min)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;your-mcp-server

&lt;span class="c"&gt;# Add to Claude Code&lt;/span&gt;
claude mcp add myserver &lt;span class="nt"&gt;--&lt;/span&gt; your-mcp-server

&lt;span class="c"&gt;# Test&lt;/span&gt;
claude &lt;span class="s2"&gt;"Use myserver to process X"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  East Africa Design Patterns
&lt;/h2&gt;

&lt;p&gt;A few patterns specific to building for this context:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Trust integrity:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;result&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;note&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DEMO — Synthetic data for educational purposes. Not operational guidance.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-mcp-server. Research basis: [cite your source]&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Swahili/English bilingual errors:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hitilafu / Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Jaribu tena / Try again.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Version bump workflow:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Edit pyproject.toml → version = "0.2.0"&lt;/span&gt;
git commit &lt;span class="nt"&gt;-am&lt;/span&gt; &lt;span class="s2"&gt;"bump: v0.2.0"&lt;/span&gt;
git tag v0.2.0 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; git push origin main &lt;span class="nt"&gt;--tags&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the complete cycle. Every MCP server in the &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;East Africa coordination stack&lt;/a&gt; was built and published with exactly this scaffold.&lt;/p&gt;




&lt;p&gt;Full portfolio and all 12 packages: &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;gabrielmahia.github.io&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>python</category>
      <category>tutorial</category>
      <category>africa</category>
    </item>
    <item>
      <title>Constitutional Rights in Swahili: Building a Multi-Agent Debate System</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Sat, 25 Jul 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/constitutional-rights-in-swahili-building-a-multi-agent-debate-system-g0j</link>
      <guid>https://dev.to/gabrielmahia/constitutional-rights-in-swahili-building-a-multi-agent-debate-system-g0j</guid>
      <description>&lt;p&gt;40%+ of Kenyans don't know their constitutional rights. Not because the rights don't exist — Kenya's 2010 constitution is among the most progressive in Africa — but because the information is locked in dense legal language, available only in English, and not easily accessible through any institutional channel.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;hakiyangu&lt;/code&gt; (haki = rights, yangu = mine — "my rights") is a multi-agent constitutional debate system that presents both the government's position and the citizen's rights on any constitutional question, in Swahili or English.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Research Basis
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;arXiv:2305.19118 — Liang et al. (2023):&lt;/strong&gt; "Encouraging Divergent Thinking in Large Language Models through Debate"&lt;/p&gt;

&lt;p&gt;This paper demonstrated that when multiple AI agents argue opposing positions on a question, the final synthesized answer is measurably less biased and more accurate than a single-agent response. The adversarial format forces the AI to consider the strongest version of each position before synthesizing.&lt;/p&gt;

&lt;p&gt;For constitutional rights questions, this is particularly important: the government has legitimate interests, and citizens have constitutional protections. Neither perspective alone gives a complete picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three-Agent Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Agent 1: Government Legal Officer
&lt;/span&gt;&lt;span class="n"&gt;gov_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_gemini&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a Senior Government Legal Officer defending the Kenya government 
            position on constitutional rights. Be factual. Cite actual articles.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Citizen question: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Agent 2: Human Rights Advocate  
&lt;/span&gt;&lt;span class="n"&gt;cit_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_gemini&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a Human Rights Advocate defending citizen constitutional rights.
            Cite actual articles. Acknowledge government has valid interests.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Citizen question: &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Agent 3: Constitutional Law Lecturer (synthesis)
&lt;/span&gt;&lt;span class="n"&gt;synthesis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_gemini&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are an independent Constitutional Law Lecturer at University of Nairobi.
            Synthesize both sides. Focus on: what can the citizen do, what are their 
            strongest legal protections, when to seek formal legal help.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Government argued: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;gov_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;
Rights advocate argued: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;cit_response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each agent has a defined role and is explicitly instructed to cite the actual Kenya Constitution articles, not summarize them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rights Covered
&lt;/h2&gt;

&lt;p&gt;Six rights from the Kenya Constitution 2010:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Freedom of Expression (Article 33)&lt;/li&gt;
&lt;li&gt;Right to Property (Article 40)&lt;/li&gt;
&lt;li&gt;Right to a Fair Trial (Article 50)&lt;/li&gt;
&lt;li&gt;Freedom from Discrimination (Article 27)&lt;/li&gt;
&lt;li&gt;Right to Education (Article 43)&lt;/li&gt;
&lt;li&gt;Freedom of Movement (Article 26)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each right has pre-loaded context, the government's constitutional basis for limitations, and the citizen's strongest protections.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Error Handling Lesson
&lt;/h2&gt;

&lt;p&gt;The original &lt;code&gt;haki-debate-ai&lt;/code&gt; (now &lt;code&gt;hakiyangu&lt;/code&gt;) had no try/except around the three Gemini calls. When the API returned HTTP 404 (due to a &lt;code&gt;v1beta&lt;/code&gt; vs &lt;code&gt;v1&lt;/code&gt; endpoint change), the error surfaced as a full Streamlit traceback — including file paths and code snippets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Before: one unprotected call, full crash on error
&lt;/span&gt;&lt;span class="n"&gt;gov_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_gemini&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gov_system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# After: wrapped calls with Swahili error messages
&lt;/span&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;gov_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_gemini&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gov_system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;question&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;gov_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;⚠️ Hitilafu: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="si"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Users see "Hitilafu ya API (404). Jaribu tena baadaye. / API error. Please try again later." — not a Python traceback. Production apps owe users graceful degradation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Streamlit Cloud: github.com/gabrielmahia/hakiyangu&lt;/span&gt;
&lt;span class="c"&gt;# Secret: GOOGLE_API_KEY = "your-gemini-key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it at hakiyangu.streamlit.app &lt;em&gt;(setup in progress)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gabrielmahia/hakiyangu" rel="noopener noreferrer"&gt;github.com/gabrielmahia/hakiyangu&lt;/a&gt; · CC BY-NC-ND 4.0&lt;/p&gt;

</description>
      <category>civictech</category>
      <category>africa</category>
      <category>ai</category>
      <category>swahili</category>
    </item>
  </channel>
</rss>
