Server data from the Official MCP Registry
M-Pesa + Africa's Talking MCP server — payments, SMS, airtime for AI agents in East Africa.
M-Pesa + Africa's Talking MCP server — payments, SMS, airtime for AI agents in East Africa.
Valid MCP server (3 strong, 4 medium validity signals). 9 known CVEs in dependencies (1 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry.
5 files analyzed · 10 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Unverified package source
We couldn't verify that the installable package matches the reviewed source code. Proceed with caution.
Set these up before or after installing:
Environment variable: MPESA_CONSUMER_KEY
Environment variable: MPESA_CONSUMER_SECRET
Environment variable: MPESA_SHORTCODE
Environment variable: MPESA_PASSKEY
Environment variable: MPESA_ENV
Environment variable: AT_API_KEY
Environment variable: AT_USERNAME
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-gabrielmahia-mpesa-mcp": {
"env": {
"MPESA_ENV": "your-mpesa-env-here",
"AT_API_KEY": "your-at-api-key-here",
"AT_USERNAME": "your-at-username-here",
"MPESA_PASSKEY": "your-mpesa-passkey-here",
"MPESA_SHORTCODE": "your-mpesa-shortcode-here",
"MPESA_CONSUMER_KEY": "your-mpesa-consumer-key-here",
"MPESA_CONSUMER_SECRET": "your-mpesa-consumer-secret-here"
},
"args": [
"mpesa-mcp"
],
"command": "uvx"
}
}
}From the project's GitHub README.
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.
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.
| 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.) |
pip install mpesa-mcp
Or run directly with uvx:
uvx mpesa-mcp
Set these environment variables before starting the server:
# M-Pesa (Safaricom Daraja)
MPESA_CONSUMER_KEY=your_consumer_key
MPESA_CONSUMER_SECRET=your_consumer_secret
MPESA_SHORTCODE=174379 # sandbox test shortcode
MPESA_PASSKEY=your_passkey
MPESA_CALLBACK_URL=https://yourdomain.com/mpesa/callback
MPESA_SANDBOX=true # set false for production
# Africa's Talking
AT_USERNAME=sandbox # your AT username (sandbox for testing)
AT_API_KEY=your_at_api_key
M-Pesa sandbox: https://developer.safaricom.co.ke — create a free app to get test credentials.
174379bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919Africa's Talking sandbox: https://account.africastalking.com — use username=sandbox, any API key.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"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"
}
}
}
}
claude mcp add mpesa -- uvx mpesa-mcp
Set env vars in your shell before running claude.
Once connected, you can ask your AI agent:
"Send KES 500 STK Push to +254712345678 for order #1234"
"Check if the payment QKL8ABC123 has been received"
"Send an SMS to these 50 farmers with today's maize price: [list]"
"Top up KES 50 airtime for our field agents: [list of numbers]"
Field agent payment dispatch
"Send KES 300 STK Push to each of these 12 field agents for today's data collection: [list]"
The agent triggers 12 sequential STK pushes, tracks each checkout_request_id, and
polls for confirmation — without any code from you.
Farmer alert + airtime
"SMS these 200 Garissa farmers that the river is rising. Then top up KES 20 airtime each so they can call in reports."
One prompt → 200 SMS messages and 200 airtime top-ups across Safaricom, Airtel, and Telkom.
Payment reconciliation
"Check whether receipt OKL8M3B2HF was a successful payment and how much it was for"
Useful for support agents using Claude to verify M-Pesa transactions in real time.
All tools declare MCP tool annotations so clients can gate calls appropriately:
| Tool | readOnly | destructive | idempotent |
|---|---|---|---|
mpesa_stk_push | ❌ | ✅ | ❌ |
mpesa_stk_query | ✅ | ❌ | ✅ |
mpesa_transaction_status | ✅ | ❌ | ✅ |
sms_send | ❌ | ✅ | ❌ |
airtime_send | ❌ | ✅ | ❌ |
Claude Desktop and other MCP clients will request confirmation before triggering payment, SMS, or airtime operations.
Capabilities are advertised via .well-known/mcp.json — the emerging MCP Server Cards standard. Registries and browsers can index this server's tools without connecting to it.
# Check capabilities
curl https://raw.githubusercontent.com/gabrielmahia/mpesa-mcp/main/.well-known/mcp.json
The MCP ecosystem benchmark (CData, 2026) found most MCP servers accurate 60–75% of the time on complex queries — particularly silent failures on write operations and partial parameter application.
mpesa-mcp is tested against all three Kenyan phone number formats, boundary amount values, and missing optional fields:
pytest tests/ -v # run full suite
pytest tests/test_phone_formats.py # format normalization
pytest tests/test_boundary_amounts.py # min/max amount edge cases
Write operations (STK push, SMS, airtime) have explicit validation before any API call is made.
Mojaloop (funded by the Gates Foundation) handles payment interoperability — connecting banks, mobile money wallets, and merchants across DFSPs in East Africa and beyond.
mpesa-mcp handles the AI agent tooling layer — enabling AI coding assistants to trigger and query M-Pesa payments programmatically.
These are complementary:
See the Mojaloop documentation contribution for more on this pattern.
mpesa-mcp implements MCP (Model Context Protocol) — how an AI agent talks to tools.
There is a complementary protocol, A2A (Agent-to-Agent), which handles how agents talk to each other. They solve different problems and work together:
For most integrations you only need MCP. A2A becomes relevant when you're building multi-agent systems where a payment workflow coordinates with other specialized agents.
git clone https://github.com/gabrielmahia/mpesa-mcp
cd mpesa-mcp
pip install -e ".[dev]"
pytest tests/ -v
Do not commit API keys. Use environment variables or a secrets manager.
Report vulnerabilities to: contact@aikungfu.dev
MIT — © 2026 Gabriel Mahia
Get notified of new releases and East African API developments: Subscribe to updates →
Or watch this repo on GitHub for release notifications.
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.