MCP for AI clients
Connect Cursor, Claude Desktop, or other MCP clients to the lomi. merchant API.
The Model Context Protocol (MCP) lets AI assistants (Cursor, Claude Desktop, custom agents) call the lomi. merchant API for you: create checkouts, list payments, debug webhooks, without writing every HTTP request by hand. Most teams use the hosted server at https://mcp.lomi.africa or local stdio with npx @lomi./mcp. Access is scoped to your organization, the same as your API key.
Connect
Recommended: add the hosted MCP URL with no API key. OAuth-capable clients open Connect with lomi. in the browser, you sign in on the dashboard, and the client stores a scoped token (lomi_oat_*).
Two entry points, one product:
- You have a lomi. account (or want one): use the one-click buttons below. The consent page signs in or signs up, then returns to approve access.
- Agent with no account yet: connect
https://mcp.lomi.africa/mcp/guest, calllomi_register_agent, thenlomi_provision. Onceapi_keysreturns a test key, the same session gains the merchant tools. See Sandbox agent bootstrap.
Revoke a connected app from Developers → API keys → Connect MCP → Connected apps.
Getting started
- Click Add to Cursor, Add to Grok Bot, Add to Claude, or Add to VS Code above (or paste the URL-only JSON below). OpenCode and Codex stay under the CLI sections.
- On first connect the client receives a
401, fetcheshttps://mcp.lomi.africa/.well-known/oauth-protected-resource/mcp, and opens Connect with lomi. - Sign in to the dashboard, choose your organization, and approve access (read-only by default).
- The client can call MCP tools immediately.
More templates live in the repo: apps/mcp/examples/ (cursor-http-oauth.mcp.json, claude-desktop-http-oauth.mcp.json, plus API-key variants).
You can also start from the dashboard: Settings → Connectors, then Developers → API keys → Connect MCP.
Gmail, Calendar, Sheets, Drive, Slack, and the other apps you connect for the assistant are a separate list. See Connected apps.
Authentication
OAuth (recommended)
OAuth-capable MCP clients (Cursor, Claude Desktop, VS Code, OpenCode, Codex, and others) connect without pasting a secret key.
- Discover the resource server at
GET https://mcp.lomi.africa/.well-known/oauth-protected-resource/mcp(also returned in theWWW-Authenticatechallenge when connecting without credentials). - Register (optional DCR) at
POST https://api.lomi.africa/oauth/register. - Open
GET https://api.lomi.africa/oauth/authorize(PKCE +resourceparameter). - Sign in on
https://dashboard.lomi.africa/connect/agent-connectand approve. - Exchange the code at
POST https://api.lomi.africa/oauth/token. - Connect to MCP with
Authorization: Bearer <access_token>(lomi_oat_*).
The MCP server introspects the token and scopes every tool call to your organization.
API key (LOMI_SECRET_KEY)
| Value | Header / env | Where to get it |
|---|---|---|
Secret key (LOMI_SECRET_KEY) | x-lomi-api-key (HTTP) or LOMI_SECRET_KEY (stdio) | Dashboard → Developers → API keys: any secret key (lomi_sk_…) or an MCP key (lomi_mcp_…) from Connect MCP |
Your LOMI_SECRET_KEY unlocks lomi.’s hosted MCP endpoint and scopes every tool call to your organization. Send it in x-lomi-api-key and leave Authorization empty.
Hosted MCP (HTTP)
| URL | |
|---|---|
| MCP endpoint | https://mcp.lomi.africa/mcp |
| Guest bootstrap (no key) | https://mcp.lomi.africa/mcp/guest |
| Health (optional) | https://mcp.lomi.africa/health |
| Ready check (optional) | https://mcp.lomi.africa/ready |
URL-only config (OAuth):
{
"mcpServers": {
"lomi.": {
"url": "https://mcp.lomi.africa/mcp"
}
}
}API-key config (fallback):
{
"mcpServers": {
"lomi.": {
"url": "https://mcp.lomi.africa/mcp",
"headers": {
"x-lomi-api-key": "YOUR_LOMI_SECRET_KEY"
}
}
}
}Replace YOUR_LOMI_SECRET_KEY with your real API key, then restart your MCP client.
Sandbox agent bootstrap (no key)
If the client has no merchant key yet, connect https://mcp.lomi.africa/mcp/guest (no headers, no OAuth). Call lomi_register_agent: the server solves a short proof-of-work and this MCP session adopts a sandbox-only lomi_prov_* key.
Humans sign up on https://mcp.lomi.africa/mcp (Connect with lomi. in the browser). Do not add /mcp/guest as a second connector and approve OAuth on it. Guest does not advertise an authorization server. OAuth on that URL drops the MCP session (Unknown MCP session).
Then lomi_provision action=create_account, upload_document, complete, and api_keys. As soon as a lomi_sk_test_* key comes back, the guest session upgrades in place: the merchant tools (lomi_checkout, lomi_customers, lomi_webhooks, ...) are registered on the live session and the server sends notifications/tools/list_changed, so the client refreshes its tool list without reconnecting. Everything runs in TEST mode.
Live money still requires lomi_provision action=request_live and human approval at dashboard.lomi.africa/connect/go-live. Live keys are only shown in the dashboard, never over MCP.
Discovery
- Hosted MCP:
https://mcp.lomi.africa/mcp - Server card:
https://mcp.lomi.africa/server-card - Public connect: lomi.africa/connect
- Smithery listing config lives in the repo (
apps/mcp/smithery.yaml). Search: smithery.ai/search?q=lomi.africa - ChatGPT: add the same MCP URL in developer mode. First-party app page: lomi.africa/chatgpt
- Agent briefing: lomi.africa/llms.txt
Sandbox vs live
| Mode | LOMI_API_URL (stdio) | API keys |
|---|---|---|
| Live | https://api.lomi.africa | Live secret keys from the dashboard |
| Sandbox | https://sandbox.api.lomi.africa | Sandbox secret keys from the dashboard |
For HTTP MCP with a pasted secret key, tool calls use whichever API environment that LOMI_SECRET_KEY belongs to.
OAuth connections that granted both live and test register lomi_environment. Calls use live until you pass environment as test or back to live. Omit environment to see which is active and whether both keys were granted. A connection with only one key does not register this tool.
Clients
Claude Code
claude mcp add --transport http lomi https://mcp.lomi.africa/mcpOn first use, Claude Code opens Connect with lomi. in the browser.
OpenCode
opencode mcp add lomi --url https://mcp.lomi.africa/mcp
opencode mcp auth lomiCodex
codex mcp add lomi --url https://mcp.lomi.africa/mcp
codex mcp login lomiAgent Plugin (Cursor, Codex, Copilot)
Install the lomi. plugin from your client's marketplace when it is available (lomiafrica/agent-plugin). You can always connect directly with the hosted MCP URL shown above; you do not need the plugin.
codex plugin marketplace add lomiafrica/agent-plugin
codex plugin add lomi@lomiConnect with stdio (local)
Runs the MCP server on your machine, no transport token needed. Good for local development.
{
"mcpServers": {
"lomi.": {
"command": "npx",
"args": ["-y", "@lomi./mcp"],
"env": {
"LOMI_SECRET_KEY": "YOUR_LOMI_SECRET_KEY",
"LOMI_API_URL": "https://api.lomi.africa"
}
}
}
}Or run directly:
npx -y @lomi./mcpSet LOMI_API_URL to https://sandbox.api.lomi.africa when working against sandbox data.
Tools
- Merchant tools are resource tools named
lomi_<resource>with a requiredaction(for examplelomi_customerswithaction=list,lomi_invoiceswithaction=pdf). Mechanicallomi_post_*/lomi_get_*aliases are not registered. Write-action descriptions list the JSON body fields for that action (required fields first, then optional). They do not mark which body fields are required. lomi_environment: registered only when OAuth granted both live and test. Omitenvironmentto see{ environment, live, test }. Passliveortestto switch this session. Default is live. Not registered for a pasted API key, guest, or a grant with only one environment.lomi_events: booking desk (list,get,create,publish,scan,door_pin,add_type,invite). Booking must be connected or writes return 403.createneedsheader_Idempotency-Key. See Event bookings.lomi_search_tools: search the tool catalog when your client loads tools on demand.lomi_register_agent: mint a sandbox provisioning key (guest or any session).lomi_support: file a complaint. Guest sessions send email (action=filewithemail+message). A merchant key opens a Settings → Support ticket (list/get/close).action=statusreturns the status page and/ready. Merchant-only:action=export(GDPR bundle for the current org) andaction=delete_account(preview +confirmation_token).lomi_organization:createandusemint a secret for a new or existing org and adopt it on the session. Guest stays onlomi_provision.lomi_team/lomi_settings: members and invites; checkout and storefront settings (not payment sessions).lomi_logs:typeis required (api_request,api_error,webhook_delivery,activity). Webhook debugging:lomi_webhooksdeliveries/retry orlomi_logs type=webhook_delivery.- Connected-app tools on a merchant key that is not read-only:
lomi_mail,lomi_calendar,lomi_sms,lomi_domains,lomi_connectors, plus channel tools (lomi_sheets,lomi_drive,lomi_telegram, and the rest). Writes still ask you to confirm. See Connected apps. - Provisioning:
lomi_provisionandlomi_partners(sameactionpattern). - Resources:
lomi://docs/getting-started,lomi://docs/authentication,lomi://docs/idempotency,lomi://docs/pagination,lomi://docs/webhooks,lomi://docs/money,lomi://docs/recipes,lomi://docs/finance,lomi://docs/errors,lomi://tools/index. - Prompts:
provision_merchant_from_zero,onboard_merchant,debug_failed_payment,setup_webhook,setup_network_operator,month_end_close.
Each MCP action below matches one REST operation. Card holds are lomi_card_holds (create, get, increment, capture, cancel). Wave, MTN, Switch, and POST /usage/events are not exposed over MCP.
Network (header_Lomi-Account)
Approved lomi. Network Operators use the same secret key. OpenAPI header parameters become tool arguments prefixed with header_. The server forwards header_Lomi-Account as Lomi-Account: acct_....
| Charge model | MCP |
|---|---|
| Direct | Pass header_Lomi-Account on lomi_checkout create, lomi_card_holds, lomi_customers, lomi_transactions, lomi_refunds, lomi_balance, and lomi_payouts when the matching REST route accepts the header. |
| Destination | Omit the header. Put transfer_data.destination in the lomi_checkout create body. |
| Separate charges and transfers | Omit the header. Create the checkout on the Operator account, then lomi_transfers create (preview, then confirmation_token). |
lomi_network (login_link, account_session) is Operator-only: do not send header_Lomi-Account. Payment links do not accept the header. lomi_customers portal rejects it: launch the buyer portal with the member's own key. Wave and MTN direct charges stay on the REST API.
Writes still need header_Idempotency-Key or idempotency_key. Live Network requires approval.
Accept payments
lomi_checkoutCheckout sessions
| Action | API |
|---|---|
list | GET /checkout-sessions |
get | GET /checkout-sessions/{id} |
create | POST /checkout-sessions |
lomi_card_holdsCard holds
| Action | API |
|---|---|
create | POST /charge/card |
get | GET /charge/card/{id} |
increment | POST /charge/card/{id}/increment |
capture | POST /charge/card/{id}/capture |
cancel | POST /charge/card/{id}/cancel |
lomi_payment_linksPayment links
| Action | API |
|---|---|
list | GET /payment-links |
get | GET /payment-links/{id} |
create | POST /payment-links |
update | PATCH /payment-links/{id} |
archive | DELETE /payment-links/{id} |
lomi_whatsappWhatsApp
| Action | API |
|---|---|
status | GET /whatsapp |
update | PATCH /whatsapp |
connect | POST /whatsapp/setup-links |
send_payment_link | POST /whatsapp/payment-messages |
lomi_payment_requestsPayment requests
| Action | API |
|---|---|
list | GET /payment-requests |
get | GET /payment-requests/{id} |
create | POST /payment-requests |
lomi_invoicesInvoices
| Action | API |
|---|---|
list | GET /invoices |
get | GET /invoices/{id} |
create | POST /invoices |
update | PATCH /invoices/{id} |
pdf | GET /invoices/{id}/pdf |
checkout_session | POST /invoices/{id}/checkout-session |
finalize | POST /invoices/{id}/finalize |
send | POST /invoices/{id}/send |
remind | POST /invoices/{id}/remind |
void | POST /invoices/{id}/void |
lomi_eventsEvents
| Action | API |
|---|---|
list | GET /events |
get | GET /events/{id} |
create | POST /events |
publish | POST /events/{id}/publish |
scan | POST /events/{id}/scan |
door_pin | POST /events/door-pin |
add_type | POST /events/{id}/types |
invite | POST /events/{id}/invites |
Manage commerce
lomi_customersCustomers
| Action | API |
|---|---|
list | GET /customers |
top | GET /customers/top |
get | GET /customers/{id} |
create | POST /customers |
update | PATCH /customers/{id} |
delete | DELETE /customers/{id} |
block | POST /customers/{id}/block |
unblock | POST /customers/{id}/unblock |
transactions | GET /customers/{id}/transactions |
portal | POST /customers/{id}/portal |
portal_audit | GET /customers/{id}/portal-audit |
subscriptions | GET /customers/{id}/subscriptions |
lomi_productsProducts
| Action | API |
|---|---|
list | GET /products |
get | GET /products/{id} |
create | POST /products |
add_price | POST /products/{id}/prices |
batch_prices | POST /products/prices/batch |
set_default_price | POST /products/{id}/prices/{priceId}/default |
update | PATCH /products/{id} |
archive | DELETE /products/{id} |
lomi_subscriptionsSubscriptions
| Action | API |
|---|---|
list | GET /subscriptions |
get | GET /subscriptions/{id} |
update | PATCH /subscriptions/{id} |
cancel | POST /subscriptions/{id}/cancel |
resume | POST /subscriptions/{id}/resume |
change_plan | POST /subscriptions/{id}/change-plan |
usage | GET /subscriptions/{id}/usage |
lomi_couponsCoupons
| Action | API |
|---|---|
list | GET /coupons |
get | GET /coupons/{id} |
create | POST /coupons |
performance | GET /coupons/{id}/performance |
delete | DELETE /coupons/{id} |
Move money
lomi_transactionsTransactions
| Action | API |
|---|---|
list | GET /transactions |
get | GET /transactions/{id} |
receipt_pdf | GET /transactions/{id}/receipt.pdf |
lomi_refundsRefunds
| Action | API |
|---|---|
list | GET /refunds |
get | GET /refunds/{id} |
create | POST /refunds |
lomi_payoutsPayouts
| Action | API |
|---|---|
list | GET /payouts |
get | GET /payouts/{id} |
create | POST /payouts |
lomi_balanceAccount balance
| Action | API |
|---|---|
get | GET /accounts/balance |
breakdown | GET /accounts/balance/breakdown |
check | GET /accounts/balance/{currency} |
lomi_payout_methodsPayout methods
| Action | API |
|---|---|
list | GET /payout-methods |
create | POST /payout-methods |
lomi_settlementsSettlements
| Action | API |
|---|---|
list | GET /settlements |
transactions | GET /settlements/{id}/transactions |
create_instant | POST /settlements/instant |
get_instant | GET /settlements/instant/{id} |
lomi_transfersNetwork transfers
| Action | API |
|---|---|
list | GET /transfers |
get | GET /transfers/{id} |
create | POST /transfers |
reverse | POST /transfers/{id}/reversals |
Platform
lomi_merchantMerchant
| Action | API |
|---|---|
get | GET /merchants/{id} |
arr | GET /merchants/{id}/arr |
mrr | GET /merchants/{id}/mrr |
balance | GET /merchants/{id}/balance |
lomi_organizationOrganization
| Action | API |
|---|---|
list | GET /organizations |
get | GET /organizations/{id} |
metrics | GET /organizations/metrics |
create | POST /organizations |
update | PATCH /organizations/{id} |
use | POST /organizations/{id}/keys |
lomi_radarRadar settings
| Action | API |
|---|---|
get | GET /organizations/radar-settings |
update | PATCH /organizations/radar-settings |
lomi_providersPayment providers
| Action | API |
|---|---|
list | GET /providers |
lomi_teamTeam
| Action | API |
|---|---|
list | GET /team |
list_roles | GET /team/roles |
invite | POST /team/invitations |
revoke_invite | DELETE /team/invitations |
update_role | PATCH /team/members/{memberId} |
remove | DELETE /team/members/{memberId} |
lomi_settingsCheckout and storefront settings
| Action | API |
|---|---|
get_checkout | GET /settings/checkout |
update_checkout | PATCH /settings/checkout |
get_storefront | GET /settings/storefront |
update_storefront | PATCH /settings/storefront |
lomi_networkNetwork member accounts
| Action | API |
|---|---|
login_link | POST /network/accounts/{account}/login_links |
account_session | POST /network/account-sessions |
Operations
lomi_webhooksWebhooks
| Action | API |
|---|---|
list | GET /webhooks |
get | GET /webhooks/{id} |
create | POST /webhooks |
update | PATCH /webhooks/{id} |
delete | DELETE /webhooks/{id} |
test | POST /webhooks/{id}/test |
deliveries | GET /webhooks/deliveries |
delivery | GET /webhooks/deliveries/{id} |
retry | POST /webhooks/{id}/deliveries/{deliveryId}/retry |
lomi_disputesDisputes
| Action | API |
|---|---|
list | GET /disputes |
get | GET /disputes/{id} |
submit_evidence | POST /disputes/{id}/evidence |
lomi_exportsExports
| Action | API |
|---|---|
create | POST /exports |
list | GET /exports |
get | GET /exports/{id} |
lomi_financeFinance
| Action | API |
|---|---|
summary | GET /finance/summary |
cashflow | GET /finance/cashflow |
aging | GET /finance/aging |
reconcile | GET /finance/reconcile |
lomi_api_keysAPI keys
| Action | API |
|---|---|
list | GET /api-keys |
create | POST /api-keys |
revoke | DELETE /api-keys/{id} |
lomi_logsAPI logs
| Action | API |
|---|---|
list | GET /logs |
get | GET /logs/{id} |
lomi_metersMeters
| Action | API |
|---|---|
list | GET /meters |
get | GET /meters/{id} |
create | POST /meters |
update | PATCH /meters/{id} |
balance | GET /meters/{id}/balances/{customerId} |
lomi_usageUsage billing
| Action | API |
|---|---|
check_entitlement | GET /usage/entitlements |
set_entitlement | POST /usage/entitlements |
periods | GET /usage/periods |
revenue | GET /usage/revenue |
events | GET /usage/events |
get_event | GET /usage/events/{id} |
create_subscription | POST /usage/subscriptions |
lomi_riskRisk assessments
| Action | API |
|---|---|
list | GET /risk-assessments |
get | GET /risk-assessments/{id} |
Agents
lomi_provisionMerchant provisioning
| Action | API |
|---|---|
create_account | POST /provisioning/accountsNo public API page |
upload_document | POST /provisioning/merchants/{merchantId}/onboarding/documentsNo public API page |
extract | POST /provisioning/merchants/{merchantId}/onboarding/extractNo public API page |
complete | POST /provisioning/merchants/{merchantId}/onboarding/completeNo public API page |
status | GET /provisioning/merchants/{merchantId}/onboarding/statusNo public API page |
api_keys | GET /provisioning/merchants/{merchantId}/api-keysNo public API page |
request_live | POST /provisioning/merchants/{merchantId}/live-activation/requestNo public API page |
live_status | GET /provisioning/merchants/{merchantId}/live-activation/statusNo public API page |
lomi_partnersPartner provisioning keys
| Action | API |
|---|---|
mint_key | POST /partners/provisioning-keysNo public API page |
list_keys | GET /partners/provisioning-keysNo public API page |
revoke_key | DELETE /partners/provisioning-keys/{provisioningKeyId}No public API page |
usage | GET /partners/usageNo public API page |
Agent-driven onboarding (0 to 1)
Provisioning tools let an agent create a merchant account, upload KYC documents, complete onboarding, and retrieve test API keys before any merchant secret exists. MCP exposes this as lomi_provision with action (create_account, upload_document, extract, complete, status, api_keys, request_live, live_status).
Human claim link. create_account needs email, full_name, terms_accepted_at, and terms_version. Leave password out: the response includes a claim_url (dashboard.lomi.africa/connect/claim?token=..., valid 7 days, single use). Send this link to the human; they set their own password there and own the account. status reports human_claimed and re-issues claim_url until it flips to true. request_live returns human_claimed too: the human must claim before approving live mode.
| Value | Header / env | Purpose |
|---|---|---|
Provisioning key (LOMI_PROVISIONING_KEY) | x-lomi-provisioning-key | Bootstrap credential (lomi_prov_*) for /provisioning/* |
Merchant secret (LOMI_SECRET_KEY) | x-lomi-api-key | After onboarding completes, use test keys from GET /provisioning/merchants/{id}/api-keys |
Hosted HTTP example for a brand-new merchant (provisioning only until you have lomi_sk_test_*):
{
"mcpServers": {
"lomi.": {
"url": "https://mcp.lomi.africa/mcp",
"headers": {
"x-lomi-provisioning-key": "YOUR_LOMI_PROVISIONING_KEY"
}
}
}
}After onboarding, add x-lomi-api-key (or switch env to LOMI_SECRET_KEY) for payment and catalog tools. TEST mode works immediately; LIVE requires KYC clearance (AI for starter accounts, admin review for registered businesses).
Self-service OAuth onboarding uses the same Connect with lomi. flow. The MCP server introspects the token and provisions a scoped lomi_prov_* for your session. Self-service accounts are capped (verified email required, test-only, low daily merchant limits).
Partner API (platform integrators)
Authorized platforms receive a lomi_partner_* management key from lomi admin. They mint per-end-user lomi_prov_* keys via MCP lomi_partners (action=mint_key, list_keys, revoke_key, usage) or the REST routes:
| Endpoint | Purpose |
|---|---|
POST /partners/provisioning-keys | Mint a scoped provisioning key for an external_user_ref |
GET /partners/provisioning-keys | List keys |
DELETE /partners/provisioning-keys/{id} | Revoke a key |
GET /partners/usage | Usage summary |
Send x-lomi-partner-key: lomi_partner_* (or Authorization: Bearer lomi_partner_*). End users pass the returned lomi_prov_* to MCP or /provisioning/*. Monitor partners and audit events in admin.lomi.africa → Provisioning.
Deploying your own MCP server
Most integrators use https://mcp.lomi.africa or local stdio. Deploying a separate MCP instance is for lomi. engineering and operators only. See Maintaining CLI and MCP.