M-Pesa Daraja
PYPI · MPESA-DARAJA-MCP
Safaricom M-Pesa Daraja tools: STK Push, C2B, B2C, B2B, QR, Ratiba. Sandbox-first, idempotent.
Available components
Last scanned (47 minutes ago)
Scores higher than 86% of PyPI servers
Category Finance and Payments
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
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.
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 →
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 →
mpesa_account_balance ~46
Request shortcode balances. The parsed balances arrive via mpesa_get_result using the returned ID.
| Name | Type | Req | Description |
|---|---|---|---|
| party_a | – | – | – |
| result_url | – | – | – |
| timeout_url | – | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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).
| Name | Type | Req | Description |
|---|---|---|---|
| amount | integer | yes | – |
| callback_url | – | – | – |
| idempotency_key | string | yes | – |
| merchant_till | string | yes | – |
| partner_name | string | yes | – |
| payment_ref | string | yes | – |
| vendor_paybill | string | yes | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| account_reference | string | yes | – |
| amount | integer | yes | – |
| command | string | – | – |
| idempotency_key | – | – | – |
| party_a | – | – | – |
| receiver_shortcode | string | yes | – |
| remarks | string | – | – |
| requester_phone | – | – | – |
| result_url | – | – | – |
| timeout_url | – | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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').
| Name | Type | Req | Description |
|---|---|---|---|
| amount | integer | yes | – |
| command | string | – | – |
| idempotency_key | string | yes | – |
| occasion | string | – | – |
| party_a | – | – | – |
| phone | string | yes | – |
| refund_of | – | – | – |
| remarks | string | yes | – |
| result_url | – | – | – |
| timeout_url | – | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
No examples provided.
mpesa_bill_manager_cancel_invoice ~37
Cancel an unpaid Bill Manager invoice (partially/fully paid invoices cannot be cancelled).
| Name | Type | Req | Description |
|---|---|---|---|
| external_reference | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| callback_url | – | – | – |
| string | yes | – | |
| official_contact | string | yes | – |
| send_reminders | boolean | – | – |
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': ...}].
| Name | Type | Req | Description |
|---|---|---|---|
| account_reference | string | yes | – |
| amount | integer | yes | – |
| billed_period | string | yes | – |
| due_date | string | yes | – |
| external_reference | string | yes | – |
| full_name | string | yes | – |
| invoice_name | string | yes | – |
| items | – | – | – |
| phone | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| confirmation_url | string | yes | – |
| response_type | string | – | – |
| shortcode | – | – | – |
| validation_url | string | yes | – |
No output schema declared.
No examples provided.
mpesa_c2b_simulate ~63
Simulate a customer C2B payment (SANDBOX ONLY). Register URLs first.
| Name | Type | Req | Description |
|---|---|---|---|
| amount | integer | yes | – |
| bill_ref | – | – | – |
| command | string | – | – |
| phone | string | – | – |
| 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).
| Name | Type | Req | Description |
|---|---|---|---|
| code | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| amount | integer | yes | – |
| cpi | string | yes | – |
| include_base64 | boolean | – | – |
| merchant_name | string | yes | – |
| ref_no | string | yes | – |
| size | integer | – | – |
| trx_code | string | – | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| passkey | string | yes | – |
| shortcode | string | yes | – |
| 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.
| Name | Type | Req | Description |
|---|---|---|---|
| id | string | yes | – |
| refresh | boolean | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
No examples provided.
mpesa_normalize_phone ~44
Convert a Kenyan phone number (07.., +254.., 7..) into Daraja's 2547XXXXXXXX format.
| Name | Type | Req | Description |
|---|---|---|---|
| phone | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| payload | object | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| end | string | yes | – |
| offset | integer | – | – |
| shortcode | – | – | – |
| start | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| account_reference | string | yes | – |
| amount | integer | yes | – |
| callback_url | – | – | – |
| description | string | – | – |
| end_date | string | yes | – |
| frequency | string | yes | – |
| name | string | yes | – |
| phone | string | yes | – |
| start_date | string | yes | – |
| till | boolean | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| amount | integer | yes | – |
| receiver_shortcode | – | – | – |
| remarks | string | yes | – |
| result_url | – | – | – |
| timeout_url | – | – | – |
| transaction_id | string | yes | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| account_reference | string | yes | – |
| amount | integer | yes | – |
| callback_url | – | – | – |
| description | string | – | – |
| idempotency_key | – | – | – |
| party_b | – | – | – |
| phone | string | yes | – |
| transaction_type | string | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| account_reference | string | yes | – |
| amount | integer | yes | – |
| description | string | – | – |
| idempotency_key | – | – | – |
| party_b | – | – | – |
| phone | string | yes | – |
| timeout_s | integer | – | – |
| transaction_type | string | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
No examples provided.
mpesa_stk_query ~42
Final status of an STK Push. status=ACCEPTED means Safaricom is still processing it.
| Name | Type | Req | Description |
|---|---|---|---|
| checkout_request_id | string | yes | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
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.
| Name | Type | Req | Description |
|---|---|---|---|
| identifier_type | string | – | – |
| original_conversation_id | – | – | – |
| party_a | – | – | – |
| result_url | – | – | – |
| timeout_url | – | – | – |
| transaction_id | – | – | – |
| Name | Type | Req | Description |
|---|---|---|---|
| duplicate | boolean | – | – |
| explanation | string|null | – | – |
| idempotency_key | string|null | – | – |
| ids | object | – | – |
| message | string | yes | – |
| raw | object|null | – | – |
| receipt | string|null | – | – |
| result_code | string|null | – | – |
| status | string | yes | – |
No examples provided.
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
claude mcp add mr-macharia-mpesa-daraja-mcp -- uvx mpesa-daraja-mcp
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.