M-Pesa Daraja Agent Kit

•
3
•

Integrate Safaricom M-Pesa Daraja payment workflows and manage transactions using Agent Skills and MCP tools.

M-Pesa Daraja Agent Kit equips AI coding assistants and autonomous agents with the capabilities required to build, test, and operate Safaricom's M-Pesa Daraja API. By combining ready-to-use Agent Skills with a dedicated MCP server, it enables agents to generate robust payment integration code as well as execute operational payment tasks directly from chat. It supports end-to-end payment operations—including STK Push, B2C payouts, C2B simulations, transaction status lookups, and recurring billing—while enforcing strict safeguards like sandbox defaults, transaction idempotency, approval limits, and read-only modes to prevent duplicate charges or accidental live money transfers.

Características Principales

01Pre-packaged Agent Skills containing tested scripts for payload validation, credential encryption, and callback handling
02Comprehensive coverage of Daraja APIs including STK Push, B2C payouts, C2B, B2B, Ratiba standing orders, and Bill Manager
03Synchronous payment resolution via mpesa_stk_push_and_wait with integrated webhook callback receiving and polling fallback
04Production safeguards including idempotency tracking, approval thresholds, recipient allowlists, and default sandbox operation
05Configurable toolset groups to reduce context overhead by loading only specific tools needed for your workflow
063 GitHub stars

Casos de Uso

01Assisting developers in writing, debugging, and testing Daraja payment integration code and callback handlers in codebases
02Enabling AI agents to initiate and confirm customer checkouts, driver payouts, and invoice payments directly from chat
03Automating finance and support tasks such as balance checks, payment reconciliation, and transaction status lookups