What it does
Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent.
- Connects Runs on your computer
- Account or key Needs DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET
- Category Developer tools
Use together with
Skills that teach the AI this kind of work; they work alongside this one
andrej-karpathy-skills
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Why it ranks here
Lists are ordered by a usage score (out of 100) built from these parts
| Popularity | 0/80 | GitHub stars or weekly downloads: the larger counts 60, the smaller 20 |
|---|---|---|
| Freshness | 12/12 | Full marks for a release or code change within 30 days |
| Still answering | 0/8 | The cloud endpoint answered at the last check |
| Usage score | 12/100 |
Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)
Install
Pick the AI app you use, then copy the settings.
Let your AI install it with one sentence
Please install M-Pesa Daraja. Follow https://mcp.popnx.com/i/mr-macharia-mpesa-daraja-mcp.md, show me the commands and wait for my OK before running them.Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads
Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 14, 2026
First: which AI do you use?
Pick your app and the steps appear below.
Works with Claude, with some setup first
You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
Let AI install it
Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server M-Pesa Daraja for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "mpesa-daraja": { "command": "uvx", "args": [ "mpesa-daraja-mcp" ], "env": { "DARAJA_CONSUMER_KEY": "your-value", "DARAJA_CONSUMER_SECRET": "your-value", "DARAJA_PASSKEY": "your-value", "DARAJA_SECURITY_CREDENTIAL": "your-value", "DARAJA_CALLBACK_TOKEN": "your-value", "DARAJA_INITIATOR_PASSWORD": "your-value", "DARAJA_MCP_TOKEN": "your-value", "DARAJA_FORWARD_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the M-Pesa Daraja tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install uv (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
uv --version- A version number such as uv … = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
uv --versionInstall once; it works for everything that needs uv
Sign up and create a M-Pesa Daraja key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Open the Claude desktop app’s settings file
SettingsDeveloperEdit Config
Paste these settings and save the file
{ "mcpServers": { "mpesa-daraja": { "command": "uvx", "args": [ "mpesa-daraja-mcp" ], "env": { "DARAJA_CONSUMER_KEY": "your-value", "DARAJA_CONSUMER_SECRET": "your-value", "DARAJA_PASSKEY": "your-value", "DARAJA_SECURITY_CREDENTIAL": "your-value", "DARAJA_CALLBACK_TOKEN": "your-value", "DARAJA_INITIATOR_PASSWORD": "your-value", "DARAJA_MCP_TOKEN": "your-value", "DARAJA_FORWARD_SECRET": "your-value" } } } }Paste the key only into the app’s field, never into a chat or to anyone
Quit Claude and open it again
Try it
Use M-Pesa Daraja and tell me what you can do for me, then show me one thing✓ If Claude says it is using M-Pesa Daraja or shows a M-Pesa Daraja tool in the answer, you are connected
18 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
DARAJA_ENVsandbox (default) or productionDARAJA_SHORTCODEPaybill / store number (174379 in sandbox)DARAJA_INITIATOR_NAMEAPI operator username (B2C, B2B, status, balance, reversal)DARAJA_CALLBACK_BASE_URLPublic HTTPS base for callback URLsDARAJA_CALLBACK_LISTENhost:port for the built-in callback receiverDARAJA_TOOLSETSComma list: stk,c2b,payouts,ops,qr,ratiba,billmanagerDARAJA_READ_ONLYtrue hides every tool that moves money or writesDARAJA_APPROVAL_THRESHOLDPayouts above this many shillings need approval in the chatDARAJA_ALLOWED_RECIPIENTSComma list of phones/shortcodes that payouts may go toDARAJA_ALLOW_LIVE_MONEY_MOVEMENTtrue to allow production charges and payoutsDARAJA_CERT_PATHPath to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORDDARAJA_STATE_DBPath of the SQLite file that stores request state and callbacksDARAJA_OUTPUT_DIRDirectory where generated QR PNGs are savedDARAJA_CONFIG_DIRDirectory holding the saved config (default: user config dir)DARAJA_DOTENVPath of a .env file to load instead of the project oneDARAJA_MCP_HOSTHTTP mode bind address (default 127.0.0.1)DARAJA_MCP_PORTHTTP mode port (default 8000)DARAJA_FORWARD_URLYour app's URL: every callback is POSTed on to it, HMAC-signed
Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
ChatGPT cannot connect M-Pesa Daraja yet
M-Pesa Daraja runs on your computer, but ChatGPT can only connect servers that run on the web
What you can do instead
A · Use an app that can connect M-Pesa Daraja
- You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
- You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
- You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
- You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
B · Others in Developer tools that work with ChatGPT
Picked from the most used in the same category, only ones that connect by address with no key
- Sentry✓ ChatGPT
- Compiler Explorer✓ ChatGPT
- GitDiagram✓ ChatGPT
Works with Claude Code, with some setup first
You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Let AI install it
Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server M-Pesa Daraja for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user mpesa-daraja --env DARAJA_CONSUMER_KEY=your-value --env DARAJA_CONSUMER_SECRET=your-value --env DARAJA_PASSKEY=your-value --env DARAJA_SECURITY_CREDENTIAL=your-value --env DARAJA_CALLBACK_TOKEN=your-value --env DARAJA_INITIATOR_PASSWORD=your-value --env DARAJA_MCP_TOKEN=your-value --env DARAJA_FORWARD_SECRET=your-value -- uvx mpesa-daraja-mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the M-Pesa Daraja tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install uv (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
uv --version- A version number such as uv … = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
uv --versionInstall once; it works for everything that needs uv
Sign up and create a M-Pesa Daraja key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Open Terminal
Mac: press Command+Space and type Terminal · Windows: open PowerShell
Paste this command and press Enter
claude mcp add --scope user mpesa-daraja --env DARAJA_CONSUMER_KEY=your-value --env DARAJA_CONSUMER_SECRET=your-value --env DARAJA_PASSKEY=your-value --env DARAJA_SECURITY_CREDENTIAL=your-value --env DARAJA_CALLBACK_TOKEN=your-value --env DARAJA_INITIATOR_PASSWORD=your-value --env DARAJA_MCP_TOKEN=your-value --env DARAJA_FORWARD_SECRET=your-value -- uvx mpesa-daraja-mcpReplace “your-value” with your key before pressing Enter
Paste the key only into the app’s field, never into a chat or to anyone
Type /mcp in Claude Code
You should see M-Pesa Daraja listed as connected
Try it
Use M-Pesa Daraja and tell me what you can do for me, then show me one thing✓ If Claude Code says it is using M-Pesa Daraja or shows a M-Pesa Daraja tool in the answer, you are connected
18 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
DARAJA_ENVsandbox (default) or productionDARAJA_SHORTCODEPaybill / store number (174379 in sandbox)DARAJA_INITIATOR_NAMEAPI operator username (B2C, B2B, status, balance, reversal)DARAJA_CALLBACK_BASE_URLPublic HTTPS base for callback URLsDARAJA_CALLBACK_LISTENhost:port for the built-in callback receiverDARAJA_TOOLSETSComma list: stk,c2b,payouts,ops,qr,ratiba,billmanagerDARAJA_READ_ONLYtrue hides every tool that moves money or writesDARAJA_APPROVAL_THRESHOLDPayouts above this many shillings need approval in the chatDARAJA_ALLOWED_RECIPIENTSComma list of phones/shortcodes that payouts may go toDARAJA_ALLOW_LIVE_MONEY_MOVEMENTtrue to allow production charges and payoutsDARAJA_CERT_PATHPath to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORDDARAJA_STATE_DBPath of the SQLite file that stores request state and callbacksDARAJA_OUTPUT_DIRDirectory where generated QR PNGs are savedDARAJA_CONFIG_DIRDirectory holding the saved config (default: user config dir)DARAJA_DOTENVPath of a .env file to load instead of the project oneDARAJA_MCP_HOSTHTTP mode bind address (default 127.0.0.1)DARAJA_MCP_PORTHTTP mode port (default 8000)DARAJA_FORWARD_URLYour app's URL: every callback is POSTed on to it, HMAC-signed
Descriptions are as written by the maker.
Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with Cursor, with some setup first
You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Let AI install it
Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server M-Pesa Daraja for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "mpesa-daraja": { "command": "uvx", "args": [ "mpesa-daraja-mcp" ], "env": { "DARAJA_CONSUMER_KEY": "your-value", "DARAJA_CONSUMER_SECRET": "your-value", "DARAJA_PASSKEY": "your-value", "DARAJA_SECURITY_CREDENTIAL": "your-value", "DARAJA_CALLBACK_TOKEN": "your-value", "DARAJA_INITIATOR_PASSWORD": "your-value", "DARAJA_MCP_TOKEN": "your-value", "DARAJA_FORWARD_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the M-Pesa Daraja tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install uv (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
uv --version- A version number such as uv … = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
uv --versionInstall once; it works for everything that needs uv
Sign up and create a M-Pesa Daraja key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Fill in your key
In the M-Pesa Daraja settings, DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in Cursor in Agent mode
Try it
Use M-Pesa Daraja and tell me what you can do for me, then show me one thing✓ If Cursor says it is using M-Pesa Daraja or shows a M-Pesa Daraja tool in the answer, you are connected
18 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
DARAJA_ENVsandbox (default) or productionDARAJA_SHORTCODEPaybill / store number (174379 in sandbox)DARAJA_INITIATOR_NAMEAPI operator username (B2C, B2B, status, balance, reversal)DARAJA_CALLBACK_BASE_URLPublic HTTPS base for callback URLsDARAJA_CALLBACK_LISTENhost:port for the built-in callback receiverDARAJA_TOOLSETSComma list: stk,c2b,payouts,ops,qr,ratiba,billmanagerDARAJA_READ_ONLYtrue hides every tool that moves money or writesDARAJA_APPROVAL_THRESHOLDPayouts above this many shillings need approval in the chatDARAJA_ALLOWED_RECIPIENTSComma list of phones/shortcodes that payouts may go toDARAJA_ALLOW_LIVE_MONEY_MOVEMENTtrue to allow production charges and payoutsDARAJA_CERT_PATHPath to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORDDARAJA_STATE_DBPath of the SQLite file that stores request state and callbacksDARAJA_OUTPUT_DIRDirectory where generated QR PNGs are savedDARAJA_CONFIG_DIRDirectory holding the saved config (default: user config dir)DARAJA_DOTENVPath of a .env file to load instead of the project oneDARAJA_MCP_HOSTHTTP mode bind address (default 127.0.0.1)DARAJA_MCP_PORTHTTP mode port (default 8000)DARAJA_FORWARD_URLYour app's URL: every callback is POSTed on to it, HMAC-signed
Descriptions are as written by the maker.
Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version
Works with VS Code, with some setup first
You need a M-Pesa Daraja key (create it on the maker’s site) · Install Python (uv) on your computer first (one time)
Let AI install it
Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.
Please install the MCP server M-Pesa Daraja for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "mpesa-daraja": { "type": "stdio", "command": "uvx", "args": [ "mpesa-daraja-mcp" ], "env": { "DARAJA_CONSUMER_KEY": "your-value", "DARAJA_CONSUMER_SECRET": "your-value", "DARAJA_PASSKEY": "your-value", "DARAJA_SECURITY_CREDENTIAL": "your-value", "DARAJA_CALLBACK_TOKEN": "your-value", "DARAJA_INITIATOR_PASSWORD": "your-value", "DARAJA_MCP_TOKEN": "your-value", "DARAJA_FORWARD_SECRET": "your-value" } } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) For DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET, leave "your-value" in place and tell me to paste the real value myself into the file or the app’s field. Never ask me to type a key in chat. 5) Do what we agreed, then check that the M-Pesa Daraja tools really show up.This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.
Install uv (if you don’t have it)
Already installed? Check first · Open Terminal, type this command and press Enter
uv --version- A version number such as uv … = installed, skip this step
- "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
How to open Terminal
Mac: press ⌘ + Space, type Terminal, press Enter
Windows: open Start, type Windows PowerShell, then Open
Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required
When it’s done, close Terminal, open it again and run the same command. You should see a version number:
uv --versionInstall once; it works for everything that needs uv
Sign up and create a M-Pesa Daraja key
Open the maker’s site, sign up and create an API key for the next step. Check the maker’s site for pricing and free plans.
How to get a key is in the maker’s README below
Fill in your key
In the M-Pesa Daraja settings, DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET is empty; add your key and save
Paste the key only into the app’s field, never into a chat or to anyone
Open the AI chat in VS Code in Agent mode
Try it
Use M-Pesa Daraja and tell me what you can do for me, then show me one thing✓ If VS Code says it is using M-Pesa Daraja or shows a M-Pesa Daraja tool in the answer, you are connected
18 optional setting(s) (works without them)
The command above works without these. Add them only if you want to change something, following the maker’s description.
DARAJA_ENVsandbox (default) or productionDARAJA_SHORTCODEPaybill / store number (174379 in sandbox)DARAJA_INITIATOR_NAMEAPI operator username (B2C, B2B, status, balance, reversal)DARAJA_CALLBACK_BASE_URLPublic HTTPS base for callback URLsDARAJA_CALLBACK_LISTENhost:port for the built-in callback receiverDARAJA_TOOLSETSComma list: stk,c2b,payouts,ops,qr,ratiba,billmanagerDARAJA_READ_ONLYtrue hides every tool that moves money or writesDARAJA_APPROVAL_THRESHOLDPayouts above this many shillings need approval in the chatDARAJA_ALLOWED_RECIPIENTSComma list of phones/shortcodes that payouts may go toDARAJA_ALLOW_LIVE_MONEY_MOVEMENTtrue to allow production charges and payoutsDARAJA_CERT_PATHPath to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORDDARAJA_STATE_DBPath of the SQLite file that stores request state and callbacksDARAJA_OUTPUT_DIRDirectory where generated QR PNGs are savedDARAJA_CONFIG_DIRDirectory holding the saved config (default: user config dir)DARAJA_DOTENVPath of a .env file to load instead of the project oneDARAJA_MCP_HOSTHTTP mode bind address (default 127.0.0.1)DARAJA_MCP_PORTHTTP mode port (default 8000)DARAJA_FORWARD_URLYour app's URL: every callback is POSTed on to it, HMAC-signed
Descriptions are as written by the maker.
Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version
For developers: Terminal commands and JSON settings
Installed on your computer
Claude Code
claude mcp add --scope user mpesa-daraja --env DARAJA_CONSUMER_KEY=your-value --env DARAJA_CONSUMER_SECRET=your-value --env DARAJA_PASSKEY=your-value --env DARAJA_SECURITY_CREDENTIAL=your-value --env DARAJA_CALLBACK_TOKEN=your-value --env DARAJA_INITIATOR_PASSWORD=your-value --env DARAJA_MCP_TOKEN=your-value --env DARAJA_FORWARD_SECRET=your-value -- uvx mpesa-daraja-mcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"mpesa-daraja": {
"command": "uvx",
"args": [
"mpesa-daraja-mcp"
],
"env": {
"DARAJA_CONSUMER_KEY": "your-value",
"DARAJA_CONSUMER_SECRET": "your-value",
"DARAJA_PASSKEY": "your-value",
"DARAJA_SECURITY_CREDENTIAL": "your-value",
"DARAJA_CALLBACK_TOKEN": "your-value",
"DARAJA_INITIATOR_PASSWORD": "your-value",
"DARAJA_MCP_TOKEN": "your-value",
"DARAJA_FORWARD_SECRET": "your-value"
}
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"mpesa-daraja": {
"command": "uvx",
"args": [
"mpesa-daraja-mcp"
],
"env": {
"DARAJA_CONSUMER_KEY": "your-value",
"DARAJA_CONSUMER_SECRET": "your-value",
"DARAJA_PASSKEY": "your-value",
"DARAJA_SECURITY_CREDENTIAL": "your-value",
"DARAJA_CALLBACK_TOKEN": "your-value",
"DARAJA_INITIATOR_PASSWORD": "your-value",
"DARAJA_MCP_TOKEN": "your-value",
"DARAJA_FORWARD_SECRET": "your-value"
}
}
}
}VS Code (mcp.json)
{
"servers": {
"mpesa-daraja": {
"type": "stdio",
"command": "uvx",
"args": [
"mpesa-daraja-mcp"
],
"env": {
"DARAJA_CONSUMER_KEY": "your-value",
"DARAJA_CONSUMER_SECRET": "your-value",
"DARAJA_PASSKEY": "your-value",
"DARAJA_SECURITY_CREDENTIAL": "your-value",
"DARAJA_CALLBACK_TOKEN": "your-value",
"DARAJA_INITIATOR_PASSWORD": "your-value",
"DARAJA_MCP_TOKEN": "your-value",
"DARAJA_FORWARD_SECRET": "your-value"
}
}
}
}Values you fill in
DARAJA_CONSUMER_KEYsecret required envDaraja app Consumer KeyDARAJA_CONSUMER_SECRETsecret required envDaraja app Consumer SecretDARAJA_ENVenvsandbox (default) or productionDARAJA_SHORTCODEenvPaybill / store number (174379 in sandbox)DARAJA_PASSKEYsecret required envM-Pesa Express passkey (STK Push)DARAJA_INITIATOR_NAMEenvAPI operator username (B2C, B2B, status, balance, reversal)DARAJA_SECURITY_CREDENTIALsecret required envEncrypted initiator passwordDARAJA_CALLBACK_BASE_URLenvPublic HTTPS base for callback URLsDARAJA_CALLBACK_LISTENenvhost:port for the built-in callback receiverDARAJA_CALLBACK_TOKENsecret required env16+ random characters; secret path for callbacksDARAJA_TOOLSETSenvComma list: stk,c2b,payouts,ops,qr,ratiba,billmanagerDARAJA_READ_ONLYenvtrue hides every tool that moves money or writesDARAJA_APPROVAL_THRESHOLDenvPayouts above this many shillings need approval in the chatDARAJA_ALLOWED_RECIPIENTSenvComma list of phones/shortcodes that payouts may go toDARAJA_ALLOW_LIVE_MONEY_MOVEMENTenvtrue to allow production charges and payoutsDARAJA_INITIATOR_PASSWORDsecret required envInitiator password, encrypted into SecurityCredential at startup (alternative to DARAJA_SECURITY_CREDENTIAL)DARAJA_CERT_PATHenvPath to Safaricom's public certificate, used with DARAJA_INITIATOR_PASSWORDDARAJA_STATE_DBenvPath of the SQLite file that stores request state and callbacksDARAJA_OUTPUT_DIRenvDirectory where generated QR PNGs are savedDARAJA_CONFIG_DIRenvDirectory holding the saved config (default: user config dir)DARAJA_DOTENVenvPath of a .env file to load instead of the project oneDARAJA_MCP_TOKENsecret required envBearer token for HTTP mode (32+ random characters)DARAJA_MCP_HOSTenvHTTP mode bind address (default 127.0.0.1)DARAJA_MCP_PORTenvHTTP mode port (default 8000)DARAJA_FORWARD_URLenvYour app's URL: every callback is POSTed on to it, HMAC-signedDARAJA_FORWARD_SECRETsecret required envHMAC secret for forwarded callbacks (16+ characters)
Descriptions are as written by the maker.
These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.
At a glance
- GitHub starsi
- 3 (Stars for the whole repo)
This repo holds several MCP listings; its stars count once in rankings - Downloads per weeki
- 47/wk
- Connection
- Runs on your computer
- Latest versioni
- 0.1.6
- Categoryi
- Developer tools
- Published to registryi
- Oct 29, 2026
- Code last changedi
- Nov 4, 2026
- Maker
- Mr-Macharia
- Packages
pypi: mpesa-daraja-mcp- Registry status
- Active
Which apps can use it
Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.
Run on your computer in
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
Related guides
What it can do
Runs on your computer; the tool list appears in your AI app after you install it.
Basic checksi
We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 20, 2026
- ✓ Pass
Maker matches the repo
The registry name was verified with the GitHub account Mr-Macharia, which owns the repo
- ✓ Pass
Still maintained
Code last changed 16 days ago
- ✓ Pass
Has a licence
Uses MIT
- – Not applicable
Endpoint responds
This one runs on your computer; there is no internet endpoint
- – Not applicable
Sign-in with OAuth
Runs on your computer and uses local settings instead
- … Not checked yet
No hidden instructions in tool descriptions
Runs on your computer; we can only read tool lists from internet endpoints
Published vulnerabilities (OSV.dev)
No entries on OSV.dev for mpesa-daraja-mcp@0.1.6
Checks only this package version, not every dependency · checked Nov 15, 2026
Makers: ask for a re-check or report wrong info
For makers: add a badge to your README
If you made this, paste this code into your README. The badge links back to this page.
[](https://mcp.popnx.com/en/servers/mr-macharia-mpesa-daraja-mcp)Discussion
Ask, share a tip or report that it does not work. Sorted by what people marked helpful.
No posts yet. Be the first to ask or share.
Posts here are written by users, not the PopNx team.
User reviews
No reviews yet
Compared with others in Developer toolsi
- More stars than 0% of the other 6202 servers in this category
- Published to the registry more recently than 57% of the other 6202 servers in this category
- Basic checks equal to or better than 99% of the other 6202 servers in this category
Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.
Common questions
Is M-Pesa Daraja safe?
It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.
What keys or codes does it need?
You need to fill in: DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN, DARAJA_FORWARD_SECRET
Does it run on my computer or in the cloud?
It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).
Is it still maintained?
The GitHub repo last changed 16 days ago, and the latest version (0.1.6) reached the registry 22 days ago.
Which apps can use it?
Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.
What can I use instead?
In the same category: GitDiagram, Appllama, Cloudflare MCP, Omnara, Repowise
Similar alternatives
Same category, other makers, commands already checked. Official ones first, then by stars.
Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi
GitDiagram
Architecture diagrams, explanations and Mermaid source for public GitHub repositories.
Appllama
Study screens, flows and paywalls from top-earning iOS apps, then build from what wins.
Cloudflare MCP
Cloudflare MCP servers
Omnara
Deploy durable AI agents with Omnara, an open-source managed-agent platform.
Repowise
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
| This one M-Pesa Daraja | GitDiagram | Appllama | Cloudflare MCP | Omnara | Repowise | |
|---|---|---|---|---|---|---|
| Runs where | Installs on your computer | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Runs in the cloud, nothing to install | Cloud or install on your computer |
| Needs a key | Yes | No | No | No | No | No |
| Add with + in Claude | No | No | No | Yes | No | No |
| Basic checks | 3/3 | 4/4 | 4/4 | 4/4 | 4/4 | 5/5 |
| License | MIT | MIT | MIT | Apache-2.0 | Apache-2.0 | AGPL-3.0 |
| Price | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry | No cost listed in the registry |
README from the maker
Open the README
Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.
mpesa-daraja
Renamed from
mpesa-daraja-mcpin 0.1.5. The old package name still installs this one.
The MCP server in the M-Pesa Daraja Agent Kit. It lets an AI agent call Safaricom's Daraja API safely.
An MCP server that exposes Safaricom's Daraja APIs as tools, so an agent (Claude Code, Codex, Cursor, Gemini CLI, any MCP client) can collect payments, check whether they went through, and operate M-Pesa from a chat. It starts in the sandbox, and nothing live happens until you switch it on.
It pairs with the Agent Skills in the same kit: the skills teach an agent *how* to integrate M-Pesa, and this server lets it *call* Daraja. You can use either on its own.
Who it's for
- Developers building payment integrations: ask your agent to run a request against the sandbox and read the real response.
- Learners finding out how the Daraja API works: send real requests to a safe test environment and see what comes back.
- Businesses and teams that want an AI agent to handle payments: collecting them, checking whether they went through, and reconciling them.
Install
Let your agent do it. Paste this into Claude Code, Codex, Cursor, Gemini CLI or any coding agent:
Add the M-Pesa Daraja MCP server to yourself, named "mpesa", with the command: uvx mpesa-daraja-mcp
It needs no keys in your config. If uv is missing, tell me how to install it first. Don't ask me for my Daraja keys. Tell me to run uvx mpesa-daraja-mcp init in my own terminal, which saves them privately, then to restart you. After I restart you, call mpesa_check_credentials and tell me if everything works.
Or do it yourself. You need uv. The wizard asks for your Daraja keys (secrets are typed hidden), checks them live with Safaricom, saves them to a file only you can read, and registers the server with Claude Code, Codex, Gemini CLI or Cursor:
uvx mpesa-daraja-mcp init
Then restart your agent and ask: *"Check my M-Pesa credentials, then send a KES 1 STK push to 0712345678 and tell me when it's paid."* The full Agent Kit, with the skills and more examples, is in the main README.
Tools
| Tool | Daraja API | Moves money |
|---|---|---|
mpesa_explain_code | — offline error/result code lookup | |
mpesa_normalize_phone | — offline 07… → 2547… | |
mpesa_generate_stk_password | — offline Password + EAT Timestamp | |
mpesa_parse_callback | — offline parse of any callback payload | |
mpesa_setup_status | — offline: what's configured and missing per toolset (no values) | |
mpesa_check_credentials | OAuth token (never returned) | |
mpesa_get_result | Final status by idempotency key or any Daraja ID (from captured callbacks; STK falls back to STK Query) | |
mpesa_stk_push_and_wait | M-Pesa Express: push, then wait for callback / poll query; returns SUCCESS, FAILED or UNKNOWN | ✅ |
mpesa_stk_push / mpesa_stk_query | M-Pesa Express, fire-and-forget / status | ✅ / |
mpesa_c2b_register_urls / mpesa_c2b_simulate | C2B v2 (simulate = sandbox only) | |
mpesa_pull_transactions | Pull Transactions query | |
mpesa_b2c_payment | B2C v3, B2Pochi | ✅ |
mpesa_b2b_payment | BusinessPayBill, BusinessBuyGoods, BusinessPayToBulk (B2C top-up), PayTaxToKRA | ✅ |
mpesa_b2b_express_checkout | B2B USSD push | ✅ |
mpesa_transaction_status / mpesa_account_balance | Status / Balance (async result) | |
mpesa_reverse_transaction | Reversal | ✅ |
mpesa_generate_dynamic_qr | Dynamic QR, saved as a PNG file (path returned, not the image) | |
mpesa_ratiba_create_standing_order | M-Pesa Ratiba | ✅ |
mpesa_bill_manager_optin / mpesa_bill_manager_send_invoice / mpesa_bill_manager_cancel_invoice | Bill Manager |
Tool annotations mark money-moving tools as destructiveHint, so MCP clients ask for approval.
Safety
- Defaults to the sandbox.
- In production, money-moving tools refuse to run unless
DARAJA_ALLOW_LIVE_MONEY_MOVEMENT=true. - Optional guardrails, all off until set:
DARAJA_READ_ONLY=truehides every tool that moves money or writes. Use it for support bots, reconciliation and learning.DARAJA_APPROVAL_THRESHOLD=5000: B2C, B2B, tax and reversals above KES 5,000 pause for a yes/no in the chat (MCP elicitation). Clients that can't show the prompt get a refusal, and nothing is sent. Collections (STK, B2B Express, Ratiba) never prompt, because the payer enters their own PIN.DARAJA_ALLOWED_RECIPIENTS=0712345678,600000: payouts may go only to these phones and shortcodes.- For a B2C refund, pass
refund_ofwith the original M-Pesa receipt; it appears in the approval prompt and the remarks. - Callback URLs must be HTTPS; C2B URLs with
mpesa/safaricomin them are rejected up front. - Tokens and secrets are never returned in tool output.
- Responses with
ResponseCode "0"are tagged_note: ACCEPTED for processing only, so the agent does not report them as completed payments. - Idempotent money tools. Each request is stored under an idempotency key. Repeating the key returns the stored request (
duplicate: true) instead of paying again. - Only a definitively FAILED request is re-sent.
- ACCEPTED or UNKNOWN requests (queue timeouts, network errors) are never re-sent until their result is known.
- B2C, B2B and B2B Express require an explicit
idempotency_key, e.g.refund-order-1042. Reversal, tax and Ratiba derive one from the transaction ID, the PRN and phone + name respectively. For STK the key is optional.
Configuration
| Variable | Required | Notes |
|---|---|---|
DARAJA_ENV | sandbox (default) or production | |
DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET | ✅ | From your Daraja app |
DARAJA_SHORTCODE | most tools | Paybill / store number (174379 in sandbox) |
DARAJA_PASSKEY | STK | Lipa na M-Pesa passkey |
DARAJA_INITIATOR_NAME | B2C/B2B/status/balance/reversal | API operator username |
DARAJA_SECURITY_CREDENTIAL | same | Pre-encrypted credential, or set the next two |
DARAJA_INITIATOR_PASSWORD + DARAJA_CERT_PATH | Server encrypts the password with the cert at startup | |
DARAJA_CALLBACK_BASE_URL | e.g. https://abc.ngrok-free.app; tools append /mpesa/stk/callback, /mpesa/b2c/result, … | |
DARAJA_ALLOW_LIVE_MONEY_MOVEMENT | true to allow production charges/payouts | |
DARAJA_CALLBACK_LISTEN | e.g. 127.0.0.1:8787: starts the built-in callback receiver | |
DARAJA_CALLBACK_TOKEN | with receiver | 16+ random characters. Callback URLs become /cb/ /… |
DARAJA_STATE_DB | SQLite file for requests and results (default ~/.mpesa-mcp/state.db) | |
DARAJA_TOOLSETS | Comma list of stk,c2b,payouts,ops,qr,ratiba,billmanager (core is always on). Default: all | |
DARAJA_READ_ONLY | true hides every tool that moves money or writes | |
DARAJA_APPROVAL_THRESHOLD | Payouts above this many shillings need a yes in the chat | |
DARAJA_ALLOWED_RECIPIENTS | Comma list of phones/shortcodes that payouts may go to | |
DARAJA_OUTPUT_DIR | Where QR PNGs are saved (default ~/.mpesa-mcp/qr) | |
DARAJA_FORWARD_URL | Your app's endpoint. Each callback is POSTed on to it, signed. See forwarding | |
DARAJA_FORWARD_SECRET | with forwarding | 16+ random characters, used for the X-Mpesa-Signature HMAC |
DARAJA_MCP_TOKEN | HTTP mode | 32+ random characters; clients send Authorization: Bearer |
DARAJA_MCP_HOST, DARAJA_MCP_PORT | HTTP mode bind address and port (default 127.0.0.1:8000) |
Commands and configuration files
Install once with uv tool install mpesa-daraja-mcp to get the mpesa command (or prefix any command with uvx mpesa-daraja-mcp instead of mpesa):
mpesa init # guided: keys (hidden input), live check, save, register with your agents
mpesa status # what's configured (masked), the guardrails, and a live key check mpesa dev # callback receiver + tunnel (cloudflared or ngrok) + a live log of callbacks mpesa serve [--http] # the MCP server: stdio for local agents, HTTP for remote ones mpesa up --domain pay.example.com # self-host with Docker and automatic HTTPS mpesa pay stk 0712345678 10 --ref order-42 # waits for the PIN and shows the outcome mpesa pay b2c 0712345678 500 --key refund-42 --refund-of NLJ7RT61SV mpesa result · mpesa balance · mpesa explain 1032 mpesa skills install # copy the Agent Skills into Claude Code, Codex, Cursor, … mpesa upgrade
Every data command takes --json, and mpesa --verbose … logs each HTTP request to Daraja. A failed STK Push shows the --key to retry it with. Payments use the same guardrails as the MCP tools, and approvals are asked in the terminal. uvx mpesa-daraja-mcp with no arguments is the MCP server on stdio, which is what your agent runs.
The server needs no flags or environment variables in your agent's config. Settings are read in this order, highest first:
- Environment variables, e.g. from the client's
envblock. - A project `.env` in the folder the agent starts the server in, or the file named by
DARAJA_DOTENV. OnlyDARAJA_*lines are read. - The user config file that
setupwrites:~/.config/mpesa-daraja-mcp/config.env(Windows:%APPDATA%\mpesa-daraja-mcp\config.env; override the folder withDARAJA_CONFIG_DIR). It is readable only by you.
The server starts even when unconfigured. Tools then explain what's missing, and mpesa_setup_status lists the gaps for each toolset without revealing any values.
To register by hand: claude mcp add --scope user mpesa -- uvx mpesa-daraja-mcp. Every other agent is covered in docs/clients.md. The mpesa-daraja and mpesa-mcp commands are aliases.
Remote access (HTTP mode)
mpesa serve --http serves MCP at /mcp and Daraja callbacks at /cb/ /… on one port, for n8n, cloud agents and teammates. It needs DARAJA_MCP_TOKEN, and starts read-only with every payout needing approval unless you say otherwise. Docker, HTTPS and n8n guides: https://github.com/Mr-Macharia/mpesa-daraja-skills-and-mcp/blob/main/docs/self-hosting.md
Results and callbacks
Every money or async tool returns one shape:
{"status": "ACCEPTED | SUCCESS | FAILED | UNKNOWN", "message": "...", "idempotency_key": "...",
"duplicate": false, "ids": {"checkout_request_id": "..."}, "receipt": "...", "result_code": "...", "explanation": "...", "raw": {}}
To let the agent see final results, enable the built-in receiver:
export DARAJA_CALLBACK_LISTEN=127.0.0.1:8787
export DARAJA_CALLBACK_TOKEN=$(python -c "import secrets; print(secrets.token_urlsafe(24))") ngrok http 8787 # sandbox; use a reverse proxy with TLS in production export DARAJA_CALLBACK_BASE_URL=https://
Callbacks are stored in DARAJA_STATE_DB:
mpesa_get_result(id)reads them.mpesa_stk_push_and_waitreturns the final outcome in one call.- Queue-timeout callbacks are recorded as UNKNOWN.
- C2B validation requests are always accepted. Use yo