MCP server
Connect Claude, Cursor or ChatGPT to AutoPayKe: payouts, M-Pesa collections, payment links and refunds as tools.
AutoPayKe runs an MCP server, so AI agents like Claude, Cursor and ChatGPT can send payouts, request M-Pesa payments, create payment links, refund customers and look up records, with your API key. Nothing to install or host.
| Setting | Value |
|---|---|
| URL | https://api.autopayke.com/mcp |
| Transport | Streamable HTTP (JSON responses, no session) |
| Auth | Your API key: Authorization: Bearer apk_test_… or apk_live_… |
| Protocol versions | 2025-06-18, 2025-03-26, 2024-11-05 |
Connecting
Claude Code:
terminal
claude mcp add --transport http autopayke https://api.autopayke.com/mcp \
--header "Authorization: Bearer apk_test_..."Cursor, Windsurf and other clients that take a URL and headers:
mcp.json
{
"mcpServers": {
"autopayke": {
"url": "https://api.autopayke.com/mcp",
"headers": { "Authorization": "Bearer apk_test_..." }
}
}
}Claude Desktop and clients that only run local servers can bridge to it with mcp-remote:
claude_desktop_config.json
{
"mcpServers": {
"autopayke": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.autopayke.com/mcp",
"--header", "Authorization: Bearer ${AUTOPAYKE_API_KEY}"],
"env": { "AUTOPAYKE_API_KEY": "apk_test_..." }
}
}
}Start with a test key (
apk_test_). The agent gets a sandbox_add_funds tool, and the sandbox numbers let it try every outcome without real money.Tools
The agent only sees the tools its key's scopes allow. A key with just payouts:read gets read-only tools; it never sees create_payout.
| Tool | Scope | Does |
|---|---|---|
get_account | account:read | Workspace, limits and the key's scopes. |
get_balance | balance:read | Balance, and what customers hold. |
list_banks | any key | Bank codes for bank payouts. |
verify_recipient | recipients:read | The name on a number or bank account. |
quote_payout, get_payout, list_payouts | payouts:read | Fees and payout status. |
create_payout | payouts:write, test keys | Send one payout. Test keys only (see below). |
create_batch, cancel_batch | batches:write | Pay up to 500 people, optionally after approval. |
get_batch, list_batch_lines | batches:read | Bulk payout progress. |
create_collection, create_checkout_session | collections:write | Ask a customer to pay by M-Pesa. |
get_collection, list_collections, get_checkout_session | collections:read | Whether they paid. |
create_payment_link, deactivate_payment_link | payment_links:write | Shareable payment pages. |
create_refund | refunds:write, test keys | Send money back to a payer. Test keys only. |
list_refunds | refunds:read | Refund status. |
create_customer, transfer_between_customers | customers:write | Customer wallets and moving balance between them. |
get_customer, list_customers, list_customer_transactions | customers:read | Customer balances and history. |
list_transactions, list_events | transactions:read, events:read | Records and the event log. |
sandbox_add_funds | test keys only | Pretend money for testing. |
How it stays safe
- Every tool call is a normal API request with your key: scopes, IP allowlist, limits, kill switches and rate limits all apply, and it shows in the Console's Logs.
- Tools that move money need an
idempotency_key, so a repeated call returns the first result instead of paying twice. They're marked as destructive, so clients like Claude ask before running them. - With a live key, an agent can't send a single payout or a refund. Real money out only goes through
create_batch, and every live batch waits for an owner or admin to approve it in the Console with their PIN. An agent can prepare payments; a person releases the money. - Give an agent its own key with only the scopes it needs.
- Revoke the key in the Console to cut the agent off at once.
An agent can be talked into things by text it reads (an email, a web page, a document). Keep live keys narrow, and read Letting an agent send money before you give one a live key.