Docs/Agent Integration

Connect Any AI Agent to KleePay

KleePay gives AI agents the ability to make payments, manage cards, and control spending. Works with any agent framework that supports MCP (Model Context Protocol) or HTTP APIs.

Quick Start

Three commands to get your agent connected.

1Install klw
Terminalbash
curl -fsSL https://klw.kleepay.ai/install.sh | sh
2Set up your account
Terminalbash
klw setup <YOUR_TOKEN>
3Start the daemon
Terminalbash
klw start

MCP Integration

For agents that support Model Context Protocol — Claude Desktop, OpenClaw, and any MCP-compatible client.

Claude Desktop

claude_desktop_config.jsonjson
{
  "mcpServers": {
    "kleepay": {
      "command": "klw",
      "args": ["mcp"]
    }
  }
}

Generic MCP Client

mcp_config.jsonjson
{
  "command": "klw",
  "args": ["mcp"],
  "env": {}
}

HTTP API Integration

For agents without MCP support, the klw daemon exposes a local REST API.

Endpoint

http://127.0.0.1:7732

Authentication

Bearer token from ~/.kleepay/daemon_token

MethodEndpointDescription
GET/healthCheck daemon health
GET/cardsList all cards
POST/authorizeAuthorize a payment

See the full HTTP API reference for all endpoints.

Agent Skill File

Agents can fetch a comprehensive skill file that describes all available operations and recommended flows. This is useful for agents that load instructions dynamically.

agent_config.jsonjson
{
  "skills": [
    {
      "name": "kleepay",
      "url": "https://klw.kleepay.ai/skill.md",
      "description": "KleePay payment operations for AI agents"
    }
  ]
}

Available Tools

22 MCP tools organized by category. See the MCP Tools Reference for full parameter details.

Card Payments6

kleepay_payAuthorize and execute a card payment
kleepay_list_cardsList all virtual cards on the account
kleepay_check_txCheck the status of a transaction
kleepay_list_txList recent transactions with filters
kleepay_cancel_txCancel a pending transaction
kleepay_refund_txRequest a refund for a settled transaction

Wallet6

kleepay_wallet_balanceCheck wallet balance (USDT + card balances)
kleepay_wallet_paySend USDT to an external address
kleepay_wallet_deposit_addressGet the deposit address for funding
kleepay_wallet_historyList wallet transaction history
kleepay_wallet_allocateAllocate funds from wallet to a card
kleepay_wallet_reclaimReclaim funds from a card back to wallet

Card Management6

kleepay_create_cardCreate a new virtual Visa card
kleepay_reveal_cardReveal full card number, CVV, and expiry
kleepay_freeze_cardFreeze a card (block all transactions)
kleepay_unfreeze_cardUnfreeze a card
kleepay_set_card_limitUpdate spending limits on a card
kleepay_delete_cardPermanently delete a card

Account4

kleepay_whoamiGet current account info and status
kleepay_list_policiesList active spending policies
kleepay_audit_logView the full audit trail
kleepay_healthCheck daemon and API health status

Example Flows

Common agent workflows, step by step.

Pay $50 to Amazon

01
kleepay_list_cards

Find the card to use

02
kleepay_pay

Call with card_id, amount: 50.00, currency: "USD", merchant: "amazon.com"

03
kleepay_check_tx

Confirm the transaction settled

Check my spending

01
kleepay_wallet_balance

See total wallet and card balances

02
kleepay_list_tx

List recent transactions

03
kleepay_audit_log

Review the full audit trail if needed

Create a card for subscriptions

01
kleepay_create_card

Create a card with label "subscriptions"

02
kleepay_wallet_allocate

Allocate $200 to the new card

03
kleepay_set_card_limit

Set monthly limit to $200, restrict MCC to SaaS