Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words Sign in

M-Pesa Daraja

by Mr-Machariaversion 0.1.6i★ 3 (Stars for the whole repo)iRuns on your computerRepository ↗
Registry nameio.github.Mr-Macharia/mpesa-daraja-mcp

How to install

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

rea

Reverse engineer anything with agents, from app behavior down to native binaries.

by morluto★ 468,7331 skills

Skill · How-to guide

andrej-karpathy-skills

A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.

by multica-ai★ 234,3321 skills

Skill · How-to guideNo license stated

graphify

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

by Graphify-Labs★ 150,2871 skills

Skill · How-to guide

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity0/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score12/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.

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

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

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

  3. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

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

  5. Quit Claude and open it again

  6. 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_ENV sandbox (default) or production
  • DARAJA_SHORTCODE Paybill / store number (174379 in sandbox)
  • DARAJA_INITIATOR_NAME API operator username (B2C, B2B, status, balance, reversal)
  • DARAJA_CALLBACK_BASE_URL Public HTTPS base for callback URLs
  • DARAJA_CALLBACK_LISTEN host:port for the built-in callback receiver
  • 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_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_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

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

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.

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

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

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

  3. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  4. 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-mcp

    Replace “your-value” with your key before pressing Enter

    Paste the key only into the app’s field, never into a chat or to anyone

  5. Type /mcp in Claude Code

    You should see M-Pesa Daraja listed as connected

  6. 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_ENV sandbox (default) or production
  • DARAJA_SHORTCODE Paybill / store number (174379 in sandbox)
  • DARAJA_INITIATOR_NAME API operator username (B2C, B2B, status, balance, reversal)
  • DARAJA_CALLBACK_BASE_URL Public HTTPS base for callback URLs
  • DARAJA_CALLBACK_LISTEN host:port for the built-in callback receiver
  • 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_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_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

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.

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

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

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

  3. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

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

  5. Open the AI chat in Cursor in Agent mode

  6. 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_ENV sandbox (default) or production
  • DARAJA_SHORTCODE Paybill / store number (174379 in sandbox)
  • DARAJA_INITIATOR_NAME API operator username (B2C, B2B, status, balance, reversal)
  • DARAJA_CALLBACK_BASE_URL Public HTTPS base for callback URLs
  • DARAJA_CALLBACK_LISTEN host:port for the built-in callback receiver
  • 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_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_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

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.

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

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

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

  3. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

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

  5. Open the AI chat in VS Code in Agent mode

  6. 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_ENV sandbox (default) or production
  • DARAJA_SHORTCODE Paybill / store number (174379 in sandbox)
  • DARAJA_INITIATOR_NAME API operator username (B2C, B2B, status, balance, reversal)
  • DARAJA_CALLBACK_BASE_URL Public HTTPS base for callback URLs
  • DARAJA_CALLBACK_LISTEN host:port for the built-in callback receiver
  • 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_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_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

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

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use M-Pesa Daraja💬 Discussion →
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-mcp

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

All apps, with pros and cons →

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

What we check → · JSON

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.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/mr-macharia-mpesa-daraja-mcp.svg)](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.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

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.

by ahmedkhaleel2004Widely used★ 19KUpdated 2 months ago

Runs in the cloud✓ service owner · gitdiagram.comTried by the PopNx team

Appllama

Study screens, flows and paywalls from top-earning iOS apps, then build from what wins.

by AppllamaWidely used★ 5.2KUpdated 3 months ago

Runs in the cloud✓ service owner · appllama.io

Repowise

Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.

by repowise-devWidely used↓ 6.5K/wk★ 8.2K Stars for the whole repoUpdated 7 days ago

Computer or cloud✓ service owner · repowise.dev
Compared with similar ones
This one
M-Pesa Daraja
GitDiagramAppllamaCloudflare MCPOmnaraRepowise
Runs whereInstalls on your computerRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installRuns in the cloud, nothing to installCloud or install on your computer
Needs a keyYesNoNoNoNoNo
Add with + in ClaudeNoNoNoYesNoNo
Basic checks3/34/44/44/44/45/5
LicenseMITMITMITApache-2.0Apache-2.0AGPL-3.0
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo 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-mcp in 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

ToolDaraja APIMoves 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_credentialsOAuth token (never returned)
mpesa_get_resultFinal status by idempotency key or any Daraja ID (from captured callbacks; STK falls back to STK Query)
mpesa_stk_push_and_waitM-Pesa Express: push, then wait for callback / poll query; returns SUCCESS, FAILED or UNKNOWN✅
mpesa_stk_push / mpesa_stk_queryM-Pesa Express, fire-and-forget / status✅ /
mpesa_c2b_register_urls / mpesa_c2b_simulateC2B v2 (simulate = sandbox only)
mpesa_pull_transactionsPull Transactions query
mpesa_b2c_paymentB2C v3, B2Pochi✅
mpesa_b2b_paymentBusinessPayBill, BusinessBuyGoods, BusinessPayToBulk (B2C top-up), PayTaxToKRA✅
mpesa_b2b_express_checkoutB2B USSD push✅
mpesa_transaction_status / mpesa_account_balanceStatus / Balance (async result)
mpesa_reverse_transactionReversal✅
mpesa_generate_dynamic_qrDynamic QR, saved as a PNG file (path returned, not the image)
mpesa_ratiba_create_standing_orderM-Pesa Ratiba✅
mpesa_bill_manager_optin / mpesa_bill_manager_send_invoice / mpesa_bill_manager_cancel_invoiceBill 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=true hides 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_of with the original M-Pesa receipt; it appears in the approval prompt and the remarks.
  • Callback URLs must be HTTPS; C2B URLs with mpesa/safaricom in 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

VariableRequiredNotes
DARAJA_ENVsandbox (default) or production
DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET✅From your Daraja app
DARAJA_SHORTCODEmost toolsPaybill / store number (174379 in sandbox)
DARAJA_PASSKEYSTKLipa na M-Pesa passkey
DARAJA_INITIATOR_NAMEB2C/B2B/status/balance/reversalAPI operator username
DARAJA_SECURITY_CREDENTIALsamePre-encrypted credential, or set the next two
DARAJA_INITIATOR_PASSWORD + DARAJA_CERT_PATHServer encrypts the password with the cert at startup
DARAJA_CALLBACK_BASE_URLe.g. https://abc.ngrok-free.app; tools append /mpesa/stk/callback, /mpesa/b2c/result, …
DARAJA_ALLOW_LIVE_MONEY_MOVEMENTtrue to allow production charges/payouts
DARAJA_CALLBACK_LISTENe.g. 127.0.0.1:8787: starts the built-in callback receiver
DARAJA_CALLBACK_TOKENwith receiver16+ random characters. Callback URLs become /cb/ /…
DARAJA_STATE_DBSQLite file for requests and results (default ~/.mpesa-mcp/state.db)
DARAJA_TOOLSETSComma list of stk,c2b,payouts,ops,qr,ratiba,billmanager (core is always on). Default: all
DARAJA_READ_ONLYtrue hides every tool that moves money or writes
DARAJA_APPROVAL_THRESHOLDPayouts above this many shillings need a yes in the chat
DARAJA_ALLOWED_RECIPIENTSComma list of phones/shortcodes that payouts may go to
DARAJA_OUTPUT_DIRWhere QR PNGs are saved (default ~/.mpesa-mcp/qr)
DARAJA_FORWARD_URLYour app's endpoint. Each callback is POSTed on to it, signed. See forwarding
DARAJA_FORWARD_SECRETwith forwarding16+ random characters, used for the X-Mpesa-Signature HMAC
DARAJA_MCP_TOKENHTTP mode32+ random characters; clients send Authorization: Bearer
DARAJA_MCP_HOST, DARAJA_MCP_PORTHTTP 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:

  1. Environment variables, e.g. from the client's env block.
  2. A project `.env` in the folder the agent starts the server in, or the file named by DARAJA_DOTENV. Only DARAJA_* lines are read.
  3. The user config file that setup writes: ~/.config/mpesa-daraja-mcp/config.env (Windows: %APPDATA%\mpesa-daraja-mcp\config.env; override the folder with DARAJA_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_wait returns the final outcome in one call.
  • Queue-timeout callbacks are recorded as UNKNOWN.
  • C2B validation requests are always accepted. Use yo

Only the beginning is shown; read the rest in the repo