{"id":"c3b092f6-d26e-4603-9acf-a1ac8752cd29","slug":"nairobi-stack","kind":"mcp","name":"nairobi-stack","summary":"Nairobi Stack — Developer resources and API documentation for building on Kenya's digital infrastructure.","owner":"gabrielmahia","repoUrl":"https://github.com/gabrielmahia/nairobi-stack","license":"MIT","licenseTier":"permissive","trust":"community","stars":1,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-02-28T14:07:56.000Z","addedAt":"2026-10-21T05:49:58.542Z","logoUrl":"https://avatars.githubusercontent.com/u/852033?u=a64818d1a48038a48b3fd2b8047f1ef7c44920ab&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["writing","data-analytics","memory-knowledge"],"tags":["kenya","infrastructure","africa","ai","coordination","data-sovereignty","east-africa","global-south"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-27T00:20:43.913Z","sample":false,"url":"https://conduits.dev/tools/nairobi-stack","language":"HTML","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# nairobi-stack\n\n> *The largest open-source MCP coordination infrastructure for the Global South.*  \n> *Local-first. Data-sovereign. MIT licensed.*\n\n**The engineering guide for building software products in East Africa — and everywhere institutions are under-resourced.**\n\n[![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightblue.svg)](LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\nA practical, opinionated reference for developers — in Kenya, the diaspora, or anywhere building for East African users. Covers APIs, infrastructure choices, UX patterns, regulatory context, and the cultural nuances that documentation never mentions.\n\n---\n\n\n## What Gets Built On This\n\nThese are not hypothetical. They are the trains for which these rails were built.\n\n---\n\n### Scenario 1: The rural health worker\nA community health worker in Kisumu runs `afya-mcp` + `offline-mcp` on a tablet\nwith no internet. She asks: *\"What is the correct malaria treatment for a 4-year-old\nweighing 15kg?\"* The query runs against a local Llama model. No data leaves the\ntablet. The answer arrives in Swahili in under 3 seconds.\n**Rails used:** `afya-mcp`, `offline-mcp`, `tafsiri-mcp`\n\n---\n\n### Scenario 2: The smallholder farmer\nA maize farmer in Nakuru wants to know whether to sell now or hold for two weeks.\nShe opens WhatsApp, sends a voice note to a bot powered by `soko-mcp`. The bot\nreturns current prices across eight East African markets, trend direction, and a\nsell/hold recommendation with the reasoning shown.\n**Rails used:** `soko-mcp`, `kilimo-mcp`\n\n---\n\n### Scenario 3: The Kenyan diaspora member in Virginia\nA Kenyan living in Virginia discovers that a caretaker has encroached on\nhis father's land in Kiambu. He needs to understand his legal options, initiate a\ndispute, and manage the process remotely. He uses `ardhi-mcp` + `familia-mcp` +\n`fomu-mcp` to understand the legal path, draft the initial letter, and track\nrequired documents — without hiring a Kenyan lawyer for the preliminary steps.\n**Rails used:** `ardhi-mcp`, `familia-mcp`, `fomu-mcp`, `diaspora-mcp`\n\n---\n\n### Scenario 4: The first-time SACCO member\nA 23-year-old boda boda rider in Nairobi wants to join a SACCO but doesn't know\nwhich one fits his income profile, what the obligations are, or whether the\ninstitution is legitimate. `jumuia-mcp` walks him through SACCO types, finds\nSASRA-regulated options in his county, and explains what joining actually commits\nhim to. In Swahili. On his phone.\n**Rails used:** `jumuia-mcp`, `sifa-mcp`, `tafsiri-mcp`\n\n---\n\n### Scenario 5: The county government AI deployment\nA county government in Western Kenya wants to deploy an AI assistant for\ncitizen services — permit status, budget enquiries, ward information. They deploy\nthe SII Stack on a local server. Citizen queries hit the sovereign tier first.\nOnly complex reasoning escalates to cloud inference. Citizen data never leaves\nthe county server.\n**Rails used:** `county-mcp`, `fomu-mcp`, `habari-mcp`, SII Stack sovereign tier\n\n---\n\n**Each scenario above can be built today.** The servers are live on PyPI.\nThe SII Stack is open-source. The architecture is documented.\nWhat's needed is someone who wants to run the train.\n\n→ [SII Stack](https://github.com/gabrielmahia/sii-stack) ·\n[Browse all servers](https://glama.ai/mcp/servers?query=author%3Agabrielmahia) ·\n[PyPI](https://pypi.org/user/gmahia)\n\n\n## Why this exists\n\nWestern developer documentation assumes broadband, credit cards, app stores, and English-only users. East African users may have any combination of: feature phones, sporadic 2G, M-Pesa (no bank account), Kiswahili or Sheng as primary language, prepaid data, and screen sizes that haven't been in a Western product review since 2014.\n\nThis guide is built from real integration work across three production systems — [Catholic Network Tools](https://github.com/gabrielmahia/jumuia), [OpenResilience](https://github.com/gabrielmahia/openresilience), and [RemitLens](https://github.com/gabrielmahia/remit-lens) — plus field experience in Nairobi, Mombasa, and across Kenya's 47 counties.\n\n---\n\n## Guides\n\n### Payments\n- [M-Pesa Integration](guides/mpesa-integration.md) — STK Push, B2C, webhooks, sandbox-to-live\n- [Remittance APIs](guides/remittance-apis.md) — Wise, Remitly, Sendwave: what's available, what's not\n\n### Communication\n- [USSD Patterns](guides/ussd-patterns.md) — menus, sessions, Africa's Talking\n- [SMS Infrastructure](guides/sms-infrastructure.md) — Africa's Talking, shortcodes, DLT registration\n\n### Data & Live APIs\n- [Live Data APIs](guides/live-data-apis.md) — 11 free keyless APIs confirmed working in Kenya: Open-Meteo, NDMA, COB, World Bank, WFP/HDX, LSK/FIDA/Judiciary RSS, open.er-api.com, Yahoo Finance\n\n### Design\n- [Mobile-First UX for Kenya](guides/mobile-first-ux.md) — offline, low-data, feature phone realities\n- [Kiswahili in Your Product](guides/kiswahili-in-products.md) — translation, tone, Sheng, code-switching\n\n### Infrastructure\n- [Deploying in East Africa](guides/deploying-in-east-africa.md) — latency, CDN, AWS vs local hosting\n- [Kenya Data Protection Act](guides/kenya-dpa.md) — ODPC compliance, consent, cross-border data\n\n### Finance & Regulatory\n- [Regulatory Landscape](guides/regulatory-landscape.md) — CBK, CMA, Communications Authority\n- [Chama Digitisation](guides/chama-digitisation.md) — domain model, M-Pesa integration, ROSCAs\n\n---\n\n\n\n## Why This Exists\n\n> *\"Build Rails, Not Trains.\"*\n\nTCP/IP didn't control the internet — it enabled it.\nRailroads didn't control freight — they enabled an economy.\nM-Pesa didn't control money — it enabled transactions at scale.\n\nThe MCP servers in this stack are rails.\n\nThey give AI agents structured, authenticated, locally-processed access to:\nthe M-PESA API, Kenya's 47-county government layer, a drought-phase data model (simulated until a data source is integrated),\nland title systems, health infrastructure, education records, and civic institutions.\n\nAny developer — anywhere — can `pip install mpesa-mcp` and give an AI agent\nthe ability to trigger a mobile payment in Kenya in under 120 seconds.\n\n**That's the rail. What you build on it is the train.**\n\n---\n\n### Structural Absences, Not Competitive Gaps\n\nThese servers weren't built because no one had thought of payments, drought data, or land records.\nThey were built because the engineer with the right intersection of skills hadn't built them yet.\n\nThe intersection: Kenyan institutional knowledge + diaspora perspective + AI infrastructure fluency.\n\nThat intersection doesn't exist in San Francisco or London.\nIt exists here.\n\n---\n\n### The Stewardship Principle\n\nEvery decision in this stack was made with one question:\n*\"What should I preserve, improve, and hand forward?\"*\n\n- MIT license: so others can build on it without asking permission\n- Local-first architecture: so communities steward their own data\n- Human-in-the-loop: so AI assists, never decides unilaterally\n- Offline sovereign tier: so the stack survives when the internet doesn't\n\nThis is not a product. It is infrastructure.\nInfrastructure is built for the people who come after you.\n\n---\n\n## Built for Africa. Deployable Anywhere.\n\n### The architecture is continent-generic. The data is local.\n\nEvery server in this stack separates **infrastructure** (tools, schemas, routing logic)\nfrom **data** (the Kenya-specific records, county budgets, NDMA classifications).\n\nReplace the data layer with Uganda's NSSF records, Nigeria's CAC registry,\nGhana's GhIPSS payment rails, or Tanzania's BRELA business registration —\nand the same architecture works without changing a line of application code.\n\n### Current depth: Kenya\nKenya is the starting point because it has the most developed data infrastructure\nfor this kind of tooling: M-Pesa, a mature Daraja API, NDMA drought data,\na 47-county government layer with structured data, and an active tech ecosystem.\n\n### Expansion logic: depth before breadth\nThe right expansion sequence is not \"build one thin server for every African country.\"\nIt is \"build deep coverage in one country, then lift and replicate.\"\n\nThe next depth targets, in order:\n1. **Tanzania** — 60M people, Swahili national language, fewer legacy constraints, quieter governance\n2. **Uganda** — 48M people, mobile money penetration, East African Community integration\n3. **Nigeria** — 220M people, largest African economy, fintech ecosystem (OPay, Flutterwave, Paystack)\n4. **Ghana** — 33M people, GhIPSS, stable institutions, English-speaking\n\nEach is a separate data layer on the same rail architecture.\n\n### What \"Africa-wide\" actually means\nSwahili covers East Africa and large parts of Central Africa (including DRC, Rwanda, Burundi).\n`tafsiri-mcp` covers a language that crosses borders, though its reference sets are Kenyan.\n`sifa-mcp` (portable reputation) and `soko-mcp` (market prices) have no inherent\nKenya boundary — the schema works for any East African market.\n\n---\n## 📊 Portfolio Stats — June 2026\n\n| Platform | Status |\n|----------|--------|\n| PyPI packages | 31 live (v0.1.1 · v0.1.9 for mpesa-mcp) |\n| Glama directory | 31 indexed |\n| Smithery.ai | Indexed (3+ confirmed) |\n| awesome-mcp-servers | mpesa-mcp listed · PR #8363 open |\n| HuggingFace datasets | 5 datasets · 246 total downloads |\n| Dev.to articles | 15 published · 244+ views |\n| DPGA submissions | 2 under review · 1 pending completion |\n\n## Contributing\n\nThis is a living document. If you've built something in East Africa and learned something the hard way, open a PR. See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n*Maintained by [Gabriel Mahia](https://github.com/gabrielmahia). Kenya × USA.*\n\n## MCP ecosystem updates (2026)\n\nKey developments relevant to East African developers building on mpesa-mcp:\n\n### Tool annotations (spec 2025-03-26)\n\nAll MCP tools should declare behavioral hints. For payment/SMS servers this is critical:\n\n```python\n@mcp.tool(annotations={\n    'title': 'M-Pesa STK Push',\n    'readOnlyHint': False,      # modifies state (moves money)\n    'destructiveHint': True,    # irreversible financial operation\n    'idempotentHint': False,    # each call creates a new transaction\n    'openWorldHint': True,      # reaches Safaricom's external API\n})\ndef mpesa_stk_push(phone: str, amount: int, ...):\n```\n\nWithout these, Claude Desktop and ChatGPT treat all tools as potentially destructive and may add unnecessary friction on read operations.\n\n### Server Cards / .well-known (roadmap Q2 2026)\n\nServers can advertise capabilities via `.well-known/mcp.json` — a static JSON file at the repo root that registries can index without connecting to your server. Add this to any MCP server you publish.\n\n### MCP accuracy benchmark\n\nCData's 2026 benchmark found MCP servers accurate 60–75% on complex queries. Write operations (payments, SMS) are the highest-risk category — test for:\n- All phone number formats: `0712345678`, `254712345678`, `+254712345678`\n- Boundary amounts (minimum 1 KES, maximum per API limit)\n- Missing optional fields (reference, description)\n\n### Streamlit 1.55.0 (March 2026)\n\nKey changes for East African app builders:\n- `st.metric` now has `delta_description` parameter — add context like \"vs last month\"\n- `st.tabs` supports `on_change` — dynamic loading of heavy data only when tab is opened\n- `st.image` has `link` parameter — clickable images for maps and charts\n- Widget binding (`bind` parameter) — sync widget state with URL query params for shareable links\n\n## AGENTS.md — tell AI coding agents how to work with your repo\n\n[AGENTS.md](https://github.com/aaif/agents.md) is a spec by OpenAI, now part of the\nAgentic AI Foundation (Linux Foundation). It's been adopted by 60,000+ repos and is\nsupported by Cursor, GitHub Copilot, Claude Code, Devin, Gemini CLI, and VS Code.\n\nAdd it to any repo you want AI coding tools to understand correctly:\n\n```markdown\n# AGENTS.md\n\n## What this is\n[Brief description]\n\n## Architecture\n[Directory structure]\n\n## Critical rules\n[Things agents must not change or break]\n\n## Running locally\n[Commands]\n```\n\nAll repos in the gabriel Mahia portfolio now have AGENTS.md files.\n\n## MCP vs A2A — know the difference\n\nBoth are 2025-2026 protocol standards under the Linux Foundation:\n\n| | MCP | A2A |\n|---|---|---|\n| What | Agent ↔ Tools | Agent ↔ Agent |\n| Created by | Anthropic | Google |\n| Use case | Connect Claude to M-Pesa | Orchestrate multiple agents |\n| East Africa relevance | mpesa-mcp, WapiMaji SMS | Multi-agent payment workflows |\n\nmpesa-mcp is MCP only. For multi-agent architectures (payment + notification + audit),\nA2A would coordinate the agents while each agent uses MCP to reach its tools.\n\n## MCP Dev Summit — April 2-3 2026, New York\n\nThe official MCP community event, now under the Agentic AI Foundation. CFP is open.\nIf you're building on MCP for African markets, this is the venue to present.\n\n[events.linuxfoundation.org/mcp-dev-summit-north-america](https://events.linuxfoundation.org/mcp-dev-summit-north-america/)\n\n## Community presence and contributions\n\n### Where to find this work\n\n| Platform | Link | What's there |\n|----------|------|--------------|\n| GitHub | [gabrielmahia](https://github.com/gabrielmahia) | 15 repos, 8+ packages |\n| PyPI | [mpesa-mcp](https://pypi.org/project/mpesa-mcp/) | MCP server for M-Pesa + AT |\n| MCP Registry | [io.github.gabrielmahia/mpesa-mcp](https://registry.modelcontextprotocol.io) | Official listing |\n| Portfolio | [gabrielmahia.github.io](https://gabrielmahia.github.io) | All 13 apps |\n| Engineering blog | [aikungfu.dev](https://aikungfu.dev) | Technical writing |\n\n### Open source contributions\n\n| Org | Issue/PR | What |\n|-----|----------|------|\n| [Gates Foundation / Mojaloop](https://github.com/mojaloop/documentation/issues/553) | #553 | MCP + payment rails integration guide |\n| [OCHA / HDX](https://github.com/OCHA-DAP/data-grid-recipes/issues/194) | #194 | Kenya food security data recipe |\n| [Andrew Ng / context-hub](https://github.com/andrewyng/context-hub/pull/52) | PR #52 | Africa's Talking + M-Pesa docs |\n| [mySociety / theyworkforyou](https://github.com/mysociety/theyworkforyou/issues/1998) | #1998 | Kenya parliamentary data tools |\n| [Code for Africa / openAFRICA](https://github.com/CodeForAfrica/openAFRICA/issues/55) | #55 | Kenya civic tools listing |\n| [Open Knowledge Foundation](https://github.com/okfn/dataportals.org/issues/407) | #407 | Kenya open data portals |\n| [Open Contracting](https://github.com/open-contracting/standard/issues/1745) | #1745 | Kenya procurement transparency |\n| [Ushahidi](https://github.com/ushahidi/platform/issues/5048) | #5048 | Kenya crisis mapping tools |\n| [Open Data Day](https://github.com/okfn/opendataday/issues/425) | #425 | Kenya civic tools showcase |\n| [Africa's Talking SDK](https://github.com/AfricasTalkingLtd/africastalking-python/issues/72) | #72 | mpesa-mcp community project |\n\n<!-- interconnect:v2 -->\n## Part of the East Africa coordination stack\n\n- **Install & run:** `pip install reli-cli && reli list` — the MCP servers on the [official MCP Registry](https://registry.modelcontextprotocol.io) under `io.github.gabrielmahia`\n- **Evaluate any model on Swahili agent tasks:** [kipimo](https://github.com/gabrielmahia/kipimo) · [dataset](https://huggingface.co/datasets/gmahia/kipimo) · [leaderboard](https://huggingface.co/spaces/gmahia/kipimo-leaderboard)\n- **Coordinate across servers:** [africa-coord-bus](https://pypi.org/project/africa-coord-bus/) — offline-first event bus with a built-in Kenya routing table\n- **Datasets:** [huggingface.co/gmahia](https://huggingface.co/gmahia) · **Docs hub:** [nairobi-stack](https://github.com/gabrielmahia/nairobi-stack)\n\nModel-agnostic by design: closed APIs, open-weight models, and small distilled models are all first-class citizens.\n<!-- /interconnect:v2 -->\n\n## Start here (engineers and AI systems)\n\nRead [`docs/SYSTEM_ENGINEERING.md`](docs/SYSTEM_ENGINEERING.md) first — portfolio\nstate, architecture, engineering standards, known failure classes, honest\nadoption numbers, live human threads, and the rules for collaborating agents.\nVerified against live GitHub and PyPI rather than written from memory.\n"}