mcpbeat Sign in

M-Pesa Daraja MCP Server

by mr-macharia Your server? Claim it
local only

M-Pesa Daraja runs on your own machine — the client starts it, so there is no endpoint to ping. 436 installs a week from pypi. Last commit 3 Nov 2026.

Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent.

Installs per day peak 737 · avg 109 · -63% w/w
a month agotoday
436
Installs / week
pypi · mpesa-daraja-mcp
3
Stars
4 open issues
3 Nov 2026
Last commit
from GitHub
MIT
License
Python

What the code does

We read the source, 4 d ago · rules 995398eba69f

Capabilities

What this server is able to do. For an MCP server this is often the job itself — a terminal server runs commands because that is what it is for. Listed so you know what you are plugging in, not as an accusation.

        res = subprocess.run(cmd, capture_output=True, text=True, timeout=60)

Is this your server and something here is wrong? Tell us — corrections are free and do not require a plan.

This code can reach further than it looks

We found places where it runs commands, builds paths or queries from values it is given. None of that is a flaw by itself — it becomes one when the code changes, and code changes quietly between releases. We re-read it on every one.

Three servers free · no card

Connect this server

This server runs on your own machine — install it with the package manager and the client starts it for you. Package name taken from the official registry entry.

run in your terminal
claude mcp add mpesa-daraja-mcp -e 'DARAJA_CONSUMER_KEY=<DARAJA_CONSUMER_KEY>' -e 'DARAJA_CONSUMER_SECRET=<DARAJA_CONSUMER_SECRET>' -- uvx mpesa-daraja-mcp
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "mpesa-daraja-mcp": {
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<DARAJA_CONSUMER_KEY>",
        "DARAJA_CONSUMER_SECRET": "<DARAJA_CONSUMER_SECRET>"
      }
    }
  }
}
~/.codex/config.toml
[mcp_servers.mpesa-daraja-mcp]
command = "uvx"
args = ["mpesa-daraja-mcp"]
env = { DARAJA_CONSUMER_KEY = "<DARAJA_CONSUMER_KEY>", DARAJA_CONSUMER_SECRET = "<DARAJA_CONSUMER_SECRET>" }
.cursor/mcp.json
{
  "mcpServers": {
    "mpesa-daraja-mcp": {
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<DARAJA_CONSUMER_KEY>",
        "DARAJA_CONSUMER_SECRET": "<DARAJA_CONSUMER_SECRET>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "mpesa-daraja-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<DARAJA_CONSUMER_KEY>",
        "DARAJA_CONSUMER_SECRET": "<DARAJA_CONSUMER_SECRET>"
      }
    }
  }
}

Put your own values in place of <DARAJA_CONSUMER_KEY> (Daraja app Consumer Key), <DARAJA_CONSUMER_SECRET> (Daraja app Consumer Secret). The author’s registry entry marks them as required.

Optional settings from the registry entry, left out of the block above: DARAJA_ENV (sandbox (default) or production), DARAJA_SHORTCODE (Paybill / store number (174379 in sandbox)), DARAJA_PASSKEY (M-Pesa Express passkey (STK Push)), DARAJA_INITIATOR_NAME (API operator username (B2C, B2B, status, balance, reversal)), DARAJA_SECURITY_CREDENTIAL (Encrypted initiator password), DARAJA_CALLBACK_BASE_URL (Public HTTPS base for callback URLs), DARAJA_CALLBACK_LISTEN (host:port for the built-in callback receiver), DARAJA_CALLBACK_TOKEN (16+ random characters; secret path for callbacks), DARAJA_TOOLSETS (Comma list: stk,c2b,payouts,ops,qr,ratiba,billmanager), DARAJA_READ_ONLY (true hides every tool that moves money or writes), DARAJA_APPROVAL_THRESHOLD (Payouts above this many shillings need approval in the chat), DARAJA_ALLOWED_RECIPIENTS (Comma list of phones/shortcodes that payouts may go to), DARAJA_ALLOW_LIVE_MONEY_MOVEMENT (true to allow production charges and payouts), DARAJA_INITIATOR_PASSWORD (Initiator password, encrypted into SecurityCredential at startup (alternative to DARAJA_SECURITY_CREDENTIAL)), DARAJA_CERT_PATH (Path to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORD), DARAJA_STATE_DB (Path of the SQLite file that stores request state and callbacks), DARAJA_OUTPUT_DIR (Directory where generated QR PNGs are saved), DARAJA_CONFIG_DIR (Directory holding the saved config (default: user config dir)), DARAJA_DOTENV (Path of a .env file to load instead of the project one), DARAJA_MCP_TOKEN (Bearer token for HTTP mode (32+ random characters)), DARAJA_MCP_HOST (HTTP mode bind address (default 127.0.0.1)), DARAJA_MCP_PORT (HTTP mode port (default 8000)), DARAJA_FORWARD_URL (Your app's URL: every callback is POSTed on to it, HMAC-signed), DARAJA_FORWARD_SECRET (HMAC secret for forwarded callbacks (16+ characters)).

Alternatives to M-Pesa Daraja

same job, measured the same way
Mpesa MCP
by gabrielmahia

M-Pesa Daraja and Africa's Talking MCP server: 24 tools; live payments and SMS need confirmation.

1 814 installs/wk local only
RLM Tools
by stefanoshea

Persistent Python sandbox for token-efficient codebase exploration in MCP clients

47 installs/wk local only
Reado
by watermelonbros

Your code review comments from Reado, the read-first IDE, as context and tools for your agent.

local only
Agent Cold Email
by ys-projectcalc

Coldrig — cold-email infra run by your agent: 28 MCP tools, live sending, free sandbox, from $99/mo.

68 installs/wk 37 tools answering
dotsy
by dotsy

Build and publish static sites on dotsy with draft-first MCP tools, OAuth Connect, and API keys.

117 tools answering
F
Finance MCP Server
by thenextgennexus

Live stock quotes, a stock screener, crypto prices and FX rates as agent tools.

5 tools answering
Trustabl Probe
by trustabl

Drafts a network allow list for agent tools and runs them in a network-blocked sandbox.

71 installs/wk local only
R
raccha.ai
by raccha

MCP-first toolbox for agents: KV storage, auth, queue, and utility tools. Free in early access.

67 tools answering

M-Pesa Daraja — questions

Answers built from our own checks of this server.

Why is there no uptime for M-Pesa Daraja?
M-Pesa Daraja runs on your own machine over stdio — there is no network address to reach, so uptime cannot be measured for it by anyone. What can be measured is adoption: the pypi package mpesa-daraja-mcp was installed 436 times last week.
How do I connect M-Pesa Daraja?
Copy the ready config from this page. We generate it for Claude Code, Claude Desktop, Codex, Cursor and VS Code, each in the form that client actually reads. It runs locally, so the command pulls mpesa-daraja-mcp straight from pypi; nothing to host, nothing to sign up for.
How many people use M-Pesa Daraja?
The pypi package mpesa-daraja-mcp was installed 436 times in the last week. Week over week that is -63%. We show installs rather than GitHub stars on purpose: a star is a bookmark, an install is someone actually running it.
Is M-Pesa Daraja open source?
Yes — it is published under the MIT licence, written in Python, 3 stars on GitHub and 4 open issues. The source link is on this page, so you can read exactly what it does with your data before you connect it.