Skip to main content
Glama
kenyaclaw

Africa Payments MCP

by kenyaclaw
README.md
# ๐ŸŒ Africa Payments MCP

> **The missing piece for African fintech.** One MCP server. Every major African payment provider. Natural language payments.

[![CI](https://github.com/kenyaclaw/africa-payments-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/kenyaclaw/africa-payments-mcp/actions/workflows/ci.yml)
[![Security](https://github.com/kenyaclaw/africa-payments-mcp/actions/workflows/security.yml/badge.svg)](https://github.com/kenyaclaw/africa-payments-mcp/actions/workflows/security.yml)
[![codecov](https://codecov.io/gh/kenyaclaw/africa-payments-mcp/branch/main/graph/badge.svg)](https://codecov.io/gh/kenyaclaw/africa-payments-mcp)
[![npm version](https://badge.fury.io/js/@kenyaclaw%2Fafrica-payments-mcp.svg)](https://badge.fury.io/js/@kenyaclaw%2Fafrica-payments-mcp)
[![Downloads](https://img.shields.io/npm/dm/@kenyaclaw/africa-payments-mcp.svg)](https://www.npmjs.com/package/@kenyaclaw/africa-payments-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Built by Africans](https://img.shields.io/badge/Built%20by-Africans-008751)](https://github.com/kenyaclaw)

---

## โœจ What if accepting payments was as easy as sending a message?

```bash
# "Send KES 5,000 to Mary via M-Pesa"
# "Request $100 from a customer in Nigeria"  
# "Check if that MTN MoMo payment came through"
# "Process a refund for order #12345"
```

No more wrestling with 5 different APIs. No more juggling documentation.  
Just natural language that works across **M-Pesa**, **Paystack**, **MTN MoMo**, and more.

<p align="center">
  <img src="docs/assets/demo.gif" alt="Africa Payments MCP Demo" width="800"/>
  <br>
  <em>See it in action with Claude, ChatGPT, Cursor, and any MCP client</em>
</p>

---

## ๐ŸŽฌ See It In Action

| Demo with Claude | Demo with Cursor |
|:----------------:|:----------------:|
| ![Claude Demo](docs/assets/claude-screenshot.png) | ![Cursor Demo](docs/assets/cursor-screenshot.png) |

---

## ๐Ÿ’ก Why Africa Payments MCP?

### The Problem ๐Ÿ˜ค

Africa has the world's most innovative payment systemsโ€”M-Pesa, Paystack, Flutterwave, MTN MoMo, Chipper Cashโ€”but integrating them is a nightmare:

- ๐Ÿ”€ **Fragmented APIs**: M-Pesa uses SOAP. Paystack uses REST. MTN MoMo uses something entirely different.
- ๐Ÿ“š **Scattered Documentation**: Hours spent hunting for the right docs
- ๐Ÿ”ง **Different Auth Methods**: API keys, OAuth, basic authโ€”each one unique
- ๐Ÿ› **Edge Cases Everywhere**: Each provider has quirks that break your code
- โฑ๏ธ **Weeks of Integration Time**: Before you process a single payment

### The Solution ๐ŸŽฏ

**One MCP server. Every provider. Natural language.**

```typescript
// Instead of this...
const mpesa = new MpesaAPI({ consumerKey, consumerSecret, passkey });
await mpesa.authenticate();
const result = await mpesa.stkPush({ phone, amount, accountRef });

// Just say this:
"Send KES 5,000 to 254712345678 via M-Pesa"
```

### The Impact ๐Ÿš€

- โšก **Ship in hours, not weeks** โ€” Your first payment working today
- ๐Ÿง  **AI-native from day one** โ€” Built for the era of AI agents
- ๐ŸŒ **Truly Pan-African** โ€” One integration covers the continent
- ๐Ÿ”“ **Open Source** โ€” MIT licensed, community-driven
- ๐Ÿ› ๏ธ **Developer-First** โ€” Built by Africans who understand the pain

---

## ๐Ÿš€ Quick Start

### One-Line Installer (Recommended)

```bash
curl -fsSL https://raw.githubusercontent.com/kenyaclaw/africa-payments-mcp/main/scripts/install.sh | bash
```

Or with wget:
```bash
wget -qO- https://raw.githubusercontent.com/kenyaclaw/africa-payments-mcp/main/scripts/install.sh | bash
```

### Manual Installation

#### 1. Install

```bash
npm install -g @kenyaclaw/africa-payments-mcp
```

#### 2. Configure

**Interactive wizard (recommended):**
```bash
africa-payments-mcp init
# Beautiful interactive setup with emoji and progress indicators
```

**Auto-detect existing credentials:**
```bash
africa-payments-mcp detect --output config.json
# Automatically finds MPESA_*, PAYSTACK_* env vars and config files
```

### 3. Connect to Your AI

Add to your MCP client configuration:

```json
{
  "mcpServers": {
    "africa-payments": {
      "command": "africa-payments-mcp",
      "env": {
        "MPESA_CONSUMER_KEY": "your_key",
        "PAYSTACK_SECRET_KEY": "your_key"
      }
    }
  }
}
```

### 4. Start Accepting Payments

Open Claude, ChatGPT, Cursor, or any MCP client and just ask:

> "Send KES 5,000 to Mary via M-Pesa"

---

## ๐Ÿณ Docker Quick Start

Run with Docker (no Node.js installation required):

```bash
# Pull the latest image
docker pull kenyaclaw/africa-payments-mcp:latest

# Run with a config file
docker run -v $(pwd)/config.json:/app/config/config.json \
  kenyaclaw/africa-payments-mcp:latest

# Or run with environment variables
docker run -e MPESA_CONSUMER_KEY=xxx \
  -e MPESA_CONSUMER_SECRET=xxx \
  -e PAYSTACK_SECRET_KEY=xxx \
  kenyaclaw/africa-payments-mcp:latest
```

### Docker Compose

```yaml
version: '3.8'
services:
  africa-payments:
    image: kenyaclaw/africa-payments-mcp:latest
    volumes:
      - ./config.json:/app/config/config.json:ro
    environment:
      - NODE_ENV=production
    ports:
      - "3000:3000"  # For webhook support
    restart: unless-stopped
```

---

## ๐Ÿ”Œ Supported Providers

| Provider | Countries | Status | Features |
|----------|-----------|--------|----------|
| **M-Pesa** | ๐Ÿ‡ฐ๐Ÿ‡ช Kenya, ๐Ÿ‡น๐Ÿ‡ฟ Tanzania, ๐Ÿ‡ฒ๐Ÿ‡ฟ Mozambique, ๐Ÿ‡จ๐Ÿ‡ฉ DRC, ๐Ÿ‡ช๐Ÿ‡ฌ Egypt | โœ… Ready | STK Push, B2C, B2B, C2B, Reversal |
| **Paystack** | ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria, ๐Ÿ‡ฌ๐Ÿ‡ญ Ghana, ๐Ÿ‡ฟ๐Ÿ‡ฆ South Africa, +4 more | โœ… Ready | Cards, Bank Transfer, Mobile Money |
| **MTN MoMo** | ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria, ๐Ÿ‡ฌ๐Ÿ‡ญ Ghana, ๐Ÿ‡บ๐Ÿ‡ฌ Uganda, +12 more | โœ… Ready | Collections, Disbursements, Remittances |
| **Flutterwave** | ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria, ๐Ÿ‡ฐ๐Ÿ‡ช Kenya, ๐Ÿ‡ฟ๐Ÿ‡ฆ South Africa, +30 more | ๐Ÿšง Beta | Cards, Mobile Money, Bank Transfer |
| **Chipper Cash** | ๐Ÿ‡ณ๐Ÿ‡ฌ Nigeria, ๐Ÿ‡ฌ๐Ÿ‡ญ Ghana, ๐Ÿ‡ฐ๐Ÿ‡ช Kenya, +7 more | ๐Ÿšง Beta | P2P Transfers, Payments |

> ๐Ÿ’ก **Want to add a provider?** [See our contribution guide](CONTRIBUTING.md)

---

## ๐Ÿ“– Documentation

- [๐Ÿ“š Full Documentation](https://docs.africapayments.dev)
- [๐Ÿš€ Quick Start Guide](docs/quickstart.md)
- [๐Ÿ”ง Provider Setup](docs/providers.md)
- [๐Ÿ’ป API Reference](docs/api.md)
- [๐Ÿงช Examples](examples/)

---

## ๐Ÿ—๏ธ Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Your AI Agent                             โ”‚
โ”‚              (Claude, ChatGPT, Cursor, etc.)                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ”‚ MCP Protocol
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              Africa Payments MCP Server                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚   M-Pesa    โ”‚ โ”‚  Paystack   โ”‚ โ”‚     MTN MoMo            โ”‚ โ”‚
โ”‚  โ”‚   Adapter   โ”‚ โ”‚   Adapter   โ”‚ โ”‚     Adapter             โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚ Flutterwave โ”‚ โ”‚ ChipperCash โ”‚ โ”‚    More Coming...       โ”‚ โ”‚
โ”‚  โ”‚   Adapter   โ”‚ โ”‚   Adapter   โ”‚ โ”‚                         โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## ๐ŸŒŸ What Developers Are Saying

> *"Integrated M-Pesa in 10 minutes. Took me 3 weeks the old way."*  
> โ€” **David O.**, Fintech Developer, Lagos

> *"Finally, payments that work the way I think about them."*  
> โ€” **Grace W.**, Startup Founder, Nairobi

> *"The USB-C of African payments. One connection, everything works."*  
> โ€” **Kofi A.**, Full Stack Engineer, Accra

---

## ๐Ÿค Contributing

We built this for Africa's developers. Help us make it better:

1. ๐Ÿด Fork the repo
2. ๐ŸŒฟ Create your branch (`git checkout -b feature/amazing-feature`)
3. ๐Ÿ’ป Make your changes
4. โœ… Add tests
5. ๐Ÿ“ Update documentation
6. ๐Ÿ”€ Submit a PR

[Read our Contributing Guide](CONTRIBUTING.md)

---

## ๐Ÿ“œ License

MIT License โ€” use it, modify it, build the future of African fintech.

---

## ๐Ÿ’ฌ Join the Community

- ๐Ÿฆ [Twitter/X](https://twitter.com/africapayments)
- ๐Ÿ’ผ [LinkedIn](https://linkedin.com/company/africa-payments)
- ๐Ÿ’ฌ [Discord](https://discord.gg/africapayments)
- ๐Ÿ“ง [Email us](mailto:hello@africapayments.dev)

---

<p align="center">
  <strong>Built with โค๏ธ in Nairobi, Lagos, Accra, and across the continent</strong>
  <br>
  <em>๐Ÿ‡ฐ๐Ÿ‡ช ๐Ÿ‡ณ๐Ÿ‡ฌ ๐Ÿ‡ฌ๐Ÿ‡ญ ๐Ÿ‡น๐Ÿ‡ฟ ๐Ÿ‡บ๐Ÿ‡ฌ ๐Ÿ‡ฟ๐Ÿ‡ฆ ๐Ÿ‡ช๐Ÿ‡ฌ ๐Ÿ‡ฒ๐Ÿ‡ฆ ๐Ÿ‡ท๐Ÿ‡ผ ๐Ÿ‡ช๐Ÿ‡น ๐Ÿ‡ธ๐Ÿ‡ณ ๐Ÿ‡จ๐Ÿ‡ฎ</em>
</p>

<p align="center">
  <img src="docs/assets/africa-payments-logo.svg" alt="Africa Payments MCP" width="200"/>
</p>


## ๐Ÿš€ Launch Materials

Ready to launch? Check out our complete launch kit:
๐Ÿ“‹ **[LAUNCH.md](docs/LAUNCH.md)** - Twitter, HN, Dev.to, LinkedIn, Product Hunt templates


Maintenance

ActivityInactive
ResponsivenessNo issues