GM

gabrielmahia/mpesa-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 3 forks 质量 81 趋势 34MIT

MCP server for M-PESA Daraja API — STK push, B2C, balance, status. 7 tools.

概览

MCP server for East African fintech APIs — M-Pesa (Safaricom Daraja) and Africa's Talking Give your AI agent the ability to trigger M-Pesa payments, check transaction status, send SMS, and top up airtime across 20+ African telecom networks. This server does not recommend, certify or benchmark any model, and get_model_hint() is kept only for compatibility (it returns neutral guidance). Use a model that follows tool schemas reliably, rehearse in the sandbox first, and keep a person approving every money-moving or messaging call: in live mode those tools need confirm_send=true and are capped (MPESA_MAX_AMOUNT_KES, default KES 100,000; MPESA_MAX_SMS_RECIPIENTS, default 50). M-Pesa processes more transactions per day than PayPal does in Africa. Africa's Talking reaches users in 20+ countries on basic phones via SMS and USSD. Neither has an MCP server.

README

以下为原文 README 节选,完整内容请查看原文。

mpesa-mcp

MCP server for East African fintech APIs — M-Pesa (Safaricom Daraja) and Africa’s Talking

Give your AI agent the ability to trigger M-Pesa payments, check transaction status, send SMS, and top up airtime across 20+ African telecom networks.

Models

This server does not recommend, certify or benchmark any model, and get_model_hint() is kept only for compatibility (it returns neutral guidance). Use a model that follows tool schemas reliably, rehearse in the sandbox first, and keep a person approving every money-moving or messaging call: in live mode those tools need confirm_send=true and are capped (MPESA_MAX_AMOUNT_KES, default KES 100,000; MPESA_MAX_SMS_RECIPIENTS, default 50).

Why this exists

M-Pesa processes more transactions per day than PayPal does in Africa. Africa’s Talking reaches users in 20+ countries on basic phones via SMS and USSD. Neither has an MCP server.

This means every AI agent built today — Claude, GPT, Gemini, or any MCP-compatible runtime — cannot trigger an M-Pesa payment or send a Kiswahili SMS without custom integration work.

mpesa-mcp closes that gap in one pip install.

Tools

Tool Description
mpesa_stk_push Trigger STK Push payment prompt on customer’s M-Pesa phone
mpesa_stk_query Check status of an STK Push request
mpesa_transaction_status Query any M-Pesa transaction by receipt number
sms_send Send SMS to 1–1,000 recipients across African networks
airtime_send Send airtime top-up to any subscriber (KES, NGN, GHS, UGX, etc.)

Coverage

  • M-Pesa: Kenya (Safaricom Daraja v3) — STK Push, C2B, transaction status
  • SMS/Airtime: Kenya, Nigeria, Ghana, Tanzania, Uganda, Rwanda, South Africa, and 15+ more via Africa’s Talking

Glama (hosted MCP)

在 GitHub 查看完整 README

安装

uvx mpesa-mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mpesa": { "command": "uvx", "args": ["mpesa-mcp"], "env": { "MPESA_CONSUMER_KEY": "your_key", "MPESA_CONSUMER_SECRET": "your_secret", "MPESA_SHORTCODE": "174379", "MPESA_PASSKEY": "your_passkey", "MPESA_CALLBACK_URL": "https://yourdomain.com/mpesa/callback", "MPESA_SANDBOX": "true", "AT_USERNAME": "sandbox", "AT_API_KEY": "your_at_key" } } } }