Introduction
What the M-Pesa Daraja Agent Kit is, its two halves, and where to start.
The M-Pesa Daraja Agent Kit gives AI agents two things: Agent Skills that teach them to use Safaricom's Daraja API correctly, and an MCP server that lets them call Daraja safely. It works with Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and any agent that supports Agent Skills or MCP.
The two halves
| Half | What your agent does | Install |
|---|---|---|
| Skills | Writes M-Pesa code for your app: STK checkout, B2C payouts, callback handlers | npx skills add Mr-Macharia/mpesa-daraja-skills-and-mcp |
| MCP server | Calls Daraja for you and reports SUCCESS, FAILED or UNKNOWN | uvx mpesa-daraja-mcp init |
The halves are independent. Use one, or use both so the agent can build an integration and try it live in the same conversation.
The one rule to remember
Accepted is not paid
When Daraja answers a payment request with ResponseCode: 0, it has only accepted the request. The money has not moved yet. Only a callback or a status query can tell you the payment succeeded.
Try it
Send KES 1 to 254708374149 in the sandbox for order TEST-01 and wait for the result.What you need
- A free Daraja developer account and a sandbox app, for its Consumer Key and Secret.
- Node.js 22.20 or later for the skills, and uv for the MCP server.