Daraja MCP Server

MCP server for the Safaricom M-Pesa Daraja 3.0 API. Full product surface including M-Pesa Ratiba, a hardened callback receiver, and an offline

Local serverstdio

What is the Daraja MCP Server?

MCP server for the Safaricom M-Pesa Daraja 3.0 API. Full product surface including M-Pesa Ratiba, a hardened callback receiver, and an offline simulator so you can

What it actually does

Covers the full product surface including M-Pesa Ratiba, verifies the source of inbound callbacks, and ships a simulator so you can run every tool without a Safaricom account.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
stk_pushSend a payment prompt. Returns an acknowledgement only.
stk_push_and_waitSend a prompt and wait for the customer. Returns the receipt.
stk_queryCheck the status of a previous prompt.
ratiba_createCreate a standing order for recurring collection.
ratiba_create_and_waitCreate one and wait for the customer to approve.
generate_qrGenerate a dynamic QR code.
b2c_paymentPay a customer: refunds, withdrawals, salaries.
b2c_payment_and_waitSame, but returns the settled result.
b2b_paymentPay a PayBill, a till, or top up a B2C working account.
tax_remittanceRemit tax to KRA against a PRN.
business_to_pochiPay a Pochi la Biashara number.
account_balanceQuery your business account balance.
transaction_statusLook up any past transaction.
reversalReverse a transaction paid into your shortcode.

How to install the Daraja MCP Server

{
  "mcpServers": {
    "daraja": {
      "command": "npx",
      "args": ["-y", "daraja-mcp"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
DARAJA_CONSUMER_KEYCredential the server authenticates with.Yes
DARAJA_CONSUMER_SECRETCredential the server authenticates with.Yes
DARAJA_SHORTCODEConfiguration value read at startup.Optional
DARAJA_PASSKEYCredential the server authenticates with.Yes
DARAJA_CALLBACK_PUBLIC_URLEndpoint or connection string the server talks to.Yes
DARAJA_CALLBACK_PATH_SECRETCredential the server authenticates with.Yes

Example prompts to try

  • “Use Daraja to stk push.”
  • “Use Daraja to stk push and wait.”
  • “Use Daraja to stk query.”

Frequently asked questions

MCP server for the Safaricom M-Pesa Daraja 3.0 API. Full product surface including M-Pesa Ratiba, a hardened callback receiver, and an offline simulator so you can Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.