Skip to main content

🛠️ CivicAgentKit — East African Civic AI SDK

civic-agent-kit Glama score smithery badge

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, embedded sample drought data (sources and as-of dates are not recorded), M-Pesa payments, and both MCP and A2A protocol integrations.

PyPI License: MIT MCP A2A

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,      # drought phases (sample data; provenance not recorded)

    # Agents
    BudgetAgent,           # County budget analysis (CrewAI)
    RightsAgent,           # Constitutional rights Q&A (EN/SW)
    DroughtAgent,          # DEMO: synthetic drought values + 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

This package has two distinct data paths:

  • File-backed loaders in src/civic_agent_kit/data.py. The county-budget loader points to the Kenya Civic Datasets Kaggle DOI 10.34740/kaggle/dsv/15473045; the broader dataset is also published on Hugging Face (DOI 10.57967/hf/8223).
  • Embedded MCP demo tables in src/civic_agent_kit/server.py. Their original row-level sources and as-of dates were not recorded, so their drought, budget, parliament and SACCO values must be treated as synthetic/sample data, not official or current figures.

Dataset surfaces:

See Data provenance and truthfulness for the exact boundary between sourced files, unprovenanced embedded demo values, and constitutional-rights text.

Package Description PyPI
mpesa-mcp M-Pesa + Africa's Talking MCP server PyPI
civic-agent-kit This package PyPI

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
)

Part of the East Africa coordination stack

Model-agnostic by design: closed APIs, open-weight models, and small distilled models are all first-class citizens.

Metadata

Release files for civic-agent-kit 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for civic-agent-kit 0.2.4
File Size Uploaded Provenance
civic_agent_kit-0.2.4.tar.gz 16.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for civic-agent-kit 0.2.4
File Interpreter ABI Platform
civic_agent_kit-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 30.8 kB

Release files / civic_agent_kit-0.2.4.tar.gz

Download URL civic_agent_kit-0.2.4.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ffe7efa08eeee86c4aa47b5a2a143f2674f760f6c10efd771268e73ae1617e80
BLAKE2b-256 checksum
How to use checksums
facbfeb5cdf2dada577a0ca76bc2a22a518ac2cf234e30ea7f3e84d656b4a683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / civic_agent_kit-0.2.4-py3-none-any.whl

Download URL civic_agent_kit-0.2.4-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e8b3d76ae57d92951535ae7c3125a599bfc07006b94b52d6da6d17dab626390
BLAKE2b-256 checksum
How to use checksums
717d2e1fc942da07584e239c3fc2288ad8a5c162e0ec352a0bf3efc035eb2422
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for civic-agent-kit 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for civic_agent_kit-0.2.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page