CCM
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Claude Code Marketplaces

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Skill index
  • MCP index
  • Marketplace index
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by mertbuilds.com

Independent project, not affiliated with Anthropic
gabrielmahia avatar

Mpesa Mcp

gabrielmahia/mpesa-mcp
1authSTDIOregistry active
Summary

This connects Claude to M-Pesa's Daraja API and Africa's Talking, letting agents trigger STK Push payments, check transaction status, send SMS, and top up airtime across 20+ African networks. You get five tools: initiate payment prompts on customer phones, query payment status, look up M-Pesa receipts, send bulk SMS, and distribute airtime in local currencies. It's built for East African fintech workflows where an AI agent needs to dispatch field payments, alert farmers via SMS, or reconcile M-Pesa transactions without custom integration work. The developer updated it to match NSA MCP security guidance, validating Kenyan phone formats and hashing sensitive data in logs. Works in sandbox mode with test credentials from Safaricom and Africa's Talking.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →

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.

Tests PyPI License: MIT Glama Score smithery badge Glama NSA MCP Compliant

mpesa-mcp MCP server

Tested With

claude-sonnet-5  (recommended — call get_model_hint() for guidance)
claude-opus-4-8  (for highest-accuracy compliance reasoning)

Claude Sonnet 5 (released June 30, 2026) finishes multi-step M-PESA workflows without stopping short and self-corrects tool-call errors without prompting. Terminal-Bench score 80.4% vs Sonnet 4.6's 67.0% — the benchmark most analogous to payment agent work.

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

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

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)

mpesa-mcp is available as a hosted MCP server on Glama:

mpesa-mcp MCP server mpesa-mcp score

Security — NSA MCP Guidance Compliant

mpesa-mcp was updated in response to NSA CSI U/OO/6030316-26 (May 2026) — the NSA Artificial Intelligence Security Center's Cybersecurity Information Sheet on Model Context Protocol security.

The implementation below documents compliance against the NSA's MCP security framework, control by control.

NSA ControlImplementation
Parameter validationKE phone regex ^254[17]\d{8}$ + amount bounds [1–150,000 KES]
Audit loggingStructured log per tool call; phone numbers SHA-256 hashed
Token lifecycleOAuth token cached with expiry; auto-refreshed
Error containmentStructured error dicts; no raw exception propagation
HTTPS enforcementAll Daraja API calls HTTPS-only
No hardcoded secretsAll credentials via environment variables

See SECURITY.md for the full compliance table.

Reference: NSA CSI_MCP_SECURITY.pdf — May 2026, UNCLASSIFIED

Install

pip install mpesa-mcp

Or run directly with uvx:

uvx mpesa-mcp

Configuration

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

Sandbox credentials

New Daraja account, or setting this up on a new machine? Follow the sandbox setup guide: it records the verified procedure (create the app with only Lipa Na M-Pesa Sandbox ticked, use the published test shortcode and passkey, point MPESA_CALLBACK_URL at a public HTTPS address you can watch) and what a healthy result looks like. Consumer keys cannot be shared, so each developer creates their own free sandbox app.

M-Pesa sandbox: https://developer.safaricom.co.ke — create a free app to get test credentials.

  • Test shortcode: 174379
  • Test passkey: bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919

Africa's Talking sandbox: https://account.africastalking.com — use username=sandbox, any API key.

Usage with Claude Desktop

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"
      }
    }
  }
}

Usage with Claude Code

claude mcp add mpesa -- uvx mpesa-mcp

Set env vars in your shell before running claude.

Example prompts

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]"

Real-world scenarios

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.

Tool annotations

All tools declare MCP tool annotations so clients can gate calls appropriately:

ToolreadOnlydestructiveidempotent
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.

Server discovery

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

Testing and accuracy

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.

Ecosystem context — Mojaloop + MCP

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:

  • Mojaloop: the interoperability rails between financial providers
  • mpesa-mcp: the MCP interface layer that connects AI agents to those rails

See the Mojaloop documentation contribution for more on this pattern.

MCP vs A2A — two different protocols

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:

  • MCP: Your AI agent → mpesa-mcp → Daraja API / Africa's Talking
  • A2A: Orchestrator agent ↔ payment sub-agent ↔ notification sub-agent

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.


Development

git clone https://github.com/gabrielmahia/mpesa-mcp
cd mpesa-mcp
pip install -e ".[dev]"
pytest tests/ -v

Security

Do not commit API keys. Use environment variables or a secrets manager.
Report vulnerabilities to: contact@aikungfu.dev

Research Context

MCP ecosystem benchmark (CData, 2026): Most MCP servers achieve 60-75% accuracy on complex queries. mpesa-mcp includes explicit validation and bounds checking to exceed this baseline.

Swahili AI accuracy (arXiv:2509.04516, 2025): AI models produce 4× more errors in Swahili than English. mpesa-mcp's Swahili-native tool descriptions are designed to minimize this gap for Swahili-speaking users by eliminating the translation step in tool selection.

MCP security research (arXiv:2603.18063, arXiv:2603.21642, 2026): Prompt injection via tool descriptions is the primary MCP attack vector. mpesa-mcp mitigates this through static, versioned tool descriptions and strict input validation.

Related infrastructure:

  • wapimaji-mcp — Kenya water/drought MCP
  • civic-agent-kit — Kenya civic data MCP
  • swahili-health-mcp — Kenya DHIS2 health data MCP
  • kenya-legal-rag — Kenya legal corpus MCP
  • Full portfolio: gabrielmahia.github.io

License

MIT — © 2026 Gabriel Mahia

Stay updated

Get notified of new releases and East African API developments: Subscribe to updates →

Or watch this repo on GitHub for release notifications.

Sibling packages

PackageInstallDescription
wapimaji-mcppip install wapimaji-mcpKenya drought intelligence MCP server
civic-agent-kitpip install civic-agent-kitEast African civic AI SDK

Related packages

All MIT · All part of the East African civic AI stack

PackageInstallDescription
wapimaji-mcppip install wapimaji-mcpKenya drought intelligence MCP server
kenya-health-mcppip install kenya-health-mcpKenya health data MCP — NHIF, facilities, maternal, rights
civic-agent-kitpip install civic-agent-kitEast African civic AI SDK

Full portfolio: gabrielmahia.github.io

Part of the East Africa Coordination Stack

This MCP server is one of 32 tools in the Kenya coordination infrastructure. Connect it to africa-coord-bus — the coordination event bus that routes signals between domains automatically.

pip install africa-coord-bus

All 32 servers: pypi.org/user/gmahia Live demo: coord-cascade-demo

IP & Collaboration

MIT licensed. Feedback via GitHub Issues only — pull requests are not accepted. Demo data is labeled DEMO and is not suitable for operational decisions. Full policy: docs/architecture/IP_POLICY.md. Security reports: see SECURITY.md.

Part of the East Africa coordination stack

  • Install & run: pip install reli-cli && reli list — 33 MCP servers on the official MCP Registry under io.github.gabrielmahia
  • Evaluate any model on Swahili agent tasks: kipimo · dataset · leaderboard
  • Coordinate across servers: africa-coord-bus — offline-first event bus with a built-in Kenya routing table
  • Datasets: huggingface.co/gmahia · Docs hub: nairobi-stack

Model-agnostic by design: closed APIs, open-weight models, and small distilled models are all first-class citizens.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
Open Steps
Open Steps
Free an open-source skills that make AI coding agents easier to understand, verify, and control.
Download for free →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
Granola, the best AI meeting recorder
Granola, the best AI meeting recorder
Notes, actions and memory. Without a meeting bot. First month 100% off.
Download for free →

Configuration

MPESA_CONSUMER_KEY*secret

Safaricom Daraja consumer key

MPESA_CONSUMER_SECRET*secret

Safaricom Daraja consumer secret

MPESA_SHORTCODE*

M-Pesa shortcode (till or paybill number)

MPESA_PASSKEY*secret

M-Pesa Lipa Na M-Pesa online passkey

MPESA_ENV

Daraja environment: sandbox or production

AT_API_KEY*secret

Africa's Talking API key

AT_USERNAME*

Africa's Talking username (use 'sandbox' for testing)

Categories
Communication & Messaging
Registryactive
Packagempesa-mcp
TransportSTDIO
AuthRequired
UpdatedMar 22, 2026
View on GitHub

Related Communication & Messaging MCP Servers

View all →
henry-ships avatar
SparkForge — 20+ Utility APIs with x402 Micropayments

henry-ships/sparkforge

20+ pay-per-use APIs: image gen, crypto data, email verify, SSL check, web scraping, and more.
1
getcoherence avatar
Mcp

io.getcoherence/mcp

Coherence MCP — chat with your CRM's AI agent from Claude, Cursor, and Cline.
1
carhaix avatar
Oi

io.github.carhaix/oi

Access your Oi setup: teams, contexts, workflows, tools, and more.
1
carhaix avatar
ProxVanta

io.github.carhaix/proxvanta

Access your ProxVanta AI setup: teams, contexts, workflows, tools, and more.
1
good-sender avatar
GoodSender

io.github.good-sender/goodsender-mcp

Free consent-based emailing and interactive email template design tools
1
hookwarden avatar
Hookwarden — Webhook Integrity

io.github.hookwarden/mcp

Webhook signature-verification audit. Stripe, GitHub, Shopify, Twilio +17. Local. Deterministic.
1