airtime_send
Send airtime top-up to MTN/Safaricom/Airtel/Vodafone subscribers. Use for NGO field incentives, survey rewards, agent payouts. No real airtime sent in sandbox mode (AT_USERNAME=sandbox).
Trigger M-Pesa payments and payouts, reconcile transactions, and send SMS or airtime across African networks.
LABSCO SUMMARY
It goes past the usual STK-push wrapper — reversal, KRA remittance, Bill Manager invoicing and SIM-swap screening are all here, which is what makes it usable for real settlement rather than demos. Several tools return their result to a callback URL rather than inline, so you need a reachable endpoint before those paths work.
An MCP server for East African fintech APIs — M-Pesa through Safaricom's Daraja and messaging through Africa's Talking. It covers collection, disbursement, reconciliation and fraud signals, so an agent can take a payment and confirm it landed without custom integration work.
Daraja credentials — MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, MPESA_SHORTCODE, MPESA_PASSKEY and MPESA_CALLBACK_URL — with MPESA_SANDBOX set to false for production. The business-to-business, reversal, balance and status tools additionally need MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL, and deliver their result asynchronously to MPESA_RESULT_URL. SMS and airtime need AT_USERNAME and AT_API_KEY. Install with pip install mpesa-mcp or run it with uvx mpesa-mcp over stdio.
One command plus a key — pip install mpesa-mcp, then supply credentials
USE CASES
Send the PIN prompt to their phone, then poll for the result a few seconds later.
Check the shortcode balance, disburse to each phone, and top up airtime where that is the agreed incentive.
Check the number's SIM-swap history and registration age before releasing a high-value transfer.
Pull the C2B transactions for the window and look up anything that does not match by receipt number.
Reverse the transaction and notify the customer by SMS.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
airtime_sendSend airtime top-up to MTN/Safaricom/Airtel/Vodafone subscribers. Use for NGO field incentives, survey rewards, agent payouts. No real airtime sent in sandbox mode (AT_USERNAME=sandbox).
get_model_hintReturns the recommended AI model for using mpesa-mcp tools. Call this first when selecting a model to pair with mpesa-mcp.
mpesa_account_balanceQuery current balance of the business M-Pesa account (shortcode/till). Result delivered async to MPESA_RESULT_URL. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_b2b_express_checkoutInitiate USSD Push to till — enables merchant-to-merchant payments. Recipient merchant receives a USSD prompt to confirm payment from their till. Use for wholesale supplier payments between Lipa Na M-PESA merchants. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_b2cBusiness To Customer disbursement — send money from shortcode to phone. Use for payroll, NGO field incentives, agent float, survey rewards. Result delivered async to MPESA_RESULT_URL. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL env vars.
mpesa_bill_manager_cancelCancel an outstanding Bill Manager invoice. Customer will no longer be able to pay the cancelled invoice. Use when an order is cancelled or a duplicate invoice was created.
mpesa_bill_manager_invoiceCreate a Bill Manager invoice — customer receives SMS with payment link. They can pay directly via M-PESA by clicking the link or using the paybill. Returns invoice ID. Use mpesa_bill_manager_cancel to void outstanding invoices.
mpesa_bill_manager_optinEnrol your business in M-PESA Bill Manager. Must be called once before creating invoices. After opt-in, customers can pay your invoices directly via M-PESA.
mpesa_business_buygoodsPay from business shortcode to a till/buy-goods number. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_business_paybillPay directly from business shortcode to another paybill number. Use for supplier payments, utility bills, inter-business transfers. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_business_pochiPay from business shortcode to a Pochi la Biashara micro-SME wallet. Used for micro-enterprise supplier payments and informal sector settlements. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_dynamic_qrGenerate a Dynamic M-PESA QR code for a specific payment amount. Customer scans QR with their M-PESA app — amount pre-fills automatically. Returns base64-encoded QR image. Use for receipts, invoices, POS displays.
mpesa_imsi_queryVerify a Safaricom number — returns registration date, SIM age, last swap, and hashed IMSI. Enhanced KYC/AML signal for financial services compliance. Older SIMs with no recent swaps have lower fraud risk. Returns data suitable for risk scoring without exposing raw IMSI.
mpesa_pull_transactionsPull all C2B transactions for reconciliation within a date range. Returns customer payments to your shortcode for audit and reconciliation. Max range: 48 hours per call. Max 10,000 records per call.
mpesa_query_org_infoValidate a shortcode — returns the registered name and tariff type. Use before sending B2B payments to confirm the destination shortcode is correct. Prevents accidental payments to wrong paybill numbers.
mpesa_ratiba_createCreate an M-PESA Ratiba standing order — automated recurring payments. Customer authorizes once; payments happen automatically on schedule. Perfect for subscription billing, rent collection, loan repayments, SACCO contributions. Returns a standing order ID to manage/cancel later.
mpesa_reversalReverse an erroneous M-Pesa transaction. Use when a payment was sent to the wrong number or wrong amount. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL. Result delivered async to MPESA_RESULT_URL.
mpesa_sim_swap_queryCheck if a phone number's SIM card was recently swapped. Critical fraud prevention signal — SIM swaps often precede account takeovers. Use before high-value B2C disbursements to verify recipient identity is stable. Returns swap status and last swap date.
mpesa_stk_pushTrigger M-Pesa STK Push — sends payment prompt to customer's phone. Customer enters M-PESA PIN to complete payment. Returns CheckoutRequestID; poll mpesa_stk_query after 10-30 seconds.
mpesa_stk_queryCheck STK Push status. Poll 10-30s after mpesa_stk_push. ResultCode 0 = success, 1032 = cancelled, 1037 = timed out.
mpesa_tax_remittanceRemit tax directly from M-PESA business account to Kenya Revenue Authority. Provide the KRA Payment Registration Number (PRN) as account_reference. KRA shortcode: 572572. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.
mpesa_transaction_statusQuery status of any M-Pesa transaction by receipt number. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL. Result delivered async to MPESA_RESULT_URL.
sms_sendSend SMS to 1-1000 recipients via Africa's Talking. Works across Kenya, Nigeria, Ghana, Tanzania, Uganda, Rwanda and 15+ more. Returns per-recipient status and cost breakdown.
BEFORE YOU INSTALL
23 tools when we connected. The documentation names only five; the undocumented eighteen include the money-moving tools, such as mpesa_b2c, mpesa_reversal and mpesa_business_paybill, plus SIM-swap and IMSI queries.
Both documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 23 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
pip install mpesa-mcp{
"mcpServers": {
"mpesa": {
"command": "uvx",
"args": [
"mpesa-mcp"
],
"env": {
"MPESA_CONSUMER_KEY": "<YOUR_MPESA_CONSUMER_KEY>",
"MPESA_CONSUMER_SECRET": "<YOUR_MPESA_CONSUMER_SECRET>",
"MPESA_SHORTCODE": "174379",
"MPESA_PASSKEY": "<YOUR_MPESA_PASSKEY>",
"MPESA_CALLBACK_URL": "<YOUR_SERVER_URL>/mpesa/callback",
"MPESA_SANDBOX": "true",
"AT_USERNAME": "sandbox",
"AT_API_KEY": "<YOUR_AT_API_KEY>"
}
}
}
}MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL are the initiator credentials the B2C payout tools need, separate from the STK Push credentials. Add them to this env block too.
claude mcp add mpesa -- uvx mpesa-mcpThis command sets no variables. As the project says, set them in your shell before running claude: MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, MPESA_SHORTCODE, MPESA_PASSKEY, MPESA_CALLBACK_URL, MPESA_SANDBOX, AT_USERNAME and AT_API_KEY — plus MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL for the B2C payout tools.