MP

M Pesa Daraja MCP Server

Published by Mr-Macharia

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

CATEGORY
More to explore
DEPLOYMENT
Local package
LATEST SOURCE VERSION
0.1.6
SOURCE CHECKED
Nov 29, 2026

Quick answers

How do I add M Pesa Daraja MCP Server to Claude Code, Cursor or Codex?

Claude CodeCommand

Run this in your terminal:

claude mcp add --env 'DARAJA_CONSUMER_KEY=<your-daraja-consumer-key>' --env 'DARAJA_CONSUMER_SECRET=<your-daraja-consumer-secret>' --env 'DARAJA_PASSKEY=<your-daraja-passkey>' --env 'DARAJA_SECURITY_CREDENTIAL=<your-daraja-security-credential>' --env 'DARAJA_CALLBACK_TOKEN=<your-daraja-callback-token>' --env 'DARAJA_INITIATOR_PASSWORD=<your-daraja-initiator-password>' --env 'DARAJA_MCP_TOKEN=<your-daraja-mcp-token>' --env 'DARAJA_FORWARD_SECRET=<your-daraja-forward-secret>' --transport stdio m-pesa-daraja -- uvx mpesa-daraja-mcp

Replace the <your-…> placeholder with your own DARAJA_CONSUMER_KEY and DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY and DARAJA_SECURITY_CREDENTIAL and DARAJA_CALLBACK_TOKEN and DARAJA_INITIATOR_PASSWORD and DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET.

Claude Code setup guide
CursorConfig

Add this to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project:

{
  "mcpServers": {
    "m-pesa-daraja": {
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<your-daraja-consumer-key>",
        "DARAJA_CONSUMER_SECRET": "<your-daraja-consumer-secret>",
        "DARAJA_PASSKEY": "<your-daraja-passkey>",
        "DARAJA_SECURITY_CREDENTIAL": "<your-daraja-security-credential>",
        "DARAJA_CALLBACK_TOKEN": "<your-daraja-callback-token>",
        "DARAJA_INITIATOR_PASSWORD": "<your-daraja-initiator-password>",
        "DARAJA_MCP_TOKEN": "<your-daraja-mcp-token>",
        "DARAJA_FORWARD_SECRET": "<your-daraja-forward-secret>"
      }
    }
  }
}

Replace the <your-…> placeholder with your own DARAJA_CONSUMER_KEY and DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY and DARAJA_SECURITY_CREDENTIAL and DARAJA_CALLBACK_TOKEN and DARAJA_INITIATOR_PASSWORD and DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET.

Cursor setup guide
CodexCommand

Run this in your terminal:

codex mcp add m-pesa-daraja --env 'DARAJA_CONSUMER_KEY=<your-daraja-consumer-key>' --env 'DARAJA_CONSUMER_SECRET=<your-daraja-consumer-secret>' --env 'DARAJA_PASSKEY=<your-daraja-passkey>' --env 'DARAJA_SECURITY_CREDENTIAL=<your-daraja-security-credential>' --env 'DARAJA_CALLBACK_TOKEN=<your-daraja-callback-token>' --env 'DARAJA_INITIATOR_PASSWORD=<your-daraja-initiator-password>' --env 'DARAJA_MCP_TOKEN=<your-daraja-mcp-token>' --env 'DARAJA_FORWARD_SECRET=<your-daraja-forward-secret>' -- uvx mpesa-daraja-mcp

Replace the <your-…> placeholder with your own DARAJA_CONSUMER_KEY and DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY and DARAJA_SECURITY_CREDENTIAL and DARAJA_CALLBACK_TOKEN and DARAJA_INITIATOR_PASSWORD and DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET.

Codex setup guide
VS CodeConfig

Add this to .mcp.json at the root of your workspace:

{
  "mcpServers": {
    "m-pesa-daraja": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<your-daraja-consumer-key>",
        "DARAJA_CONSUMER_SECRET": "<your-daraja-consumer-secret>",
        "DARAJA_PASSKEY": "<your-daraja-passkey>",
        "DARAJA_SECURITY_CREDENTIAL": "<your-daraja-security-credential>",
        "DARAJA_CALLBACK_TOKEN": "<your-daraja-callback-token>",
        "DARAJA_INITIATOR_PASSWORD": "<your-daraja-initiator-password>",
        "DARAJA_MCP_TOKEN": "<your-daraja-mcp-token>",
        "DARAJA_FORWARD_SECRET": "<your-daraja-forward-secret>"
      }
    }
  }
}

Replace the <your-…> placeholder with your own DARAJA_CONSUMER_KEY and DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY and DARAJA_SECURITY_CREDENTIAL and DARAJA_CALLBACK_TOKEN and DARAJA_INITIATOR_PASSWORD and DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET.

VS Code setup guide
Claude DesktopConfig

Add this to claude_desktop_config.json, then restart Claude:

{
  "mcpServers": {
    "m-pesa-daraja": {
      "command": "uvx",
      "args": [
        "mpesa-daraja-mcp"
      ],
      "env": {
        "DARAJA_CONSUMER_KEY": "<your-daraja-consumer-key>",
        "DARAJA_CONSUMER_SECRET": "<your-daraja-consumer-secret>",
        "DARAJA_PASSKEY": "<your-daraja-passkey>",
        "DARAJA_SECURITY_CREDENTIAL": "<your-daraja-security-credential>",
        "DARAJA_CALLBACK_TOKEN": "<your-daraja-callback-token>",
        "DARAJA_INITIATOR_PASSWORD": "<your-daraja-initiator-password>",
        "DARAJA_MCP_TOKEN": "<your-daraja-mcp-token>",
        "DARAJA_FORWARD_SECRET": "<your-daraja-forward-secret>"
      }
    }
  }
}

Replace the <your-…> placeholder with your own DARAJA_CONSUMER_KEY and DARAJA_CONSUMER_SECRET and DARAJA_PASSKEY and DARAJA_SECURITY_CREDENTIAL and DARAJA_CALLBACK_TOKEN and DARAJA_INITIATOR_PASSWORD and DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET.

Claude Desktop setup guide
ChatGPTNot available

ChatGPT can't add it from its published details: it connects from the cloud and needs a public address, and this server runs on your computer.

ChatGPT setup guide

Which apps can use M Pesa Daraja MCP Server?

Claude Code, Cursor, Codex, VS Code and Claude Desktop can add it from its published details. ChatGPT can't: it connects from the cloud and needs a public address, and this server runs on your computer.

Does M Pesa Daraja MCP Server need an API key?

To run it on your computer, set DARAJA_CONSUMER_KEY, DARAJA_CONSUMER_SECRET, DARAJA_PASSKEY, DARAJA_SECURITY_CREDENTIAL, DARAJA_CALLBACK_TOKEN, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN and DARAJA_FORWARD_SECRET first, with values from the publisher.

Is M Pesa Daraja MCP Server official?

It's published by Mr-Macharia. The Official MCP Registry accepts names under io.github.Mr-Macharia only from the GitHub account or organisation Mr-Macharia. We last checked its listing on Nov 29, 2026. A listing shows where a server comes from; it isn't a security review.

Published packages

pypi · mpesa-daraja-mcp@0.1.6
View source repository