Skip to main content
Glama

πŸ› οΈ CivicAgentKit β€” East African Civic AI SDK

civic-agent-kit Glama score

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

Related MCP server: mcp-colombia-secop

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.

Available Tools

6 tools
kenya_budget_summaryKenya County Budget SummaryA
Read-onlyIdempotent

Get county budget allocation, development vs recurrent split, and absorption rate. FY 2022/23 data from Kenya Controller of Budget. DEMO data β€” real data: opendata.go.ke and cob.go.ke.

Inputs: county (required), language. Returns: object

kenya_counties_listKenya Counties ListA
Read-onlyIdempotent

List all 47 Kenya counties. Returns names suitable for use with other tools.

Inputs: no named parameters. Returns: object

kenya_county_droughtKenya County Drought StatusA
Read-onlyIdempotent

Get current NDMA drought phase for any of Kenya's 47 counties. Phase 1=Minimal, 2=Stressed, 3=Crisis, 4=Emergency, 5=Famine. Data source: Kenya National Drought Management Authority (NDMA). DEMO data β€” for real-time data see ndma.go.ke.

Inputs: county (required), language. Returns: object

kenya_parliament_billsKenya Parliament BillsA
Read-onlyIdempotent

Query Kenya Parliament bills and their legislative status. Returns bills with title, status, type, date and summary. DEMO data β€” real data: parliament.go.ke.

Inputs: status, keyword. Returns: object

kenya_rights_queryKenya Constitutional Rights Q&AA
Read-onlyIdempotent

Query Kenya constitutional rights from Chapter 4 of the Constitution of Kenya 2010. Returns the specific constitutional article and its provisions. Works in English and Kiswahili.

Inputs: right (required), language. Returns: object

kenya_sacco_lookupKenya SACCO LookupA
Read-onlyIdempotent

Look up Kenya SACCOs from the SASRA registry. Returns name, type, membership, assets, county and focus sector. DEMO data β€” real registry: sasra.go.ke.

Inputs: name, county. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool addresses a distinct domain (budget, counties, drought, parliamentary bills, constitutional rights, SACCOs). There is no overlap in purpose, and agents can easily distinguish between them.

    Naming Consistency5/5

    All tools follow a consistent 'kenya_<domain>_<operation>' pattern, using snake_case. The naming is predictable and easy to understand.

    Tool Count5/5

    With 6 tools, the server is well-scoped for its purpose of providing Kenya-specific data. Each tool offers meaningful functionality without unnecessary bloat.

    Completeness4/5

    The tool set covers multiple important Kenya-related domains, but there are minor gaps such as missing education, health, or demographic data. However, the current selection is sufficient for many use cases.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Provides access to Kenya 47-county local government data, including demographics, budgets, services, and contact information for all counties.
      6
      72 PyPI
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables access to UK government open data via the data.gov.uk CKAN API, allowing querying of datasets through natural language or direct MCP tools.
      88 npm
      MIT