← back to the live demo

BePay AI — Agent Documentation

Everything an autonomous agent needs to connect to, understand and operate this governed payment-operations layer over the Model Context Protocol. This is not a mock: every tool below wraps a live function on this server.

Connection

MCP endpointhttps://sidai.live/bepay/mcp
MCP directhttps://mcp.sidai.live/mcp
TransportStreamable HTTP · JSON-RPC 2.0 · session id issued on initialize
Agent cardhttps://sidai.live/bepay/.well-known/agent-card.json
Authnone (demo surface; reasoning managed server-side)

What this system is

BePay AI is a governance operating layer for payment agents, built on BePay Money rails. The principle: AI proposes. Policy governs. Humans approve. Every task runs a seven-stage governed loop:

Understand→ Plan→ Govern→ Act→ Approve→ Execute→ Prove

Recommended agent loop

1. initialize                       → orient (returns instructions)
2. bepay.overview                   → current system state, health, chain head
3. bepay.list_scenarios             → pick a scenario
4. bepay.start_run {scenario}       → returns run_id (async execution)
5. poll bepay.get_run {run_id}      → watch stages progress
   - state=awaiting_approval        → the human gate is armed:
       bepay.approve_run / bepay.reject_run {run_id, approver}
6. terminal states: completed | blocked | rejected | failed
7. bepay.get_audit_proof            → verify the whole run cryptographically

Real BePay Money integration bepay_money.*

Beyond the reference sandbox, six tools talk to the live BePay Money dev API under our own test merchant. This is how an agent mints real wallets and raises real payment intents — the demo turning into the real thing.

Safety boundaries (enforced in code, not just documented). Dev test rails only — production is unreachable by construction. One fixed test merchant, no switching. Amounts must be positive numbers inside the per-intent cap (negatives, zero and non-numbers are rejected before any API call). No merchant onboarding, no PIN changes, no fund movement — and wallet-creation responses are scrubbed of mnemonics and private material server-side.
mint → manage → track:
  bepay_money.create_wallet {walletType:'evm'}
  bepay_money.create_intent {amount:25, currency:'USDC', description:'demo invoice #1'}
  bepay_money.get_intent    {intentId:'pi_...'}
linked to governance:
  bepay_money.create_intent {amount:25, currency:'USDC', run_id:'run_...'}

Troubleshooting a fresh connection

Tools

Minimal client example

const rpc = async (body) => {
  const r = await fetch('https://sidai.live/bepay/mcp', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(body),
  });
  return r.json();
};

await rpc({ jsonrpc:'2.0', id:1, method:'initialize',
  params:{ protocolVersion:'2025-06-18', capabilities:{}, clientInfo:{name:'demo',version:'1'} }});
// the response headers carry Mcp-Session-Id - send it back on later calls

const tools = await rpc({ jsonrpc:'2.0', id:2, method:'tools/list' });

const started = await rpc({ jsonrpc:'2.0', id:3, method:'tools/call',
  params:{ name:'bepay.start_run', arguments:{ scenario:'hero' } }});
console.log(JSON.parse(started.result.content[0].text).run_id);

Notes & limits

Access notes. The public endpoint sits behind Cloudflare; normal browser-class HTTP clients pass automatically, but fully headless clients may be challenged by the zone's bot protection — if that happens, run from an environment that completes the browser check or ask the operator to allowlist the path. A direct origin endpoint (https://mcp.sidai.live/mcp, valid public TLS) bypasses Cloudflare entirely. Rate limits (per client, per hour): start_run 20 · approve/reject 30 · ask_agent 6 · reset_sandbox 6 · money writes 20. Exceeding them returns JSON-RPC error -32063. Tool outputs are plain JSON text inside the standard MCP content envelope.

This deployment is a live demonstration of governed agent operations for the BePay Money ecosystem. The governance stack — policy, mission admission, two-layer approval, hash-chained audit — is real and production-shaped; the money rails are a labeled reference sandbox so agents can explore safely.