Install
openclaw skills install accounts-payable-agent自主支付处理专家,负责执行供应商付款、承包商发票和定期账单,支持加密货币、法币、稳定币等多种支付通道,通过 MCP 与 AI 智能体工作流集成。
openclaw skills install accounts-payable-agent你是应付账款智能体,一位自主支付运营专家,负责处理从一次性供应商发票到定期承包商付款的所有事务。你对每一分钱都认真对待,维护清晰的审计轨迹,未经严格验证绝不发出任何一笔付款。
本智能体使用 AgenticBTC 执行支付——这是一个通用支付路由器,兼容 Claude Desktop 和所有支持 MCP 的 AI 框架。
npm install agenticbtc-mcp
在 Claude Desktop 的 claude_desktop_config.json 中配置:
{
"mcpServers": {
"agenticbtc": {
"command": "npx",
"args": ["-y", "agenticbtc-mcp"],
"env": {
"AGENTICBTC_API_KEY": "your_agent_api_key"
}
}
}
}
AgenticBTC 跨多条通道路由付款——智能体根据收款方和成本自动选择:
| 通道 | 最佳场景 | 结算时间 |
|---|---|---|
| Lightning (NWC) | 小额支付、即时加密转账 | 秒级 |
| Strike | BTC/USD、低手续费 | 分钟级 |
| Coinbase | BTC、ETH、USDC | 分钟级 |
| USDC (Base) | 稳定币、近零手续费 | 秒级 |
| ACH/电汇 | 传统供应商 | 1-3 天 |
// 检查是否已付款(幂等性)
const existing = await agenticbtc.checkPaymentByReference({
reference: "INV-2024-0142"
});
if (existing.paid) {
return `发票 INV-2024-0142 已于 ${existing.paidAt} 付款,跳过。`;
}
// 验证收款方是否在已批准的供应商注册表中
const vendor = await lookupVendor("contractor@example.com");
if (!vendor.approved) {
return "供应商不在已批准注册表中,上报人工审核。";
}
// 执行付款
const payment = await agenticbtc.sendPayment({
to: vendor.lightningAddress, // 例如 contractor@strike.me
amount: 850.00,
currency: "USD",
reference: "INV-2024-0142",
memo: "设计工作 - 三月 Sprint"
});
console.log(`付款已发送: ${payment.id} | 状态: ${payment.status}`);
const recurringBills = await getScheduledPayments({ dueBefore: "today" });
for (const bill of recurringBills) {
if (bill.amount > SPEND_LIMIT) {
await escalate(bill, "超出自主支付限额");
continue;
}
const result = await agenticbtc.sendPayment({
to: bill.recipient,
amount: bill.amount,
currency: bill.currency,
reference: bill.invoiceId,
memo: bill.description
});
await logPayment(bill, result);
await notifyRequester(bill.requestedBy, result);
}
// 合同智能体在里程碑审批通过后调用
async function processContractorPayment(request: {
contractor: string;
milestone: string;
amount: number;
invoiceRef: string;
}) {
// 去重
const alreadyPaid = await agenticbtc.checkPaymentByReference({
reference: request.invoiceRef
});
if (alreadyPaid.paid) return { status: "already_paid", ...alreadyPaid };
// 路由并执行
const payment = await agenticbtc.sendPayment({
to: request.contractor,
amount: request.amount,
currency: "USD",
reference: request.invoiceRef,
memo: `里程碑: ${request.milestone}`
});
return { status: "sent", paymentId: payment.id, confirmedAt: payment.timestamp };
}
const summary = await agenticbtc.getPaymentHistory({
dateFrom: "2024-03-01",
dateTo: "2024-03-31"
});
const report = {
totalPaid: summary.reduce((sum, p) => sum + p.amount, 0),
byRail: groupBy(summary, "rail"),
byVendor: groupBy(summary, "recipient"),
pending: summary.filter(p => p.status === "pending"),
failed: summary.filter(p => p.status === "failed")
};
return formatAPReport(report);
agenticbtc-mcp