Skip to content

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.

SettingValue
URLhttps://api.autopayke.com/mcp
TransportStreamable HTTP (JSON responses, no session)
AuthYour API key: Authorization: Bearer apk_test_… or apk_live_…
Protocol versions2025-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.

ToolScopeDoes
get_accountaccount:readWorkspace, limits and the key's scopes.
get_balancebalance:readBalance, and what customers hold.
list_banksany keyBank codes for bank payouts.
verify_recipientrecipients:readThe name on a number or bank account.
quote_payout, get_payout, list_payoutspayouts:readFees and payout status.
create_payoutpayouts:write, test keysSend one payout. Test keys only (see below).
create_batch, cancel_batchbatches:writePay up to 500 people, optionally after approval.
get_batch, list_batch_linesbatches:readBulk payout progress.
create_collection, create_checkout_sessioncollections:writeAsk a customer to pay by M-Pesa.
get_collection, list_collections, get_checkout_sessioncollections:readWhether they paid.
create_payment_link, deactivate_payment_linkpayment_links:writeShareable payment pages.
create_refundrefunds:write, test keysSend money back to a payer. Test keys only.
list_refundsrefunds:readRefund status.
create_customer, transfer_between_customerscustomers:writeCustomer wallets and moving balance between them.
get_customer, list_customers, list_customer_transactionscustomers:readCustomer balances and history.
list_transactions, list_eventstransactions:read, events:readRecords and the event log.
sandbox_add_fundstest keys onlyPretend 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.