mpesa-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AT_API_KEY | Yes | Africa's Talking API key | |
| AT_USERNAME | Yes | Africa's Talking username (use 'sandbox' for testing) | |
| MPESA_PASSKEY | Yes | M-Pesa passkey | |
| MPESA_SANDBOX | Yes | Set to 'true' for sandbox mode, 'false' for production | true |
| MPESA_SHORTCODE | Yes | M-Pesa shortcode (e.g., 174379 for sandbox test shortcode) | |
| MPESA_CALLBACK_URL | Yes | M-Pesa callback URL for transaction notifications | |
| MPESA_CONSUMER_KEY | Yes | M-Pesa (Safaricom Daraja) consumer key | |
| MPESA_CONSUMER_SECRET | Yes | M-Pesa (Safaricom Daraja) consumer secret |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mpesa_stk_pushA | Trigger an M-Pesa STK Push — sends a payment prompt to the customer's phone. The customer enters their M-Pesa PIN to complete payment. Returns a CheckoutRequestID to track the transaction with mpesa_stk_query. Async: use mpesa_stk_query after 10-30 seconds to check completion. |
| mpesa_stk_queryA | Check the status of an STK Push request. Poll this 10-30 seconds after calling mpesa_stk_push. ResultCode 0 = success, 1032 = cancelled by user, 1037 = timed out. |
| mpesa_transaction_statusA | Query the status of any M-Pesa transaction by receipt number. Requires MPESA_INITIATOR_NAME and MPESA_SECURITY_CREDENTIAL env vars. |
| sms_sendA | Send SMS to one or many recipients via Africa's Talking. Supports up to 1,000 recipients per call. Works across Kenya, Nigeria, Ghana, Tanzania, Uganda, and 15+ African markets. Returns per-recipient status and cost. |
| airtime_sendA | Send airtime top-up to any MTN/Safaricom/Airtel/Vodafone subscriber. Common use: NGO field incentives, survey rewards, agent payouts. No real airtime sent in sandbox mode. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gabrielmahia/mpesa-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server