Mpesa MCP Server

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.

Remote serverstreamable-http

What is the Mpesa MCP MCP server?

Connect Mpesa MCP to Claude, Cursor or any other MCP client and it stops being a tab you switch to. 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. The mpesa mcp mcp server is what makes that connection.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

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

Installation

Because this one is hosted, setup is mostly authentication — you point your client at the endpoint and approve access. Nothing runs on your machine, so there is no runtime to keep patched.

Credentials and setup notes

Configuration is passed through the environment: MPESA_CONSUMER_KEY, MPESA_CONSUMER_SECRET, MPESA_SHORTCODE, MPESA_PASSKEY, MPESA_CALLBACK_URL, MPESA_SANDBOX, AT_USERNAME, AT_API_KEY. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Where it fits

Among the payments and commerce options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Mpesa MCP's toolset — mpesa_stk_push, mpesa_stk_query, mpesa_transaction_status and 2 more — is a fair guide to whether it matches your workflow. It is maintained by gabrielmahia; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Worth knowing first

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
mpesa_stk_pushTrigger STK Push payment prompt on customer's M-Pesa phone
mpesa_stk_queryCheck status of an STK Push request
mpesa_transaction_statusQuery any M-Pesa transaction by receipt number
sms_sendSend SMS to 1–1,000 recipients across African networks
airtime_sendSend airtime top-up to any subscriber (KES, NGN, GHS, UGX, etc.)

How to install the Mpesa MCP MCP server

{
  "mcpServers": {
    "mpesa": {
      "command": "uvx",
      "args": ["mpesa-mcp"],
      "env": {
        "MPESA_CONSUMER_KEY": "your-value",
        "MPESA_CONSUMER_SECRET": "your-value",
        "MPESA_SHORTCODE": "your-value",
        "MPESA_PASSKEY": "your-value",
        "MPESA_CALLBACK_URL": "your-value",
        "MPESA_SANDBOX": "your-value",
        "AT_USERNAME": "your-value",
        "AT_API_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
MPESA_CONSUMER_KEYCredential the server authenticates with.Yes
MPESA_CONSUMER_SECRETCredential the server authenticates with.Yes
MPESA_SHORTCODEConfiguration value read at startup.Optional
MPESA_PASSKEYCredential the server authenticates with.Yes
MPESA_CALLBACK_URLEndpoint or connection string the server talks to.Yes
MPESA_SANDBOXConfiguration value read at startup.Optional
AT_USERNAMEConfiguration value read at startup.Optional
AT_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Mpesa MCP to mpesa stk push.
  • Use Mpesa MCP to mpesa stk query.
  • Use Mpesa MCP to mpesa transaction status.

Frequently asked questions

It connects Mpesa MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 5 tools (mpesa_stk_push, mpesa_stk_query, mpesa_transaction_status, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mpesa MCP directly.