← Back to search

io.github.gabrielmahia/mpesa-mcp

gabrielmahia Scanned 8d ago

M-Pesa + Africa's Talking MCP server — payments, SMS, airtime for AI agents in East Africa.

C
69.3 / 100

Versions

0.1.1latest
first seen Jun 5, 2026
0.1.2
first seen May 19, 2026
PermissionsTool SafetyAuthAnnotationsCode QualityStabilitySpecVuln HistoryAuthorTransparencyCommunity

Tools 23

mpesa_stk_push
annotations: none low

Trigger 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.

phone string amount string account_ref string description string
mpesa_stk_query
annotations: none low

Check STK Push status. Poll 10-30s after mpesa_stk_push. ResultCode 0 = success, 1032 = cancelled, 1037 = timed out.

checkout_request_id string
mpesa_b2c
annotations: none low

Business 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.

phone string amount string remarks string occasion string command_id string
mpesa_business_paybill
annotations: none low

Pay 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.

amount string remarks string receiver_paybill string account_reference string
mpesa_business_buygoods
annotations: none low

Pay from business shortcode to a till/buy-goods number. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL.

amount string remarks string till_number string
mpesa_business_pochi
annotations: none low

Pay 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.

phone string amount string remarks string
mpesa_transaction_status
annotations: none low

Query status of any M-Pesa transaction by receipt number. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL. Result delivered async to MPESA_RESULT_URL.

transaction_id string
mpesa_account_balance
annotations: none low

Query 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.

remarks string identifier_type string
mpesa_query_org_info
annotations: none low

Validate 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.

shortcode string
mpesa_pull_transactions
annotations: none low

Pull 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.

offset string end_date string start_date string
mpesa_reversal
annotations: none low

Reverse 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.

amount string remarks string transaction_id string
mpesa_dynamic_qr
annotations: none low

Generate 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.

amount string ref_no string qr_size string trx_code string merchant_name string
mpesa_tax_remittance
annotations: none low

Remit 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.

amount string remarks string account_reference string
mpesa_b2b_express_checkout
annotations: none low

Initiate 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.

amount string remarks string receiver_till string account_reference string
mpesa_ratiba_create
annotations: none low

Create 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.

phone string amount string end_date string frequency string start_date string account_ref string description string standing_order_name string
mpesa_bill_manager_optin
annotations: none low

Enrol 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.

email string logo_url string callback_url string
mpesa_bill_manager_invoice
annotations: none low

Create 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.

phone string amount string due_date string account_ref string billing_ref string external_ref string invoice_name string
mpesa_bill_manager_cancel
annotations: none low

Cancel 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.

external_reference string
mpesa_sim_swap_query
annotations: none low

Check 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.

phone string
mpesa_imsi_query
annotations: none low

Verify 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.

phone string
sms_send
annotations: none low

Send 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.

message string sender_id string recipients string
airtime_send
annotations: none low

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).

phone string amount string currency_code string
get_model_hint
annotations: none low

Returns the recommended AI model for using mpesa-mcp tools. Call this first when selecting a model to pair with mpesa-mcp.

Permissions 3

network medium
Server uses network capabilities via: requests
filesystem low
Server uses filesystem capabilities via: os
env_vars low
Server uses env_vars capabilities via: os.environ

Scan Findings 77

low
Tool 'mpesa_stk_push' has no annotations annotation_checker · 100%
low
Tool 'mpesa_stk_query' has no annotations annotation_checker · 100%
low
Tool 'mpesa_b2c' has no annotations annotation_checker · 100%
low
Tool 'mpesa_business_paybill' has no annotations annotation_checker · 100%
low
Tool 'mpesa_business_buygoods' has no annotations annotation_checker · 100%
low
Tool 'mpesa_business_pochi' has no annotations annotation_checker · 100%
low
Tool 'mpesa_transaction_status' has no annotations annotation_checker · 100%
low
Tool 'mpesa_account_balance' has no annotations annotation_checker · 100%
low
Tool 'mpesa_query_org_info' has no annotations annotation_checker · 100%
low
Tool 'mpesa_pull_transactions' has no annotations annotation_checker · 100%
low
Tool 'mpesa_reversal' has no annotations annotation_checker · 100%
low
Tool 'mpesa_dynamic_qr' has no annotations annotation_checker · 100%
low
Tool 'mpesa_tax_remittance' has no annotations annotation_checker · 100%
low
Tool 'mpesa_b2b_express_checkout' has no annotations annotation_checker · 100%
low
Tool 'mpesa_ratiba_create' has no annotations annotation_checker · 100%
low
Tool 'mpesa_bill_manager_optin' has no annotations annotation_checker · 100%
low
Tool 'mpesa_bill_manager_invoice' has no annotations annotation_checker · 100%
low
Tool 'mpesa_bill_manager_cancel' has no annotations annotation_checker · 100%
low
Tool 'mpesa_sim_swap_query' has no annotations annotation_checker · 100%
low
Tool 'mpesa_imsi_query' has no annotations annotation_checker · 100%
low
Tool 'sms_send' has no annotations annotation_checker · 100%
low
Tool 'airtime_send' has no annotations annotation_checker · 100%
low
Tool 'get_model_hint' has no annotations annotation_checker · 100%
info
Sandbox failed to start for behavioral verification behavioral_verifier · 100%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-5h2m-4q8j-pqpj) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-c2jp-c369-7pvx) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-m8x7-r2rg-vh5g) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-mxxr-jv3v-6pgc) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rcfx-77hg-w2wv) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rj5c-58rq-j5g5) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-rww4-4w9c-7733) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (GHSA-vv7q-7jx5-f767) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-1364) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-1365) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2474) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2475) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-2476) dependency_analyzer · 95%
medium
Vulnerable dependency: fastmcp@2.0.0 (PYSEC-2026-338) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (GHSA-9hjg-9r4m-mvj7) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (GHSA-9wx4-h78v-vm56) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (GHSA-gc5v-m9x4-r6x2) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (GHSA-j8r2-6x86-q33q) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (PYSEC-2023-74) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (PYSEC-2026-1872) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (PYSEC-2026-1873) dependency_analyzer · 95%
medium
Vulnerable dependency: requests@2.28.0 (PYSEC-2026-2275) dependency_analyzer · 95%
info
pyproject.toml metadata manifest_parser · 100%
info
Tool: mpesa_stk_push manifest_parser · 90%
info
Tool: mpesa_stk_query manifest_parser · 90%
info
Tool: mpesa_b2c manifest_parser · 90%
info
Tool: mpesa_business_paybill manifest_parser · 90%
info
Tool: mpesa_business_buygoods manifest_parser · 90%
info
Tool: mpesa_business_pochi manifest_parser · 90%
info
Tool: mpesa_transaction_status manifest_parser · 90%
info
Tool: mpesa_account_balance manifest_parser · 90%
info
Tool: mpesa_query_org_info manifest_parser · 90%
info
Tool: mpesa_pull_transactions manifest_parser · 90%
info
Tool: mpesa_reversal manifest_parser · 90%
info
Tool: mpesa_dynamic_qr manifest_parser · 90%
info
Tool: mpesa_tax_remittance manifest_parser · 90%
info
Tool: mpesa_b2b_express_checkout manifest_parser · 90%
info
Tool: mpesa_ratiba_create manifest_parser · 90%
info
Tool: mpesa_bill_manager_optin manifest_parser · 90%
info
Tool: mpesa_bill_manager_invoice manifest_parser · 90%
info
Tool: mpesa_bill_manager_cancel manifest_parser · 90%
info
Tool: mpesa_sim_swap_query manifest_parser · 90%
info
Tool: mpesa_imsi_query manifest_parser · 90%
info
Tool: sms_send manifest_parser · 90%
info
Tool: airtime_send manifest_parser · 90%
info
Tool: get_model_hint manifest_parser · 90%
info
Required env vars (13) manifest_parser · 80%
info
Sandbox failed to start for output poisoning scan output_poisoning · 100%
medium
Permission: network access detected permission_analyzer · 90%
low
Permission: filesystem access detected permission_analyzer · 70%
low
Permission: env_vars access detected permission_analyzer · 90%
info
No dependency files found for SBOM generation sbom_generator · 100%
medium
No build provenance detected (SLSA L0) slsa_assessor · 90%