Quick start
Install the skills and the MCP server, then run your first sandbox payment.
Let your agent install it
Paste this into Claude Code, Codex, Cursor, Gemini CLI or any coding agent:
Install the M-Pesa Daraja Agent Kit for me:
1. Install the Agent Skills for yourself: npx skills add Mr-Macharia/mpesa-daraja-skills-and-mcp -a <your agent id>
(agent ids: claude-code, codex, cursor, github-copilot, gemini-cli). Use -g if I want them in every project.
2. Add the MCP server to yourself, named "mpesa", with the command: uvx mpesa-daraja-mcp
It needs no keys in your config. If uv is missing, tell me how to install it first.
3. Don't ask me for my Daraja keys. Tell me to run `uvx mpesa-daraja-mcp init` in my own terminal,
which saves them privately, then to restart you.
4. After I restart you, call mpesa_check_credentials and tell me if everything works.Your agent installs both halves. You type your Daraja keys only into the setup wizard, never into the chat.
Claude Code: one plugin for both
The plugin installs all 22 skills and the MCP server in one step. The server runs through uv, so install that first and make sure uvx is on the PATH Claude Code sees.
/plugin install mpesa-daraja-skills --marketplace Mr-Macharia/mpesa-daraja-skills-and-mcpThen run uvx mpesa-daraja-mcp init once in a terminal to save your keys. When it offers to add the server to Claude Code, answer n: the plugin already did. Restart Claude Code.
Or install it yourself
1. Install the skills
Needs Node.js 22.20 or later.
npx skills add Mr-Macharia/mpesa-daraja-skills-and-mcp2. Install the MCP server
Needs uv.
uvx mpesa-daraja-mcp initThe wizard asks for your Daraja keys (secrets are typed hidden), checks them live with Safaricom, saves them to a file only you can read, and registers the server with Claude Code, Codex, Gemini CLI or Cursor. Restart your agent when it's done.
To add the server to one agent by hand instead, see Agent setup.
Try it
Ask your agent:
Check my M-Pesa credentials, then send a KES 1 STK push to 07XXXXXXXX and tell me when it's paid.The agent calls mpesa_check_credentials, then mpesa_stk_push_and_wait, and answers with one of three results:
| Result | Meaning |
|---|---|
SUCCESS | Paid. Includes the M-Pesa receipt number |
FAILED | Not paid, with the reason, for example 1032: the customer cancelled |
UNKNOWN | Not known yet, with what to check next. Never retried blindly |
Everything starts in the sandbox. No real money moves until you opt in.