M-Pesa Daraja
Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent.
What this server provides
Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent.
Packages
uvxTransport stdio- DARAJA_CONSUMER_KEYRequired
Daraja app Consumer Key
- DARAJA_CONSUMER_SECRETRequired
Daraja app Consumer Secret
- DARAJA_ENVOptional
sandbox (default) or production
- DARAJA_SHORTCODEOptional
Paybill / store number (174379 in sandbox)
- DARAJA_PASSKEYOptional
M-Pesa Express passkey (STK Push)
- DARAJA_INITIATOR_NAMEOptional
API operator username (B2C, B2B, status, balance, reversal)
- DARAJA_SECURITY_CREDENTIALOptional
Encrypted initiator password
- DARAJA_CALLBACK_BASE_URLOptional
Public HTTPS base for callback URLs
- DARAJA_CALLBACK_LISTENOptional
host:port for the built-in callback receiver
- DARAJA_CALLBACK_TOKENOptional
16+ random characters; secret path for callbacks
- DARAJA_TOOLSETSOptional
Comma list: stk,c2b,payouts,ops,qr,ratiba,billmanager
- DARAJA_READ_ONLYOptional
true hides every tool that moves money or writes
- DARAJA_APPROVAL_THRESHOLDOptional
Payouts above this many shillings need approval in the chat
- DARAJA_ALLOWED_RECIPIENTSOptional
Comma list of phones/shortcodes that payouts may go to
- DARAJA_ALLOW_LIVE_MONEY_MOVEMENTOptional
true to allow production charges and payouts
- DARAJA_INITIATOR_PASSWORDOptional
Initiator password, encrypted into SecurityCredential at startup (alternative to DARAJA_SECURITY_CREDENTIAL)
- DARAJA_CERT_PATHOptional
Path to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORD
- DARAJA_STATE_DBOptional
Path of the SQLite file that stores request state and callbacks
- DARAJA_OUTPUT_DIROptional
Directory where generated QR PNGs are saved
- DARAJA_CONFIG_DIROptional
Directory holding the saved config (default: user config dir)
- DARAJA_DOTENVOptional
Path of a .env file to load instead of the project one
- DARAJA_MCP_TOKENOptional
Bearer token for HTTP mode (32+ random characters)
- DARAJA_MCP_HOSTOptional
HTTP mode bind address (default 127.0.0.1)
- DARAJA_MCP_PORTOptional
HTTP mode port (default 8000)
- DARAJA_FORWARD_URLOptional
Your app's URL: every callback is POSTed on to it, HMAC-signed
- DARAJA_FORWARD_SECRETOptional
HMAC secret for forwarded callbacks (16+ characters)