MCP
Connect FlowPay to your agents with the MCP server.
The Model Context Protocol (MCP) lets an agent, such as your company's agent or your code editor's assistant, use FlowPay as a tool. FlowPay's MCP server answers at $FLOWPAY_URL/v1/mcp and authenticates with an API key, like the rest of the API.
Connect
With Claude Code:
claude mcp add --transport http flowpay "$FLOWPAY_URL/v1/mcp" \
--header "Authorization: Bearer sk_..."With a client that reads a JSON configuration (Cursor, Claude Desktop, VS Code…):
{
"mcpServers": {
"flowpay": {
"url": "https://<FLOWPAY_URL>/v1/mcp",
"headers": { "Authorization": "Bearer sk_..." }
}
}
}With a claude.ai custom connector, which cannot send a fixed header: add the address $FLOWPAY_URL/v1/mcp and nothing else. claude.ai opens a FlowPay page that asks for the API key to entrust to the agent; once allowed, it receives a token that stands for that key, on the MCP server only. Revoking the key disconnects the agent. If your application restricts allowed IP addresses, claude.ai's must be among them.
Which key to give the agent
Create a key reserved for the agent, which you can revoke without touching your integration. For your company's agent, choose Read-only access (see Authentication): even copied out of the agent, it neither creates nor cancels a payment. For development, a full test key (sk_test_) also allows create_test_payment.
What the agent can and cannot do
- Everything is read-only, except
create_test_payment. create_test_paymentis accepted with a full test key (sk_test_) only; with a live or read-only key it is refused. The agent never moves real money: it cancels nothing and requests no payout.- Every tool acts on the key's application only, never on another merchant or application.
- The payer's number, their code and secrets are never returned.
MCP for merchants
So your company's agent can read your data and help you understand it.
| Tool | What it does |
|---|---|
list_payments | Payments, filtered by state, reference or date range. |
get_payment | A payment and its attempts. |
get_balance | The balance in one currency. |
get_statement | The statement in one currency: collections, fees, payouts. |
analyze_sales | Recent sales: totals per currency and per day, success per network, failure causes, points of attention (payments stuck at the operator, a struggling network, an unusual day). |
reconcile_orders | Matches your orders (reference, amount, currency) against payments, and lists succeeded payments with no order over a range. |
"Do this week's payments match my orders?"
The agent passes your orders to reconcile_orders. Each one comes back as matched, amount_mismatch, currency_mismatch, not_paid or missing.
MCP for developers
To prepare and diagnose your integration with your agent's help.
| Tool | What it does |
|---|---|
create_test_payment | Creates a payment in the sandbox, like POST /v1/payments. Replayed with the same merchant reference, it returns the same payment. |
diagnose_payment | Where a payment stands, why each attempt failed, and the webhooks sent for it. |
list_webhook_deliveries | Webhooks sent to your application: state, attempts, last HTTP status, last error. |
diagnose_webhook | The exact request sent (headers, raw body, signature), how to check the signature, and the likely cause of a refusal with the steps to fix it. |
check_integration | An integration check: mode, key access, active application, webhook address, the last seven days, next steps. |
"Why is my webhook being refused?"
The agent runs list_webhook_deliveries, then diagnose_webhook. If your server answers 401, the agent compares your signature computation with FlowPay's: HMAC-SHA256 over <X-FlowPay-Timestamp>.<raw body>, with the application's webhook secret. See Webhooks.
Errors
A tool fault comes back as a result flagged as an error, with the same error and message as the API (see Errors): the agent reads it and fixes its request. The server keeps no session; every call stands on its own.