Python SDK for building civic AI tools across Africa — M-Pesa, parliament, budgets, drought, MCP and A2A
Project description
🛠️ CivicAgentKit — East African Civic AI SDK
Compatible with claude-sonnet-5 (released 2026-06-30) — Anthropic's most agentic
Sonnet yet. Runs multi-step tool chains end-to-end without stopping short.
Install: pip install civic-agent-kit · Use with any MCP client.
The unified Python toolkit for building civic AI tools in East Africa. One install gives you access to Kenya's parliament records, county budgets, NDMA drought data, M-Pesa payments, and both MCP and A2A protocol integrations.
Install
pip install civic-agent-kit
What's included
from civic_agent_kit import (
# Data loaders — Kenya's public civic datasets
KenyaBudgetData, # Controller of Budget — 47 counties
KenyaParliamentData, # MPs, bills, CDF — 13th Parliament
KenyaSACCOData, # SASRA SACCO registry
KenyaDroughtData, # NDMA drought phases
# Agents
BudgetAgent, # County budget analysis (CrewAI)
RightsAgent, # Constitutional rights Q&A (EN/SW)
DroughtAgent, # Drought + SMS alert agent
# Protocols
KenyaMCPServer, # MCP server — wraps all Kenya data as MCP tools
KenyaA2AServer, # A2A server — Kenya civic skills for agent-to-agent
# Utils
KenyaCounties, # All 47 county codes + names
KiswahiliTranslator, # Simple civic term translations EN↔SW
)
Quick examples
Load county budget data:
from civic_agent_kit import KenyaBudgetData
budgets = KenyaBudgetData.load()
low_absorption = budgets[budgets['absorption_rate'] < 0.5]
print(low_absorption[['county', 'allocation_kes_m', 'absorption_rate']])
Serve Kenya civic data as an A2A agent:
from civic_agent_kit import KenyaA2AServer
server = KenyaA2AServer(host="http://localhost:8000")
server.run() # exposes /.well-known/agent.json + JSON-RPC endpoint
Serve as an MCP server:
from civic_agent_kit import KenyaMCPServer
# Run alongside mpesa-mcp for full East African AI stack
server = KenyaMCPServer()
server.run()
Ask a rights question in Kiswahili:
from civic_agent_kit import RightsAgent
agent = RightsAgent(language="sw")
answer = agent.ask("Haki yangu ya ardhi ni nini?")
print(answer)
# → "Kifungu 40: Kila mtu ana haki ya kupata na kumiliki mali..."
The East African AI Stack
┌─────────────────────────────────────┐
│ Your AI Agent │
└─────────────┬───────────────────────┘
│
┌──────────────────┴──────────────────────┐
│ │
┌──────▼──────┐ ┌───────▼──────┐
│ MCP Layer │ │ A2A Layer │
│ (tools) │ │ (agents) │
└──────┬───────┘ └───────┬──────┘
│ │
┌─────────┴──────────┐ ┌──────────┴─────────┐
│ │ │ │
┌────▼────┐ ┌──────▼─────┐ ┌───────▼────┐ ┌──────▼──────┐
│mpesa-mcp│ │KenyaMCP │ │kenya-a2a │ │CivicAgent │
│payments │ │civic data │ │parliament │ │Kit agents │
│SMS │ │budgets │ │budgets │ │budget/rights│
│airtime │ │parliament │ │drought │ │drought │
└─────────┘ └────────────┘ │rights EN/SW│ └─────────────┘
└────────────┘
Data
All data from the Kenya Civic Datasets (CC BY-SA 4.0):
- Kaggle: gmahia/kenya-civic-data — DOI:
10.34740/kaggle/dsv/15473045 - HuggingFace: gmahia/kenya-civic-data — DOI:
10.57967/hf/8223
Related packages
| Package | Description | PyPI |
|---|---|---|
mpesa-mcp |
M-Pesa + Africa's Talking MCP server | |
civic-agent-kit |
This package |
Full portfolio
13 deployed civic apps: gabrielmahia.github.io
IP & Collaboration
© 2026 Gabriel Mahia · contact@aikungfu.dev License: MIT
Protocol Coverage — Complete Stack
civic-agent-kit now supports all four major AI agent protocols for East Africa:
| Protocol | What it does | Implementation |
|---|---|---|
| MCP | Agent → Tool | mpesa-mcp, wapimaji-mcp |
| A2A | Agent → Agent | kenya-a2a |
| Google ADK | Agent orchestration | kenya-adk |
| AG-UI | Agent → Frontend | kenya-agui |
Each protocol layer above was implemented within weeks of its global release — because the coordination gaps these tools address don't wait for tooling maturity.
from civic_agent_kit import CivicAgentKit
# Full protocol stack
kit = CivicAgentKit(
mcp_servers=["mpesa-mcp", "wapimaji-mcp"], # MCP
a2a_registry="kenya-a2a", # A2A
agui_server="kenya-agui", # AG-UI
adk_config="kenya-adk", # Google ADK
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file civic_agent_kit-0.2.2.tar.gz.
File metadata
- Download URL: civic_agent_kit-0.2.2.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d62874d70bc31e3b3de192c3fee024bd4a4570cfc580757824c0358100ff58b
|
|
| MD5 |
b27f6734353164361a02ed47c25e9a5c
|
|
| BLAKE2b-256 |
d1a763eecfe966a26873d0a926adb8442d43aad2f2e25bd5b37113fc8ef02721
|
File details
Details for the file civic_agent_kit-0.2.2-py3-none-any.whl.
File metadata
- Download URL: civic_agent_kit-0.2.2-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d33db758cec046757670c22683c3bfa18979b821fe11bf919172ad1eeed7f42
|
|
| MD5 |
3b0561452bad56d1922e31045e605ded
|
|
| BLAKE2b-256 |
27acbee922fdacd62254ecd75eb8ceb9fc40f9b80ff9978b39a2b49898abbd38
|