<?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.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>Why Swahili AI Fails at 4 the Rate of English — and How We're Fixing It</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Thu, 04 Jun 2026 11:03:54 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/why-swahili-ai-fails-at-4x-the-rate-of-english-and-how-were-fixing-it-465g</link>
      <guid>https://dev.to/gabrielmahia/why-swahili-ai-fails-at-4x-the-rate-of-english-and-how-were-fixing-it-465g</guid>
      <description>&lt;p&gt;A 2025 benchmark study (arXiv:2509.04516) confirmed what East African AI developers had been observing: &lt;strong&gt;general-purpose language models produce 4× more errors in Swahili than English&lt;/strong&gt; — even for simple factual tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Root Cause: Data Starvation
&lt;/h2&gt;

&lt;p&gt;Common Crawl, the primary LLM pre-training corpus, is ~50% English and ~0.1% Swahili. That's a 500× data disparity. Models don't fail at Swahili because Swahili is hard — they fail because they've never seen enough of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Compounding Problem
&lt;/h2&gt;

&lt;p&gt;For civic and financial AI in Kenya, it compounds. Kenyan-specific concepts have essentially zero representation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;M-PESA paybill codes and USSD flow formats&lt;/li&gt;
&lt;li&gt;KCSE exam structure and curriculum terminology&lt;/li&gt;
&lt;li&gt;Kenya Revenue Authority eTims procedures
&lt;/li&gt;
&lt;li&gt;County government devolution vocabulary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ask any major LLM to troubleshoot a failed M-PESA B2C payment in Swahili. You'll get plausible confabulation — a payment flow that doesn't match how Daraja actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What We've Built: 110+ Domain-Specific Tools
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;East Africa AI portfolio&lt;/a&gt; addresses this through three principles:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Domain knowledge embedded at the system level
&lt;/h3&gt;

&lt;p&gt;Every tool embeds Kenyan institutional context as baseline knowledge — not retrieval. The model knows what a paybill code is, what KCSE stands for, what the Employment Act says about notice periods.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Swahili as first language, not afterthought
&lt;/h3&gt;

&lt;p&gt;"Angalia salio la M-PESA" is not a translation of "Check M-PESA balance" — it's what a Kenyan would actually say. Writing natively instead of translating builds trust with users.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. MCP infrastructure as force multiplier
&lt;/h3&gt;

&lt;p&gt;By wrapping Kenya's APIs as MCP servers — &lt;a href="https://github.com/gabrielmahia/mpesa-mcp" rel="noopener noreferrer"&gt;mpesa-mcp&lt;/a&gt;, &lt;a href="https://github.com/gabrielmahia/swahili-health-mcp" rel="noopener noreferrer"&gt;swahili-health-mcp&lt;/a&gt;, &lt;a href="https://github.com/gabrielmahia/kenya-legal-rag" rel="noopener noreferrer"&gt;kenya-legal-rag&lt;/a&gt; — any AI agent inherits correct domain behavior. Tool descriptions are in Kiswahili so agents reason directly from the user's language.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Data Fix: LINGUA Africa Grant
&lt;/h2&gt;

&lt;p&gt;Long-term fix: better training data. The LINGUA Africa grant application (Microsoft AI for Good Lab × Gates Foundation × Masakhane) targets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;100,000+ labeled Swahili sentence pairs&lt;/strong&gt; — financial, civic, educational&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LoRA fine-tuning of Aya-101&lt;/strong&gt; (13B parameters, Apache 2.0)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DPO alignment&lt;/strong&gt; for accuracy in high-stakes domains&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community evaluation&lt;/strong&gt; with real M-PESA agents, students, civic journalists in Kenya&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Four open datasets are live on HuggingFace now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/datasets/gmahia/swahili-civic-nlp" rel="noopener noreferrer"&gt;gmahia/swahili-civic-nlp&lt;/a&gt; — civic and government terms&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/datasets/gmahia/kenya-civic-data" rel="noopener noreferrer"&gt;gmahia/kenya-civic-data&lt;/a&gt; — county government data&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/datasets/gmahia/kenya-agricultural-qa" rel="noopener noreferrer"&gt;gmahia/kenya-agricultural-qa&lt;/a&gt; — crop and livestock Q&amp;amp;A&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://huggingface.co/datasets/gmahia/kenya-legal-nlp" rel="noopener noreferrer"&gt;gmahia/kenya-legal-nlp&lt;/a&gt; — Kenya legal NER annotations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All CC BY 4.0. The tools work today. The grant makes them work better at scale.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Portfolio:&lt;/strong&gt; &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;gabrielmahia.github.io&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;HuggingFace:&lt;/strong&gt; &lt;a href="https://huggingface.co/gmahia" rel="noopener noreferrer"&gt;huggingface.co/gmahia&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>africa</category>
      <category>opensource</category>
    </item>
    <item>
      <title>First in East Africa on All Three AI Agent Protocols: MCP, A2A, and Google ADK</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Thu, 04 Jun 2026 11:03:16 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/first-in-east-africa-on-all-three-ai-agent-protocols-mcp-a2a-and-google-adk-4027</link>
      <guid>https://dev.to/gabrielmahia/first-in-east-africa-on-all-three-ai-agent-protocols-mcp-a2a-and-google-adk-4027</guid>
      <description>&lt;p&gt;In 2024-2025, three significant AI agent protocols emerged:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;MCP (Model Context Protocol)&lt;/strong&gt; — Anthropic's open standard for tools and data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A2A (Agent-to-Agent)&lt;/strong&gt; — cross-vendor agent communication protocol
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google ADK (Agent Development Kit)&lt;/strong&gt; — production agent pipeline framework&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most developers picked one. Most regions had zero implementations of any.&lt;/p&gt;

&lt;p&gt;I built all three — for East Africa — and I'm the first documented engineer in the region to do so.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why All Three?
&lt;/h2&gt;

&lt;p&gt;The ecosystem will consolidate, and first-mover implementations are valuable regardless of which wins. Being the reference for East Africa on all three means the region's infrastructure isn't locked to any single vendor's roadmap.&lt;/p&gt;

&lt;p&gt;But practically: each genuinely solves a different problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  MCP — For Wrapping Existing APIs
&lt;/h2&gt;

&lt;p&gt;MCP is the right choice when wrapping APIs as tool calls an AI agent can invoke directly.&lt;/p&gt;

&lt;p&gt;For 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;mpesa-mcp       &lt;span class="c"&gt;# M-PESA Daraja API&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;wapimaji-mcp    &lt;span class="c"&gt;# Kenya water infrastructure&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;swahili-health-mcp  &lt;span class="c"&gt;# DHIS2 health data&lt;/span&gt;

&lt;span class="c"&gt;# Add to Claude&lt;/span&gt;
claude mcp add mpesa &lt;span class="nt"&gt;--&lt;/span&gt; mpesa-mcp
claude mcp add water &lt;span class="nt"&gt;--&lt;/span&gt; wapimaji-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MCP's value: &lt;strong&gt;reducing integration friction per developer to near-zero&lt;/strong&gt;. The institutional knowledge lives in the MCP server, not in every app built on top.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; &lt;a href="https://github.com/gabrielmahia/mpesa-mcp" rel="noopener noreferrer"&gt;mpesa-mcp&lt;/a&gt; — v0.1.9 on PyPI, 400+ downloads, 12 countries, first African payment API in the MCP ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  A2A — For Multi-Agent Coordination
&lt;/h2&gt;

&lt;p&gt;A2A is the right choice when multiple specialized agents need to coordinate on complex tasks — negotiating, delegating, sharing context.&lt;/p&gt;

&lt;p&gt;For Kenya's civic stack, this means budget accountability that needs a financial agent + legal agent + Swahili summarization agent working together. &lt;a href="https://github.com/gabrielmahia/kenya-a2a" rel="noopener noreferrer"&gt;kenya-a2a&lt;/a&gt; handles the message routing and capability advertisement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Google ADK — For Production Pipelines
&lt;/h2&gt;

&lt;p&gt;ADK is the right choice for production-grade pipelines with evaluation and observability. &lt;a href="https://github.com/gabrielmahia/kenya-adk" rel="noopener noreferrer"&gt;kenya-adk&lt;/a&gt; runs multi-step Swahili advisory workflows with integrated quality evaluation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Swahili-First Architecture
&lt;/h2&gt;

&lt;p&gt;All three implementations share one principle: &lt;strong&gt;tool descriptions are written in Kiswahili&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When an AI agent receives a Swahili instruction and selects tools, it matches against descriptions. English descriptions introduce a translation step — a failure mode. Swahili descriptions eliminate it:&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="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&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;mpesa_stk_push&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;description&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;Anzisha malipo ya Lipa Na M-PESA. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
                   &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Tumia wakati mtumiaji anataka kulipa kwa M-PESA.&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;
  
  
  Status
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Protocol&lt;/th&gt;
&lt;th&gt;Repo&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MCP&lt;/td&gt;
&lt;td&gt;mpesa-mcp&lt;/td&gt;
&lt;td&gt;v0.1.9 · PyPI · 400+ downloads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MCP&lt;/td&gt;
&lt;td&gt;wapimaji-mcp, swahili-health-mcp, kenya-legal-rag&lt;/td&gt;
&lt;td&gt;Live&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A2A&lt;/td&gt;
&lt;td&gt;kenya-a2a&lt;/td&gt;
&lt;td&gt;Live&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADK&lt;/td&gt;
&lt;td&gt;kenya-adk&lt;/td&gt;
&lt;td&gt;Live&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All MIT licensed. All part of a 110+ tool East Africa portfolio.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/gabrielmahia/kenya-mcp-hub" rel="noopener noreferrer"&gt;Kenya MCP Hub&lt;/a&gt; is a CLI registry for all servers:&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;kenya-mcp-hub
kenya-mcp-hub list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Portfolio:&lt;/strong&gt; &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>agents</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>How I Built an MCP Server for M-PESA — and Why It Matters for East Africa</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Thu, 04 Jun 2026 11:02:16 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/how-i-built-an-mcp-server-for-m-pesa-and-why-it-matters-for-east-africa-42p7</link>
      <guid>https://dev.to/gabrielmahia/how-i-built-an-mcp-server-for-m-pesa-and-why-it-matters-for-east-africa-42p7</guid>
      <description>&lt;p&gt;Kenya's M-PESA processes $314 billion annually. 35 million users. And until recently, there was no way for an AI agent to interact with it natively.&lt;/p&gt;

&lt;p&gt;That changed when I built &lt;strong&gt;mpesa-mcp&lt;/strong&gt; — a &lt;a href="https://modelcontextprotocol.io" rel="noopener noreferrer"&gt;Model Context Protocol&lt;/a&gt; server that wraps the Daraja API and makes it directly available to Claude, GPT-4, and Gemini.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is MCP?
&lt;/h2&gt;

&lt;p&gt;Model Context Protocol (MCP) is Anthropic's open standard for connecting AI agents to external tools and data sources. Think of it like REST, but for AI agents — instead of an LLM hallucinating what an API might return, it calls real tools with real data.&lt;/p&gt;

&lt;p&gt;An MCP server exposes tools. An AI agent calls those tools. The agent never has to understand the underlying API — it just asks "what tools do you have?" and gets structured results back.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem with M-PESA Integration
&lt;/h2&gt;

&lt;p&gt;M-PESA's Daraja API is well-documented but non-trivial to integrate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OAuth 2.0 token flow with 1-hour expiry&lt;/li&gt;
&lt;li&gt;Request body for STK push includes a &lt;strong&gt;base64-encoded password&lt;/strong&gt; derived from shortcode + passkey + timestamp — regenerated every request&lt;/li&gt;
&lt;li&gt;Different base URLs for sandbox vs production&lt;/li&gt;
&lt;li&gt;Different authentication flows for STK push, B2C, balance query, transaction status&lt;/li&gt;
&lt;li&gt;Error codes are numeric strings, not HTTP status codes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For every developer building an AI assistant on M-PESA, this was ~2 days of integration work &lt;em&gt;before&lt;/em&gt; writing a single line of product logic. And every team building their own integration meant every team making the same mistakes with the passkey encoding.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: mpesa-mcp
&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;mpesa-mcp
claude mcp add mpesa &lt;span class="nt"&gt;--&lt;/span&gt; mpesa-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Your Claude instance can now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initiate STK push payments (Lipa Na M-PESA)&lt;/li&gt;
&lt;li&gt;Execute B2C disbursements&lt;/li&gt;
&lt;li&gt;Query account balances&lt;/li&gt;
&lt;li&gt;Check transaction status&lt;/li&gt;
&lt;li&gt;Register C2B callback URLs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's what a tool call looks like from inside the server:&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;def&lt;/span&gt; &lt;span class="nf"&gt;mcp_call_tool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&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="n"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;dict&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="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;mpesa_stk_push&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;get_access_token&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# handles OAuth internally
&lt;/span&gt;        &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_password&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;shortcode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;passkey&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# base64 + timestamp
&lt;/span&gt;        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;initiate_stk_push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;phone_number&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="n"&gt;amount&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="n"&gt;account_ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;arguments&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;account_reference&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;Payment&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;The MCP server handles the OAuth dance, password generation, and error normalization. The AI agent just says "initiate an M-PESA payment of 100 to 0722000000" and gets a structured result back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "First African Payment API in MCP"
&lt;/h2&gt;

&lt;p&gt;When I shipped mpesa-mcp in 2024, there were hundreds of MCP servers for AWS, GitHub, Stripe, Slack — every major Western tech API. There were zero for African financial infrastructure.&lt;/p&gt;

&lt;p&gt;That gap matters. M-PESA isn't just Kenya's payment system — it's the model for mobile money globally. It's processed more transactions than PayPal in some quarters. It operates in Kenya, Tanzania, Uganda, Rwanda, Mozambique, Lesotho, Ghana, and Egypt. And it had no AI agent integration.&lt;/p&gt;

&lt;p&gt;mpesa-mcp makes M-PESA a first-class citizen in the MCP ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;v0.1.9&lt;/strong&gt; on PyPI: &lt;code&gt;pip install mpesa-mcp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;400+ downloads&lt;/strong&gt; across 12 countries — without any marketing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PR #7395&lt;/strong&gt; on &lt;a href="https://github.com/punkpeye/awesome-mcp-servers/pull/7395" rel="noopener noreferrer"&gt;awesome-mcp-servers&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Part of a &lt;strong&gt;110+ tool&lt;/strong&gt; East Africa AI portfolio&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;mpesa-mcp v2.0 will add &lt;strong&gt;Swahili-native tool descriptions&lt;/strong&gt; — so AI agents receiving instructions in Kiswahili can call M-PESA tools correctly without any translation step. This is part of the &lt;a href="https://masakhane.submittable.com/submit/355473" rel="noopener noreferrer"&gt;LINGUA Africa grant application&lt;/a&gt; targeting Swahili model fine-tuning.&lt;/p&gt;

&lt;p&gt;The repo is MIT licensed and open for contributions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/gabrielmahia/mpesa-mcp" rel="noopener noreferrer"&gt;gabrielmahia/mpesa-mcp&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;PyPI:&lt;/strong&gt; &lt;a href="https://pypi.org/project/mpesa-mcp/" rel="noopener noreferrer"&gt;pypi.org/project/mpesa-mcp&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Portfolio:&lt;/strong&gt; &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>africa</category>
      <category>fintech</category>
    </item>
    <item>
      <title>6 weeks later: mpesa-mcp is on the official MCP Registry — here's what I learned</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Tue, 24 Mar 2026 04:12:06 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/6-weeks-later-mpesa-mcp-is-on-the-official-mcp-registry-heres-what-i-learned-1o84</link>
      <guid>https://dev.to/gabrielmahia/6-weeks-later-mpesa-mcp-is-on-the-official-mcp-registry-heres-what-i-learned-1o84</guid>
      <description>&lt;p&gt;&lt;em&gt;Follow-up to: &lt;a href="https://dev.to/gabrielmahia/why-m-pesa-africas-talking-and-ussd-are-missing-from-ai-agent-tooling"&gt;Why M-Pesa, Africa's Talking, and USSD are missing from AI agent tooling&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Six weeks ago I published &lt;code&gt;mpesa-mcp&lt;/code&gt; — an MCP server that gives AI agents access to M-Pesa Daraja and Africa's Talking. Here's what actually happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  What landed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Official MCP Registry.&lt;/strong&gt; &lt;code&gt;mpesa-mcp&lt;/code&gt; is now listed at &lt;code&gt;io.github.gabrielmahia/mpesa-mcp&lt;/code&gt; on &lt;a href="https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.gabrielmahia" rel="noopener noreferrer"&gt;registry.modelcontextprotocol.io&lt;/a&gt;. This is Anthropic's official registry — the one Claude uses to discover MCP servers. It's the first African fintech entry.&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;# Install via the registry&lt;/span&gt;
uvx mpesa-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;punkpeye opened a PR on my repo.&lt;/strong&gt; punkpeye is the maintainer of &lt;a href="https://github.com/punkpeye/awesome-mcp-servers" rel="noopener noreferrer"&gt;awesome-mcp-servers&lt;/a&gt; (82k stars). He submitted a PR to add the Glama card badge to the mpesa-mcp README. That's the maintainer of the most-starred MCP directory directly contributing to the project — a signal I did not expect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;v0.1.2 shipped.&lt;/strong&gt; Changelog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fixed a unicode character in &lt;code&gt;glama.json&lt;/code&gt; that was causing Glama to reject the file as invalid&lt;/li&gt;
&lt;li&gt;Cleaned up the Dockerfile for proper MCP server inspection&lt;/li&gt;
&lt;li&gt;Version aligned across &lt;code&gt;pyproject.toml&lt;/code&gt;, &lt;code&gt;server.json&lt;/code&gt;, and GitHub releases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;context-hub PR #52 is still open.&lt;/strong&gt; The reviewer (@Ivanye2509) asked for structural fixes in March. I fixed them within a week. No response since. Andrew Ng's project appears to have a slow review cadence. The PR is structurally correct, mergeable, and sitting there. If you're reading this and use context-hub — &lt;a href="https://github.com/andrewyng/context-hub/pull/52" rel="noopener noreferrer"&gt;go take a look&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I got wrong in the original post
&lt;/h2&gt;

&lt;p&gt;I said "submitted to punkpeye/awesome-mcp-servers — the first African fintech entry." That was accurate at submission time.&lt;/p&gt;

&lt;p&gt;What I underestimated: the friction involved in actually getting &lt;em&gt;listed&lt;/em&gt;. The awesome-mcp-servers bot applies a &lt;code&gt;missing-glama&lt;/code&gt; label automatically if the Glama directory doesn't recognise your server. Glama's API was returning 503 for several weeks. A single unicode em-dash in &lt;code&gt;glama.json&lt;/code&gt; was causing silent rejection. The listing pipeline is fragile for anyone not already inside the Node/TypeScript MCP ecosystem — which is most of it.&lt;/p&gt;

&lt;p&gt;The fix: ASCII-only &lt;code&gt;glama.json&lt;/code&gt;, a valid &lt;code&gt;Dockerfile&lt;/code&gt;, at least one GitHub release. All documented now in the repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually being used
&lt;/h2&gt;

&lt;p&gt;GitHub traffic for the past 14 days: 21 direct views, 18 unique visitors, 190 clones.&lt;/p&gt;

&lt;p&gt;The clone-to-view ratio (~9:1) is high — developers are cloning to evaluate rather than browsing. The &lt;code&gt;actions&lt;/code&gt; and &lt;code&gt;issues&lt;/code&gt; pages are being read, which means people are kicking the tyres on CI and checking whether the project is maintained. The signal that matters: mpesa-mcp is being evaluated by developers, not just scraped by bots.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ship a working sandbox demo earlier.&lt;/strong&gt; The package works, but the barrier to "see it do something real" is still: get Daraja sandbox credentials, set up environment variables, configure Claude Desktop. That's 30 minutes even for a confident developer. A hosted demo that shows an actual STK Push prompt (Daraja sandbox) with zero setup would have converted more evaluators to users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Document the phone number normalization problem sooner.&lt;/strong&gt; The most common Daraja integration bug is phone format: &lt;code&gt;0712345678&lt;/code&gt; vs &lt;code&gt;254712345678&lt;/code&gt; vs &lt;code&gt;+254712345678&lt;/code&gt;. The server handles all three transparently. I buried this in the README. It should be the first thing developers see.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Three things on the near horizon:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;WapiMaji SMS pipeline needs a registered shortcode.&lt;/strong&gt; The water stress monitoring app for Kenya has complete Africa's Talking SMS integration — but you need a registered shortcode to actually send to arbitrary Kenyan numbers. That's a $10/month infra cost I haven't pulled the trigger on. When it's live, WapiMaji can SMS drought alerts to farmers on basic phones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The broader civic tools portfolio.&lt;/strong&gt; mpesa-mcp is one of 5 open-source packages and 13 deployed tools I've built for East Africa. The full portfolio is at &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;gabrielmahia.github.io&lt;/a&gt;. I'll write a separate piece on the civic tools — parliamentary accountability, crop prices, remittance transparency — but the audience for that is different from this one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;daraja-mock v2.&lt;/strong&gt; The local test server for M-Pesa integrations needs a web UI so non-developers can inspect what the simulated STK Push flow looks like without reading JSON.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;If you're building on M-Pesa or Africa's Talking and want to talk about the integration patterns — or if you've encountered the context-hub review wall — &lt;a href="mailto:contact@aikungfu.dev"&gt;reach out&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All tools: &lt;a href="https://gabrielmahia.github.io" rel="noopener noreferrer"&gt;gabrielmahia.github.io&lt;/a&gt; · mpesa-mcp: &lt;a href="https://github.com/gabrielmahia/mpesa-mcp" rel="noopener noreferrer"&gt;github.com/gabrielmahia/mpesa-mcp&lt;/a&gt;&lt;/em&gt;``&lt;/p&gt;

</description>
      <category>kenya</category>
      <category>mcp</category>
      <category>python</category>
    </item>
    <item>
      <title>Why M-Pesa, Africa's Talking, and USSD are missing from AI agent tooling — and what I did about it</title>
      <dc:creator>Gabriel Mahia</dc:creator>
      <pubDate>Tue, 10 Mar 2026 11:36:37 +0000</pubDate>
      <link>https://dev.to/gabrielmahia/why-m-pesa-africas-talking-and-ussd-are-missing-from-ai-agent-tooling-and-what-i-did-about-it-56fo</link>
      <guid>https://dev.to/gabrielmahia/why-m-pesa-africas-talking-and-ussd-are-missing-from-ai-agent-tooling-and-what-i-did-about-it-56fo</guid>
      <description>&lt;p&gt;I spend a lot of time building tools for Kenya. Payment flows, agricultural alerts, county budget dashboards. The infrastructure layer — M-Pesa, Africa's Talking, USSD — is battle-tested and used by hundreds of millions of people across East Africa.&lt;/p&gt;

&lt;p&gt;And yet, when I went to build AI-powered tools that interact with this infrastructure, I found almost nothing. The model context protocol (MCP) ecosystem, which is becoming the standard way AI agents interact with external services, had zero African fintech entries. The context-hub registry — Andrew Ng's project for sharing API documentation as AI-consumable context — had no African payment or telecom providers.&lt;/p&gt;

&lt;p&gt;This is the canonical Africa tech gap, but appearing in a new form: the AI tooling layer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's actually missing
&lt;/h2&gt;

&lt;p&gt;M-Pesa processes more transactions by volume than PayPal does in Kenya. Africa's Talking reaches developers building on 20+ African telecom networks — Safaricom, MTN, Airtel, Vodacom, Telkom — from a single SDK. USSD (Unstructured Supplementary Service Data) is the dominant self-service channel for banking and government services across the continent, accessible on any phone, no internet required.&lt;/p&gt;

&lt;p&gt;When AI agents need to work with payments, they have Stripe, PayPal, Braintree. When they need to send messages, they have Twilio. When they need to understand merchant flows, they have Square.&lt;/p&gt;

&lt;p&gt;For any agent building something that actually works in Kenya, Uganda, Ghana, Rwanda — there was nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;Over the past week, I contributed six API documentation sets to context-hub and built an MCP server that gives AI agents direct access to M-Pesa and Africa's Talking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;context-hub contributions (PR #52):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;africastalking/sms&lt;/code&gt; — bulk send, delivery webhooks, Kiswahili Unicode, county targeting&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;africastalking/ussd&lt;/code&gt; — full session handling, Redis state, bilingual menus, 182-char budget rules&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;africastalking/airtime&lt;/code&gt; — 8-country currency table, NGO payout patterns&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;safaricom/daraja&lt;/code&gt; — STK Push with password generation, C2B, B2C, phone normalization&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;paystack/payments&lt;/code&gt; — Nigeria/Ghana/Kenya/SA, HMAC webhook, mobile money, split payments&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mtn-momo/collections&lt;/code&gt; — 17-country coverage, async polling, PUT webhook pattern&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If these get merged, any developer using Claude Code, Cursor, or Copilot who runs &lt;code&gt;chub get safaricom/daraja&lt;/code&gt; will get production-quality documentation as structured context. The patterns for STK Push authentication (the base64 password generation with timestamp is non-obvious), webhook verification, and phone number normalization (every Kenyan format maps to a different E.164 variant) are exactly the things that aren't documented clearly anywhere.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mpesa-mcp:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The MCP server (&lt;code&gt;pip install mpesa-mcp&lt;/code&gt; or &lt;code&gt;uvx mpesa-mcp&lt;/code&gt;) gives AI agents five tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mpesa_stk_push           — trigger payment prompt on customer's phone
mpesa_stk_query          — check STK Push status
mpesa_transaction_status — query any M-Pesa transaction by receipt
sms_send                 — 1–1,000 recipients across 20+ African networks
airtime_send             — programmatic airtime top-up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's submitted to &lt;a href="https://github.com/punkpeye/awesome-mcp-servers/pull/3022" rel="noopener noreferrer"&gt;punkpeye/awesome-mcp-servers&lt;/a&gt; — the first African fintech entry in that list (82k stars).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond the tools themselves
&lt;/h2&gt;

&lt;p&gt;African developers are dramatically underrepresented as contributors to AI infrastructure. The tools being built to power the next generation of AI applications are being built by and for markets with credit cards, Stripe accounts, and Twilio numbers. The result is predictable: agents that can't operate in the markets where the infrastructure is completely different.&lt;/p&gt;

&lt;p&gt;The gap isn't technical — the M-Pesa API is well-designed, Africa's Talking is developer-friendly. The gap is presence. Nobody put in the work to document these APIs in the formats that AI tooling consumes.&lt;/p&gt;

&lt;p&gt;That's a fixable problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;The context-hub PR needs to merge. If it does, the distribution is significant — every Claude Code and Cursor user who runs &lt;code&gt;chub get&lt;/code&gt; will have access to it.&lt;/p&gt;

&lt;p&gt;I'm also building out the library layer: &lt;code&gt;daraja-mock&lt;/code&gt; (local test server so you can develop M-Pesa integrations without a Safaricom account), &lt;code&gt;kenya-sms&lt;/code&gt; (bilingual EN/Kiswahili SMS templates), &lt;code&gt;pesa-cli&lt;/code&gt; (command-line M-Pesa operations). These packages make building African fintech applications feel like building anything else — installable, testable, documented.&lt;/p&gt;

&lt;p&gt;The goal is to make "I'm building an app in Kenya" feel like a first-class engineering problem rather than a research project.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tools: &lt;a href="https://github.com/gabrielmahia/mpesa-mcp" rel="noopener noreferrer"&gt;mpesa-mcp&lt;/a&gt; · &lt;a href="https://github.com/andrewyng/context-hub/pull/52" rel="noopener noreferrer"&gt;context-hub PR&lt;/a&gt; · &lt;a href="https://github.com/punkpeye/awesome-mcp-servers/pull/3022" rel="noopener noreferrer"&gt;awesome-mcp-servers PR&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Full ecosystem: &lt;a href="https://github.com/gabrielmahia" rel="noopener noreferrer"&gt;github.com/gabrielmahia&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>kenya</category>
      <category>python</category>
      <category>mcp</category>
      <category>africa</category>
    </item>
  </channel>
</rss>
