- Sign in with Cleo (OAuth). For ChatGPT, Claude and other agents that support MCP authorization. You pick a business and Read only or Read and approve. The agent cannot pay. See Connect your agent.
- An API key. For integrations and agents that send a header. The key’s scopes decide what the agent can do, payments included. This page covers it.
Endpoints
The
mcp. hosts need no path. A key works only on its own environment’s host.
Send the key as a Bearer token on every request:
503 service_unavailable.
Connect your client
- Claude Code
- Cursor
- VS Code
https://api.cleo-pay.com/v1/mcp and a cleo_live_ key.
To connect without a key, leave out the header and sign in instead. See Connect your agent.
Scopes and tool visibility
tools/list shows only the tools the key’s or the connection’s scopes allow. If a tool is missing, check the key’s scopes first. Calling a hidden tool directly fails at the protocol level with JSON-RPC error -32600 (“Access denied”), not with a forbidden_scope tool result. This is the one place where MCP and REST errors differ.
A key whose business has not finished identity verification sees only get_business_status.
Tools
Business
Bills
create_payable and submit_payable take custom field answers with the same shapes and rules as POST /v1/payables and POST /v1/payables/{payableId}/submit. Both must answer the business’s required bill-level fields, or the tool fails with validation_error. See Write answers. Each answer list takes up to 200 answers.
list_payables takes customFieldId and customFieldValue together, with the same rules as GET /v1/payables: the id of a bill-level dropdown or multiple-choice field, and an option id, externalId or value. updatedSince and expand work as on GET /v1/payables. Listing custom fields and syncing their options are REST only, so custom-fields:read and custom-fields:write add no tools.
Members
Payments
Balance
Invoices
Contacts
Bank accounts
Webhook endpoints
Rotating a secret, listing deliveries and redelivering an event are REST only. The webhook tools answer
feature_unavailable until Cleo turns webhooks on for the business.
Reviewing bills
approve_payable and flag_payable let an agent review bills without paying them. The payables:approve scope never lets a key or a connection pay.
- Call
list_payableswithpaymentStatus: "unpaid"andstatus: "pending_approval". Read every page until you havetotalCountbills. - Read each bill with
get_payable. Compare its vendor,totalAmountCentsandeventDatewith what the business expects. - If they match, call
approve_payablewith the bill’stotalAmountCents,vendorKeyandcustomNumberexactly as you read them, asexpectedTotalAmountCents,expectedVendorKeyandexpectedCustomNumber. SendnullforexpectedCustomNumberwhen the bill has no number. Add acommentthat says what it matched. - If anything differs, call
flag_payablewith areasonthat says what differs. Uselist_membersto name who should look.
- If someone changed the total, moved the bill to another vendor or changed its bill number since you read it, the bill is not approved and the tool answers
payable_changed, usually naming what differs. Read it again before you decide. For the bill number, surrounding spaces are ignored and a blank number counts as none; otherwise the match is exact. - A bill that is not waiting for approval, a step that belongs to another approver, and a step this member already approved answer
validation_error. An admin can approve any step, as in the web app. - When the business requires categories and the bill has none, approval answers
validation_error. Set the category in Cleo first. - When the last step is approved and no other approver is still open, the bill’s
statusbecomesapprovedand it waits for payment. Paying it is a separate call. - A flag shows as Flagged with the reason in the bill’s activity in Cleo, and in
flagson the bill. It changes nothing else, and nobody is assigned. - Cleo records each approval and flag as the key’s member, with the agent’s name: the OAuth client’s name for a connected agent, or the API key’s name. The bill’s activity in Cleo shows, for example, Jane Doe approved via ChatGPT. The tool results do not include the agent’s name.
instructions tell every connected agent the same rules: approve only when vendor, amount and event date match, flag otherwise, and never pay a bill or move money unless the user asks for that payment in so many words. A key with payments:initiate can still pay when asked. Leave that scope off a key that should only review. The review_unpaid_bills prompt starts this review. Its optional expectations argument takes what to compare with, such as a P&L.
REST equivalents: POST /v1/payables/{payableId}/approve, POST /v1/payables/{payableId}/flags and GET /v1/members.
Paying from the right source
- Call
list_funding_sources. Pick an item withcanPay: true. - Copy its
payfields intocreate_payment:paymentRailandfundingSourcefor the Cleo Pay balance,paymentRailandbankAccountIdfor a Dwolla bank. - Paying from the Cleo Pay linked bank (
fundingSource: "BANK") is not available through the API yet and answersfeature_unavailable.
get_business_status to explain why the business cannot pay.
Retrying safely
Write tools take anidempotencyKey argument, 1 to 64 characters.
A key is bound to the tool and the arguments it first came with:
- The same key with the same arguments returns the first result. The action does not run again.
- The same key with other arguments, or for another tool, answers
idempotency_conflict. - Money tools never run twice under one key. If one fails in a way that may have moved money, every retry with its key answers
payment_unconfirmed. Checklist_paymentsorlist_balance_transactionsbefore you try again with a new key.
create_payable, create_contact and add_bank_account create a new record on each retry.
Full rules: Idempotency.
Errors
A failed tool call returnsisError: true, the text "<code>: <message>", and the same error as REST in structuredContent:
details are absolute. Show them to your user: setup, bank linking and unlocking happen in the Cleo web app. The MCP endpoint’s own 401, 429 and 503 answers use the REST error body and carry X-Request-Id. Each HTTP request to the endpoint counts once against the key’s rate limit, and every counted answer carries the RateLimit-* headers; see Rate limits. The codes are listed in Errors.
Data protection
Reads never return full bank account numbers, routing numbers or tax ids. Bank and tax numbers you send tocreate_contact or add_bank_account are write-only.