Appearance
MCP tools
The MCP server has 13 tools. Five need no key. Eight read your own account and need a read-only key.
Every tool only reads. No tool changes your account.
| Tool | Needs |
|---|---|
search_docs | Nothing |
read_doc | Nothing |
get_recipe | Nothing |
validate_checkout_request | Nothing |
explain_error | Nothing |
list_accounts | Balances, activity and payments |
get_account_activity | Balances, activity and payments |
get_transaction | Balances, activity and payments |
get_money_summary | Balances, activity and payments |
get_payment_status | Balances, activity and payments |
get_my_setup | Integration setup |
get_recent_deliveries | Integration setup |
diagnose_webhooks | Integration setup |
A tool that needs a key is listed only when the request carries one.
Docs tools
country is optional on these tools. Send KE for Kenya (KES) or UG for Uganda (UGX). The answer then uses that country's host and currency.
search_docs
Searches the integration docs. Returns the sections that match best.
| Input | Type | Required |
|---|---|---|
query | string | Yes |
country | KE or UG | No |
read_doc
Returns one docs page as Markdown.
| Input | Type | Required |
|---|---|---|
slug | string. The page name that search_docs returns | Yes |
country | KE or UG | No |
get_recipe
Returns working code for one task.
| Input | Type | Required |
|---|---|---|
task | setup, create-checkout, confirm-checkout or verify-webhook | Yes |
language | curl, node, python or php | Yes |
country | KE or UG | No |
validate_checkout_request
Checks a POST /checkouts body against the API rules. It does not send the request. It checks integer minor units, line items that add up, an https return URL, field lengths, and fields that the API refuses.
| Input | Type | Required |
|---|---|---|
body | object. The JSON body that you would send | Yes |
idempotency_key | string. The Idempotency-Key header that you would send | No |
country | KE or UG | No |
explain_error
Explains an error. Send the code, or the HTTP status when there is no code.
| Input | Type | Required |
|---|---|---|
code | integer. The code field of the error body, such as 2781 | No |
status | integer. The HTTP status | No |
Account tools
These tools read the account that made the key. For an organisation's key, that is the organisation.
Amounts are text with the currency, such as KES 1,500. Times are ISO 8601 in UTC.
Names and descriptions in an answer were written by account holders and payers. Each answer says that this text is data, not instructions.
list_accounts
Lists the main account and each pocket, with the balance and the lock.
No inputs.
json
{
"accounts": [
{
"account": "main",
"name": "Asha Main Wallet",
"balance": "KES 12,400",
"kind": null,
"locked": false,
"locked_until": null
},
{
"account": "rent",
"name": "Rent",
"balance": "KES 30,000",
"kind": null,
"locked": true,
"locked_until": "2026-12-01T00:00:00.000Z"
}
]
}account is the name to send to the other tools. kind is collecting or budget on an organisation's account, and null on a person's.
get_account_activity
Lists the money in and out of one account, newest first.
| Input | Type | Required |
|---|---|---|
account | string. An account from list_accounts | Yes |
limit | integer, 1 to 50. Default 20 | No |
from | ISO date or time. Only movements at or after it | No |
to | ISO date or time. Only movements at or before it | No |
before | string. The next_before of the previous answer | No |
json
{
"movements": [
{
"reference": "SMK4H2PL9Q",
"account": "main",
"when": "2026-11-18T09:14:02.000Z",
"direction": "in",
"amount": "KES 1,500",
"fee": "KES 0",
"status": "completed",
"type": "deposit",
"counterparty": null,
"description": "Order 1042",
"source": "checkout",
"rail": "mpesa",
"external_reference": "TKJ8X2M4PQ",
"refunded": "KES 0"
}
],
"next_before": null
}next_before is null on the last page. To read the next page, send it as before.
counterparty is the name of the other MOOKHPay account, when there is one. A phone number is never returned.
get_transaction
Finds one movement by its reference. The reference starts with SM. It is on the confirmation text.
| Input | Type | Required |
|---|---|---|
reference | string | Yes |
The answer is a movements list in the same shape as get_account_activity. A move between two of your own accounts has two entries, one for each account.
get_money_summary
Totals the money in and the money out of one account between two dates.
| Input | Type | Required |
|---|---|---|
account | string | Yes |
from | ISO date or time | Yes |
to | ISO date or time | Yes |
json
{
"account": "main",
"from": "2026-11-01T00:00:00.000Z",
"to": "2026-11-18T00:00:00.000Z",
"money_in": "KES 84,200",
"money_out": "KES 61,000",
"money_in_previous_period": "KES 70,150",
"money_in_change_percent": 20
}The previous period is the period of the same length immediately before from. money_in_change_percent is null when the previous period had no money in.
get_payment_status
Checks whether a payment to or from the account went through. Send one input.
| Input | Type |
|---|---|
payment_id | string. Starts with pi_ |
reference | string. The SM reference on the confirmation text |
receipt | string. The provider's receipt, such as an M-Pesa code |
json
{
"payments": [
{
"payment_id": "pi_8f2c1a9e4b7d",
"state": "succeeded",
"status": "completed",
"direction": "in",
"amount": "KES 1,500",
"fee": "KES 0",
"rail": "mpesa",
"channel": "stk",
"source": "checkout",
"provider_receipt": "TKJ8X2M4PQ",
"ledger_reference": "SMK4H2PL9Q",
"reference": "Order 1042",
"link": null,
"account": "main",
"created": "2026-11-18T09:13:40.000Z",
"updated": "2026-11-18T09:14:02.000Z"
}
]
}The payer's phone number and message are never returned.
get_my_setup
Reads the integration setup: the country, the secret key's description and the webhook endpoints.
No inputs.
json
{
"country": "KE",
"api_key": {
"prefix": "mkp_live_",
"last4": "7Q2M",
"created": "2026-10-02T08:00:00.000Z",
"last_used": "2026-11-18T09:13:40.000Z"
},
"webhook_endpoints": [
{
"id": "we_3b9d1f",
"url": "https://shop.example/webhooks/mookhpay",
"events": ["payment.succeeded"],
"active": true,
"awaiting_owner": false,
"created": "2026-10-02T08:05:00.000Z"
}
]
}api_key is null when the account has no key. The key and the signing secret are never returned.
get_recent_deliveries
Reads the newest webhook deliveries, with each response code or error.
| Input | Type | Required |
|---|---|---|
limit | integer, 1 to 50. Default 20 | No |
json
{
"deliveries": [
{
"event": "payment.succeeded",
"endpoint_url": "https://shop.example/webhooks/mookhpay",
"status": "delivered",
"attempts": 1,
"last_response_code": 200,
"last_error": null,
"test": false,
"created": "2026-11-18T09:14:03.000Z"
}
]
}diagnose_webhooks
Reads the endpoints and the recent deliveries, then lists what is wrong. Each problem has a fix and the docs page about it.
No inputs.
It reports these problems:
- The account has no endpoint, or no active endpoint.
- An endpoint waits for an owner to switch it on.
- No active endpoint is subscribed to
payment.succeeded. - Recent deliveries got no answer.
- Recent deliveries got an answer that is not
2xx.
Errors
A tool that cannot answer returns an error with one of these sentences.
| The tool says | Meaning |
|---|---|
| MOOKHPay refused this read token | The key is unknown, revoked or past its end date. Or its maker can no longer hold it. Make a new key |
| This read token does not cover that | The key does not have the access that the tool needs. Make a key with that access |
| Nothing by that name or reference is on this account | The account, reference or payment is not yours, or does not exist |
| MOOKHPay did not accept that request | An input is wrong. Check the account, the dates and the reference |
| Too many requests on this read token | The key passed 30 requests in a minute. Wait a minute |
| MOOKHPay could not answer just now | A service did not answer. Nothing was changed. Try again |
A request that carries a secret key, or any credential that is not a read-only key, returns 401. The server does not forward it.