Reference
Every skill. Every tool.
22 Agent Skills that teach your agent Daraja's rules, and 24 MCP tools it can call, each with the guardrails that apply.
Agent Skills
Skills overview →Recipes5 · Whole flows, end to end
- daraja-checkoutOnline checkoutEnd-to-end recipe for adding M-Pesa checkout to an existing web or mobile app with STK Push.
- daraja-paybill-collectionsPaybill collections and reconciliationEnd-to-end recipe for collecting payments that customers start themselves on a Paybill or Till (C2B), and matching them to accounts.
- daraja-payoutsPayroll and payoutsEnd-to-end recipe for paying people from a business with M-Pesa B2C, such as payroll, commissions, supplier-to-wallet payments, winnings and refunds.
- daraja-recurring-billingRecurring billingEnd-to-end recipe for subscriptions and recurring charges with M-Pesa Ratiba standing orders, with Bill Manager invoices or STK reminders as fallbacks.
- daraja-agent-storefrontAn agent that sellsRecipe for an AI agent that sells and takes M-Pesa payments for a store, either inside a developer-built store with its own backend or as an agent-only seller in a chat.
One per Daraja API14 · The rules for each endpoint
- daraja-authDaraja AuthenticationGenerates, caches and refreshes Safaricom Daraja OAuth 2.0 access tokens from the Consumer Key and Secret (client-credentials grant with HTTP Basic auth), including single-flight refresh, 401 retry and multi-instance caching.
- daraja-stk-pushM-Pesa Express (STK Push)Implements Safaricom M-Pesa Express (Lipa na M-Pesa Online / STK Push) and STK Push Query.
- daraja-c2bC2B: Customer to BusinessImplements Safaricom Daraja C2B (Customer-to-Business) for Paybill and Till numbers.
- daraja-b2cB2C: Business to CustomerImplements Safaricom Daraja B2C payouts from a business shortcode to customers' M-Pesa wallets (BusinessPayment, SalaryPayment, PromotionPayment) and to Pochi la Biashara (B2Pochi).
- daraja-b2bB2B: Business to BusinessImplements Safaricom Daraja B2B payments between shortcodes: BusinessPayBill (to a Paybill and account), BusinessBuyGoods (to a Till), BusinessPayToBulk (top up a B2C utility account) and B2B Express Checkout (a USSD push asking a merchant's till operator to pay your Paybill).
- daraja-tax-remittanceTax Remittance to KRARemits taxes to the Kenya Revenue Authority (KRA) from a business shortcode through Safaricom Daraja's Tax Remittance API (CommandID PayTaxToKRA, PartyB 572572, AccountReference set to the KRA Payment Registration Number).
- daraja-account-opsTransaction Status, Reversal and Account BalanceUses Safaricom Daraja's Transaction Status, Transaction Reversal and Account Balance APIs, whose results arrive asynchronously on a ResultURL, and builds reconciliation jobs on top of them.
- daraja-dynamic-qrDynamic QRGenerates M-Pesa Dynamic QR codes with Safaricom Daraja for Buy Goods, Paybill, agent withdrawal, send money or send-to-business, with a preset amount and reference, and renders the returned base64 PNG.
- daraja-ratibaM-Pesa Ratiba (standing orders)Creates M-Pesa Ratiba standing orders (recurring customer payments to a Paybill or Till) through Safaricom Daraja, including frequency codes, date rules, the PIN-consent prompt, and the callback that returns the TransactionID.
- daraja-bill-managerM-Pesa Bill ManagerIntegrates M-Pesa Bill Manager through Safaricom Daraja.
- daraja-callbacksDaraja callback receiversBuilds resilient Safaricom Daraja callback and webhook receivers: STK CallBackURL; C2B Validation and Confirmation; ResultURL and QueueTimeOutURL for B2C, B2B, tax, status, reversal and balance; Ratiba, Bill Manager and B2B Express callbacks.
- daraja-sandbox-setupDaraja sandbox setup and go-liveSets up a Safaricom Daraja sandbox from scratch: creating the developer account and app with the right products, finding test credentials (shortcodes, passkey, initiator, certificate), writing the .env file, exposing callbacks through a tunnel, smoke testing each API, and running the production go-live checklist.
- daraja-credentials-securityDaraja credentials and securityManages Safaricom Daraja secrets safely (Consumer Key and Secret, M-Pesa Express passkey, initiator password, SecurityCredential) and generates the SecurityCredential by RSA-encrypting the initiator password with Safaricom's sandbox or production certificate.
- daraja-troubleshootingDaraja troubleshootingDiagnoses Safaricom Daraja and M-Pesa API failures.
Design and learning3 · Start here, plan, or learn
- mpesa-darajaM-Pesa DarajaEntry point for Safaricom M-Pesa Daraja API work.
- daraja-payment-designDesigning an M-Pesa payment systemDesigns the system around M-Pesa Daraja calls so money is never lost or double-counted.
- daraja-teach-meTeach me M-Pesa DarajaAn interactive tutor that teaches M-Pesa Daraja step by step in the sandbox.
MCP tools
Full tool reference →All prefixed mpesa_. Every result is SUCCESS, FAILED or UNKNOWN.
Read-only
12Safe to call any time. Shown even with DARAJA_READ_ONLY=true.
Moves money
8Idempotent per key. Locked in production until you allow live money movement.
Writes, no money
4Changes settings or sends documents. Hidden in read-only mode.