daraja-callbacks SKILL.md skillA
daraja-callbacks from mr-macharia/mpesa-daraja-skills-and-mcp is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add mr-macharia/mpesa-daraja-skills-and-mcp/daraja-callbacks@git:20261021.84f51bcPins git:20261021.84f51bc in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- mr-macharia/mpesa-daraja-skills-and-mcp
- Path
skills/daraja-callbacks/SKILL.md- Versions recorded
- 5
- Latest version
- git:20261021.84f51bc, committed Oct 21, 2026
- First version recorded
- Oct 19, 2026
- Size
- 5,096 bytes
- Repository stars
- 3
- License
- MIT
Builds resilient Safaricom Daraja callback and webhook receivers: STK CallBackURL; C2B Validation and Confirmation; ResultURL and QueueTimeOutURL for B2C, B2B, tax, status, reversal and balance; Ratiba, Bill Manager and B2B Express callbacks. Covers fast acknowledgment, async processing, idempotency, payload parsing, endpoint security and the "callback never arrived" checklist. Use when writing or debugging any endpoint that M-Pesa posts results to.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Daraja callback receivers
The synchronous reply only means "accepted". **The callback carries the outcome.**
- Most callbacks are fire-and-forget with few or no retries. Bill Manager retries up to 5 times.
- A dropped callback means a lost result unless you query it (see `daraja-account-ops`).
## Endpoint requirements
- **Public HTTPS** with a CA-signed certificate (TLS 1.2+). No self-signed certificates, no redirects, no localhost or private IPs.
- **Fast response**: return HTTP 200 within a few seconds. C2B validation is the tightest. Do the heavy work asynchronously.
- **Authentication**: Safaricom sends no auth headers. Defend the endpoint in three ways:
- Put an unguessable token in the path (`/callbacks/stk/<random>`).
- Optionally allow-list Safaricom's callback IPs at the firewall.
- **Verify** every callback against your stored request (ID, amount, phone). For high-value transactions, re-confirm with a status query.
## Pattern: store raw → acknowledge → process asynchronously → idempotent update
```python
@app.post("/callbacks/<kind>/<token>")
def callback(kind, token):
if not hmac.compare_digest(token, CALLBACK_TOKEN):
…Read the whole file at its exact version.
How to install
mdr add mr-macharia/mpesa-daraja-skills-and-mcp/daraja-callbacks@sha256:1b22515aa57f67edThe line at the top of this page pins the label git:20261021.84f51bc, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_jdx5fypbnt3y4amv)
1 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 5 versions of this file, between Oct 19, 2026 and Oct 21, 2026, more than one a day.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261021.84f51bc latest | 2026-10-21 | 84f51bc | 5,096 B | A | view · diff |
| git:20261020.f2e8fad | 2026-10-20 | f2e8fad | 5,094 B | A | view · diff |
| git:20261020.7cb1e56 | 2026-10-20 | 7cb1e56 | 5,106 B | A | view · diff |
| git:20261020.73bacfc | 2026-10-20 | 73bacfc | 5,102 B | A | view · diff |
| git:20261019.9e3c915 | 2026-10-19 | 9e3c915 | 4,816 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (5096 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
mr-macharia/mpesa-daraja-skills-and-mcp · 3 stars · license MIT · pushed 2026-11-03 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_jdx5fypbnt3y4amv GET https://markdownregistry.com/api/v1/resolve?ref=mr-macharia/mpesa-daraja-skills-and-mcp/daraja-callbacks GET https://markdownregistry.com/api/v1/blob/1b22515aa57f67edf3faa00d73757e3a46ce8a885d0e84ac555f0e1adbb7a783
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.