Skip to content
verify mcp Beta VerifyMCP is currently in beta. If you notice any issues, get in touch and we’ll put it right.

M-Pesa Daraja

PYPI · MPESA-DARAJA-MCP

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

Available components

+18 this week 83 Trust /100

Last scanned (47 minutes ago)

Scores higher than 86% of PyPI servers

Category Finance and Payments

Trust breakdown (7 categories)

How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. How we score → Why this is hard to score →

Supply Chain Security100
  • No malware found by supply-chain analysis.Pass
  • No known CVEs affecting this package version or its production dependencies.Pass
  • Runs hatchling.build at install time, a recognised build step with no custom scripting around it. View diagnostics → Pass
  • 4 of 45 dependencies flagged as unhealthy. View diagnostics → Partial
Provenance & Transparency100
  • Source repository is publicly reachable at the declared URL. View diagnostics → Pass
  • Cryptographically verified build provenance (signed, bound to Mr-Macharia/mpesa-daraja-skills-and-mcp). View diagnostics → Pass
  • Clear OSI-approved license (MIT).Pass
  • Actively maintained (last published 7 days ago).Pass
  • Publishes a security disclosure policy (SECURITY.md).Pass
Schema Quality & AI Usability56
  • AI-judged instruction clarity (fair).Partial
  • Tool/resource definitions use about 2073 tokens (~86/item across 24 items; 24 tools + 0 resources), lean.Pass
  • Usage-examples check failed: none of the tools include examples. See how to fix → Fail
Stability & Change Management53
  • Stability observed for 16 of 30 days with no destabilising changes; credit accrues until the full window elapses.Partial
Tool Coverage71
  • 100% of tools have a non-trivial description (not blank, and not just the tool's name).Pass
  • 0% of tool parameters carry a description.Fail
  • Structured output schemas are declared (75% of tools); any adoption earns full credit.Pass
Tool Safety100
  • No prompt-injection markers were found in the server instructions, tool names or descriptions we captured.Pass
  • All 5 tool(s) whose name or description implies an irreversible operation declare an MCP destructiveHint annotation.Pass
  • An AI judge read all 25 captured unit(s) of tool text and found none that tries to manipulate the model reading it.Pass
Capabilities100
  • Implements a current MCP spec version (2026-07-28).Pass
Changelog

Every change we have recorded for this component, newest first. Security-relevant changes are always shown. ▲ marks a change for the better, ▼ a change for the worse; unmarked changes are neutral.

  • 5 Nov 26 +15
    • Malware scan: unverified → pass ▲ security
  • 4 Nov 26 +1

    No change was recorded against any check on this day. Stability & Change Management went from 47 to 50. That category is still filling its 30-day observation window: 14 days of observed history at the previous scan, 15 at this one. The score rises as the window fills, whether or not the server changes.

  • 2 Nov 26 −14
    • Malware scan: pass → unverified ▼ security
  • 1 Nov 26 +15
    • Malware scan: unverified → pass ▲ security
  • 31 Oct 26 +1

    No change was recorded against any check on this day. Stability & Change Management went from 33 to 37. That category is still filling its 30-day observation window: 10 days of observed history at the previous scan, 11 at this one. The score rises as the window fills, whether or not the server changes.

  • 29 Oct 26 −15
    • Malware scan: pass → unverified ▼ security
    • Stability: 0.27 → unverified ▼ security
    • Tool safety: pass → unverified ▼ security
    • Capabilities: pass → unverified ▼ functional
    • Tool coverage: 100 → unverified ▼ functional
    • First check of Schema quality: unverified functional
    • Package version: 0.1.4 → 0.1.6 functional
    • Package version: 0.1.4 → 0.1.5 functional
  • 28 Oct 26 +1

    No change was recorded against any check on this day. Stability & Change Management went from 23 to 27. That category is still filling its 30-day observation window: 7 days of observed history at the previous scan, 8 at this one. The score rises as the window fills, whether or not the server changes.

  • 26 Oct 26 +1

    No change was recorded against any check on this day. Stability & Change Management went from 17 to 20. That category is still filling its 30-day observation window: 5 days of observed history at the previous scan, 6 at this one. The score rises as the window fills, whether or not the server changes.

Diagnostics

Diagnostic detail from the automated scan of this channel: what the scanner observed at each step, so you can see exactly where a check passed or failed. It is informational only and never changes the trust score.

Captured 5 Nov 2026 · Analysed pypi/mpesa-daraja-mcp@0.1.6

Provenance Verified

A signed build attestation was found and verified, binding this exact artifact to the source repository it claims to come from.

Result Verified
Ecosystem pypi
Reason Verified
Discovered via Registry attestation endpoint
Source repo Mr-Macharia/mpesa-daraja-skills-and-mcp
Certificate issuer https://token.actions.githubusercontent.com
Certificate SAN https://github.com/Mr-Macharia/mpesa-daraja-skills-and-mcp/.github/workflows/release.yml@refs/tags/v0.1.6
Rekor log index 3556188529
Predicate type PyPI publish attestation https://docs.pypi.org/attestations/publish/v1
Subject digest sha256:bbf79d1ea4f06c9cb1f5df45115b0db84eb7d3b3ffe0327784a07d434044c824

Background: How many MCP packages publish verified provenance →

Install scripts 1 script
Hook Tier Command
build_backend allowlisted hatchling.build

Background: Why install scripts are a supply-chain risk →

Dependencies 45 packages
Packages resolved 45
Stale 3
No linked repository 1
Tree resolution Complete

Background: SBOMs and build attestations, explained →

MCP tools · 24 exposed · ~1,986 tokens

The tools this component advertises to a client, with an estimated token cost for each. Expand a tool to see its parameters and schema. The per-tool counts are indicative and are not scored directly; the schema's total context footprint is one signal in Schema Quality & AI Usability. A tool's description is untrusted text the model reads on every call, which is what makes this list a security surface and not just an inventory: how tool poisoning works →

Tool Tokens
mpesa_account_balance ~46

Request shortcode balances. The parsed balances arrive via mpesa_get_result using the returned ID.

NameTypeReqDescription
party_a–––
result_url–––
timeout_url–––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_b2b_express_checkout ~94

Push a USSD prompt to a merchant's till operator to pay your Paybill (B2B Express Checkout).

NameTypeReqDescription
amountintegeryes–
callback_url–––
idempotency_keystringyes–
merchant_tillstringyes–
partner_namestringyes–
payment_refstringyes–
vendor_paybillstringyes–
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_b2b_payment ~154

Pay a business: BusinessPayBill (Paybill + account), BusinessBuyGoods (Till), BusinessPayToBulk (B2C utility top-up) or PayTaxToKRA (receiver 572572, account_reference = KRA PRN). idempotency_key is required except for PayTaxToKRA, where the PRN is the key.

NameTypeReqDescription
account_referencestringyes–
amountintegeryes–
commandstring––
idempotency_key–––
party_a–––
receiver_shortcodestringyes–
remarksstring––
requester_phone–––
result_url–––
timeout_url–––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_b2c_payment ~151

Pay a customer wallet (or Pochi la Biashara with BusinessPayToPochi). idempotency_key is required (e.g. 'refund-order-1042'): repeating it never pays twice. For a refund, pass refund_of = the original M-Pesa receipt (e.g. 'NLJ7RT61SV').

NameTypeReqDescription
amountintegeryes–
commandstring––
idempotency_keystringyes–
occasionstring––
party_a–––
phonestringyes–
refund_of–––
remarksstringyes–
result_url–––
timeout_url–––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_bill_manager_cancel_invoice ~37

Cancel an unpaid Bill Manager invoice (partially/fully paid invoices cannot be cancelled).

NameTypeReqDescription
external_referencestringyes–

No output schema declared.

No examples provided.

mpesa_bill_manager_optin ~64

Onboard the shortcode to M-Pesa Bill Manager (required once before sending invoices). Returns an app_key.

NameTypeReqDescription
callback_url–––
emailstringyes–
official_contactstringyes–
send_remindersboolean––

No output schema declared.

No examples provided.

mpesa_bill_manager_send_invoice ~119

Send one Bill Manager e-invoice by SMS. billed_period like 'August 2026', due_date 'YYYY-MM-DD', items: [{'itemName': ..., 'amount': ...}].

NameTypeReqDescription
account_referencestringyes–
amountintegeryes–
billed_periodstringyes–
due_datestringyes–
external_referencestringyes–
full_namestringyes–
invoice_namestringyes–
items–––
phonestringyes–

No output schema declared.

No examples provided.

mpesa_c2b_register_urls ~65

Register C2B Confirmation and Validation URLs for a Paybill/Till. In production this is effectively one-time.

NameTypeReqDescription
confirmation_urlstringyes–
response_typestring––
shortcode–––
validation_urlstringyes–

No output schema declared.

No examples provided.

mpesa_c2b_simulate ~63

Simulate a customer C2B payment (SANDBOX ONLY). Register URLs first.

NameTypeReqDescription
amountintegeryes–
bill_ref–––
commandstring––
phonestring––
shortcode–––

No output schema declared.

No examples provided.

mpesa_check_credentials ~29

Verify the configured consumer key/secret by fetching an OAuth token. Never returns the token itself.

Input schema present but exposes no named parameters.

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_explain_code ~64

Explain a Daraja errorCode (e.g. 400.002.02, 500.001.1001) or ResultCode (e.g. 1032, 2001, C2B00012).

NameTypeReqDescription
codestringyes–

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_generate_dynamic_qr ~127

Generate an M-Pesa Dynamic QR and save it as a PNG; returns the file path (not the image, to save context). trx_code: BG Buy Goods, PB Paybill, WA agent withdraw, SM send money, SB send to business. cpi = till/paybill/phone.

NameTypeReqDescription
amountintegeryes–
cpistringyes–
include_base64boolean––
merchant_namestringyes–
ref_nostringyes–
sizeinteger––
trx_codestring––

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_generate_stk_password ~55

Build the STK Push Password = base64(shortcode + passkey + timestamp) with an EAT timestamp.

NameTypeReqDescription
passkeystringyes–
shortcodestringyes–
timestamp–––

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_get_result ~76

Final status of a request by idempotency_key or any Daraja ID (CheckoutRequestID, ConversationID...). Reads callbacks captured by the built-in receiver. For STK requests with no callback yet, refresh=True asks Daraja via STK Query.

NameTypeReqDescription
idstringyes–
refreshboolean––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_normalize_phone ~44

Convert a Kenyan phone number (07.., +254.., 7..) into Daraja's 2547XXXXXXXX format.

NameTypeReqDescription
phonestringyes–

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_parse_callback ~48

Parse any Daraja callback (STK, C2B, Result envelopes, Ratiba, B2B Express, Bill Manager) into flat fields.

NameTypeReqDescription
payloadobjectyes–

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_pull_transactions ~73

Fetch C2B transactions for a window ('YYYY-MM-DD HH:MM:SS') via Pull Transactions. Recovers missed confirmations. Production only, for shortcodes registered for Pull.

NameTypeReqDescription
endstringyes–
offsetinteger––
shortcode–––
startstringyes–

No output schema declared.

No examples provided.

mpesa_ratiba_create_standing_order ~153

Create an M-Pesa Ratiba standing order (the customer consents with their PIN). One order per phone + name. Dates YYYYMMDD. frequency: 1 one-off, 2 daily, 3 weekly, 4 monthly, 5 bi-monthly, 6 quarterly, 7 half-year, 8 yearly.

NameTypeReqDescription
account_referencestringyes–
amountintegeryes–
callback_url–––
descriptionstring––
end_datestringyes–
frequencystringyes–
namestringyes–
phonestringyes–
start_datestringyes–
tillboolean––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_reverse_transaction ~90

Reverse a C2B payment received on your shortcode (needs a human-approved reason). transaction_id is the original M-Pesa receipt. One reversal per transaction_id: repeats return the stored request.

NameTypeReqDescription
amountintegeryes–
receiver_shortcode–––
remarksstringyes–
result_url–––
timeout_url–––
transaction_idstringyes–
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_setup_status ~48

Show what is configured (names and sources only, never values), what each toolset is missing, and how the user can fix it. Call this first when a tool reports missing configuration.

Input schema present but exposes no named parameters.

Structured output declared, but exposes no named fields.

No examples provided.

mpesa_stk_push ~145

Send an M-Pesa Express (STK Push) PIN prompt and return immediately with status ACCEPTED. Prefer mpesa_stk_push_and_wait when the final result is needed. For Buy Goods, pass the Till as party_b (DARAJA_SHORTCODE stays the store number). Pass idempotency_key (e.g. the order ID) to prevent double prompts.

NameTypeReqDescription
account_referencestringyes–
amountintegeryes–
callback_url–––
descriptionstring––
idempotency_key–––
party_b–––
phonestringyes–
transaction_typestring––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_stk_push_and_wait ~110

Send an STK Push and wait for the final result (SUCCESS / FAILED / UNKNOWN) in one call. Uses callbacks from the built-in receiver when configured, and STK Query otherwise.

NameTypeReqDescription
account_referencestringyes–
amountintegeryes–
descriptionstring––
idempotency_key–––
party_b–––
phonestringyes–
timeout_sinteger––
transaction_typestring––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_stk_query ~42

Final status of an STK Push. status=ACCEPTED means Safaricom is still processing it.

NameTypeReqDescription
checkout_request_idstringyes–
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

mpesa_transaction_status ~89

Ask M-Pesa for the final state of a transaction by receipt or OriginatorConversationID. The answer arrives on the ResultURL; read it with mpesa_get_result using the returned ID.

NameTypeReqDescription
identifier_typestring––
original_conversation_id–––
party_a–––
result_url–––
timeout_url–––
transaction_id–––
NameTypeReqDescription
duplicateboolean––
explanationstring|null––
idempotency_keystring|null––
idsobject––
messagestringyes–
rawobject|null––
receiptstring|null––
result_codestring|null––
statusstringyes–

No examples provided.

Install

How do I install the M-Pesa Daraja MCP server?

M-Pesa Daraja runs locally as a PyPI package, launched with uvx mpesa-daraja-mcp. Ready-made configuration for Claude, Cursor, VS Code, Codex and 5 more is on this page, copied from each client's own documentation.

pypi · mpesa-daraja-mcp

# add to Claude Code
claude mcp add mr-macharia-mpesa-daraja-mcp -- uvx mpesa-daraja-mcp
Common questions

What is the M-Pesa Daraja MCP server?

M-Pesa Daraja is an MCP server listed in the public MCP registry as io.github.Mr-Macharia/mpesa-daraja-mcp. Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent. This page covers its PyPI package (mpesa-daraja-mcp).

Is the M-Pesa Daraja MCP server safe to use?

M-Pesa Daraja scores 83 out of 100 on VerifyMCP. We found no known CVEs affecting it as of 5 November 2026. Its build provenance is signed and verified. That is a record of what we were able to check automatically, not an endorsement. The category breakdown on this page shows every signal behind the number, including the ones we could not confirm.

What tools does the M-Pesa Daraja MCP server expose?

M-Pesa Daraja exposes 24 tools: mpesa_explain_code, mpesa_normalize_phone, mpesa_generate_stk_password, mpesa_parse_callback, mpesa_setup_status, and 19 more. Their descriptions and schemas cost roughly 1,986 tokens of context every time the server is loaded.

Is the M-Pesa Daraja MCP server still maintained?

M-Pesa Daraja is still listed as active in the MCP registry. We last reached this channel on 5 November 2026. Those dates come from our own scans of the registry and the channel itself, not from anything the publisher announced.

What licence is the M-Pesa Daraja MCP server under?

M-Pesa Daraja declares the MIT licence, which is OSI-approved. That covers the source only, and says nothing about the cost of any service it calls.