Skip to main content

Agent Integration

KleePay gives agents a local interface for payment tasks without handing them an unrestricted card. Agents can inspect card metadata, request card and wallet actions, and create signed authorizations for specific payment intents.

Each authorization can be bounded by:

  • card
  • amount and currency
  • merchant domain or merchant identifier
  • TTL

Raw PAN and CVV stay out of the agent context.

Option A: let the agent set it up

First create a setup token from Devices.

Paste an instruction like this into Claude Code, Codex, OpenClaw, or another MCP-compatible agent:

Read https://klw.kleepay.ai/skill.md and set up KleePay on this device - setup token: <YOUR_TOKEN>

The agent should fetch the KleePay skill, install klw, bind the device, and expose the local MCP tools. Do not paste setup tokens into public or shared chats.

Option B: configure MCP manually

After klw is installed and the device is connected, configure the MCP client to run klw mcp.

For Claude Desktop:

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

For a generic MCP client:

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

HTTP fallback

Agents without MCP support can use the local REST API:

http://127.0.0.1:7723

Authentication uses the bearer token stored at:

~/.kleepay/daemon_token

Example flows

Authorize a purchase

  1. Call kleepay_list_cards to choose an eligible card.
  2. Call kleepay_authorize with card, amount, currency, merchant scope, and TTL.
  3. Call kleepay_check_tx to confirm whether the authorization was used and how the charge settled.

The corresponding frontdesk surface is Activity (the real-time feed), not the settled-only statement export.

Check spending

  1. Call kleepay_wallet_balance for wallet balance.
  2. Call kleepay_wallet_history for recent wallet movement.
  3. Call kleepay_list_authorizations for active and upcoming authorizations.

Create a subscription card

  1. Call kleepay_create_card with a label such as subscriptions.
  2. Call kleepay_wallet_allocate to fund the card.
  3. Call kleepay_recurring for the merchant, amount, cadence, and card.