mpesa-daraja-mcp@r1
CAUTION· install onlyPublisher claims: "Enables AI agents to call Safaricom's M-Pesa Daraja API directly, sending STK push prompts, checking balances, looking up or reversing transactions, and receiving results as SUCCESS, FAILED, or UNKNOWN. Requests are sent once per idempotency key with sandbox-by-default operation, so agents can operate and test payments without risking double charges or real money." Observed in sandbox: no network, touches nothing outside the project, writes no memory.
Coverage
Nothing executable in the bundle ran; the trace covers the install step only.- Tested
- every file read, file written and host contacted by what ran
- Not tested
- use of the skill by an agent
What this means for the label: Caution here covers what ran. The server's tools were not exercised with a real credential, so nothing about their behavior is asserted; the credential summary below says what to do with that.
Before you give it your token
- It will ask for
DARAJA_CALLBACK_TOKENDARAJA_CONSUMER_SECRETDARAJA_FORWARD_SECRETDARAJA_INITIATOR_PASSWORDDARAJA_MCP_TOKENConfiguration, not credentials: DARAJA_ALLOWED_RECIPIENTS, DARAJA_APPROVAL_THRESHOLD, DARAJA_CALLBACK_BASE_URL, DARAJA_CALLBACK_LISTEN, DARAJA_CONFIG_DIR, DARAJA_CONSUMER_KEY, DARAJA_DOTENV, DARAJA_ENV, DARAJA_FORWARD_URL, DARAJA_OUTPUT_DIR, DARAJA_READ_ONLY, DARAJA_STATE_DB, DARAJA_TOOLSETS, MPESA_SALES_LOG- Where it talks to
- no vendor host named in the codeAlso safaricom.co.ke — not the publisher's domain; check what for before connecting.
- What the honeypot saw
- no credential files read · no network
- What we could not test
- use of the skill by an agent
Connect it with a scoped credential, under the guard, and read the third-party hosts first. The code names safaricom.co.ke as well as its own vendor. The guard injects DARAJA_CALLBACK_TOKEN, DARAJA_CONSUMER_SECRET, DARAJA_FORWARD_SECRET, DARAJA_INITIATOR_PASSWORD, DARAJA_MCP_TOKEN only into requests to the host you bind (and its subdomains) and refuses the rest.
Never paste a credential into a chat, a ticket or a report, including ours. How the guard holds it.
Is mpesa-daraja-mcp@r1 safe to install?
KillerSkills ran it in the KillerSkills honeypot sandbox (1 scenario; nothing executable in the bundle ran; the trace covers the install step only) on 2026-11-13 and scored it 62/100 (Caution). It is not known to be malicious, but it has behaviour or code a security policy should decide on before install. Notable findings: Rule modification attempt; Access to sensitive file paths; Access to sensitive file paths. Summary: no network, touches nothing outside the project, writes no memory.
Behavior trace
Honeypot run · 0 s · 1 scenarios · 0 deviationsStatic findings
**Rule #1: never mark money as moved based on the synchronous response.** Only the callback, `stk_query` or `transaction_status` can confirm it.Fix: Remove the text that addresses the agent rather than the reader; describe behavior, do not instruct.encrypted = subprocess.run(Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.pem = subprocess.run(["openssl", "x509", "-inform", fmt, "-in", cert_path],Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.2. A project `.env` in the directory the client starts the server inFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.res = subprocess.run(cmd, capture_output=True, text=True, timeout=60)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.Add `.env` to `.gitignore`, and commit a `.env.example` with no values. The same variables configure the repo's MCP server.Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.…e initiator password with Safaricom's sandbox or production certificate. Covers .env files versus secret managers, fail-fast config, log masking, rotation and leak …Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.pattern = re.compile(r"https://[a-z0-9-]+\.trycloudflare\.com")Fix: Replace encoded or assembled strings with plain literals and remove undeclared network calls.env_file = directory / ".env"Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.return Path(os.environ["DARAJA_DOTENV"]) if os.environ.get("DARAJA_DOTENV") else Path.cwd() / ".env"Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.2. **Development**: a `.env` file plus `python-dotenv`/`dotenv`. The file is in `.gitignore`, has `chmod 600`, and a `.env.example` without values is committed.Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.3. Copy the **Consumer Key** and **Consumer Secret** into `.env`.Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.directory: Annotated[Path, typer.Option("--dir", help="Where to write docker-compose.yml and .env.")] = Path("mpesa-server"),Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.…t (Codex, Cursor, Copilot, Gemini CLI, Claude Code, Windsurf, Cline, …)**: run `npx skills add Mr-Macharia/mpesa-daraja-skills-and-mcp`. Add `-a <agent>` to target one ag…Fix: Pin versions and sources; vendor anything fetched at install time.2. **Configuration:** `DARAJA_*` in `.env`. With the MCP server connected, call `mpesa_setup_status`, which shows what is missing without showing values.Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.<summary><b>My agent says "Connection closed".</b></summary> <br> Run <code>uvx mpesa-daraja-mcp status</code>. It lists missing settings and re-tests your keysFix: Remove the text that addresses the agent rather than the reader; describe behavior, do not instruct."""Self-host with Docker: writes a compose file and .env from your config, then starts it."""Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.<summary><b>Add the server to one agent by hand</b></summary> <br> No keys go in these commands; the server reads them from its config file. | Agent | Command |Fix: Remove the text that addresses the agent rather than the reader; describe behavior, do not instruct.res = subprocess.run(["docker", "compose", "up", "-d"], cwd=directory)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.…ing test credentials (shortcodes, passkey, initiator, certificate), writing the .env file, exposing callbacks through a tunnel, smoke testing each API, and running …Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.- `mpesa_setup_status` (MCP) or `.env`: are `DARAJA_INITIATOR_NAME` and `DARAJA_SECURITY_CREDENTIAL` set?Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.env_file: .envFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.pub = subprocess.run(["openssl", "x509", "-pubkey", "-noout"], input=pem,Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.Node.js uses the same idea: `Buffer.from(`${key}:${secret}`).toString("base64")`, then `fetch(url, { headers: { Authorization: `Basic ${auth}` } })`.Fix: Put hosts, commands and strings in plain source. Decoding at runtime looks identical to malware and costs points on its own.2. **Development**: a `.env` file plus `python-dotenv`/`dotenv`. The file is in `.gitignore`, has `chmod 600`, and a `.env.example` without values is committed.Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.## 3. `.env` templateFix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.raise typer.Exit(subprocess.run(cmd).returncode)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out."(or a project .env), then restart the MCP server."Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.subprocess.run(cmd, capture_output=True, text=True, timeout=60)Fix: Build commands from fixed arguments, never from interpolated strings; prefer an API client over shelling out.| Keys and passkey | `.env` / secret store, never in code |Fix: Stop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.Cost to the agent
Tokens estimated at four characters each. Skills load their instruction text when triggered; the figure is what that costs.
Known vulnerabilities
Vulnerability advisories (OSV) cover npm and PyPI packages; this registry has no advisory database.
What would make this Verified
18 points to 80 · weights: behavior 45%, static 25%, prompt 15%, publisher 15%- Unclaimed publisher≈ +8 on the totalClaim mr-macharia: a verified publisher gets +50 on publisher trust. It is free and usually instant with GitHub sign-in.
- Hidden instructions≈ +6 on the totalRemove HTML comments, zero-width characters and white-on-white text that carry instructions. Everything the agent is meant to read should be visible to the person reading the file.
- Obfuscated code≈ +5 on the totalRemove base64-assembled strings, eval of decoded text and minified blobs. Reviewers and scanners both treat unreadable code as hostile.
- Access to sensitive file paths≈ +4 on the totalStop enumerating or reading credential locations; take secrets from a declared environment variable the user sets on purpose.
- Tunneling service URL≈ +4 on the totalReplace encoded or assembled strings with plain literals and remove undeclared network calls.
- Host or code assembled from base64 fragments≈ +4 on the totalPut hosts, commands and strings in plain source. Decoding at runtime looks identical to malware and costs points on its own.