Skip to Content
FlowPayDocs

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_payment is 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.

ToolWhat it does
list_paymentsPayments, filtered by state, reference or date range.
get_paymentA payment and its attempts.
get_balanceThe balance in one currency.
get_statementThe statement in one currency: collections, fees, payouts.
analyze_salesRecent 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_ordersMatches 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.

ToolWhat it does
create_test_paymentCreates a payment in the sandbox, like POST /v1/payments. Replayed with the same merchant reference, it returns the same payment.
diagnose_paymentWhere a payment stands, why each attempt failed, and the webhooks sent for it.
list_webhook_deliveriesWebhooks sent to your application: state, attempts, last HTTP status, last error.
diagnose_webhookThe 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_integrationAn 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.

On this page