Agentpay

io.github.alefnt由 GitHub 账号 alefnt 发布v0.1.1更新于 Oct 27, 2026

AI Agent payment protocol on CKB Fiber Network. Zero-gas micropayments with Hold Invoice escrow.

发布方自己的服务:AgentPay — Pay-per-call AI Microservices

已验证STDIO仅桌面金融AI 与机器学习

概览

AI 生成的概览

AgentPay MCP 服务器让 AI 助手持有 CKB Fiber 钱包,向其他代理进行零手续费的微支付,并支持托管式 Hold Invoice。

可以做什么
  • 查询 CKB 与 xUDT 代币的钱包余额
  • 通过 Fiber 发票发送付款,并生成发票以收款
  • 一步完成付款并调用其他代理的 API
  • 创建锁定资金的托管发票,随后结算或取消
  • 查看当前活跃的支付通道
适用场景
当助手需要为其他代理的 API 调用或服务付费,或在 CKB Fiber 网络上进行托管式代理间支付时使用。若你尚未运行 Fiber 节点和钱包,则用处不大。
运行要求
通过 npx 从 npm 包以 stdio 方式在本地运行。需要 Node.js 20+,以及通过 FIBER_RPC_URL 环境变量提供的可访问 Fiber Network RPC 地址。实际付款还需要已充值的 Fiber 钱包和支付通道。
安装前请注意
该服务器可动用真实资金:发送付款、锁定托管资金以及释放或取消托管都会花钱,操作失误可能无法撤回。它需要访问你的 Fiber 节点 RPC,请只将 FIBER_RPC_URL 指向你自己控制的节点。批准每笔付款操作前请仔细核对。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agentpay,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

AgentPay - BTC-Native AI Agent Payment Protocol

[npm] [npm] [npm] [MCP Registry] [License: MIT]

Give every AI Agent a wallet. Let Agents pay each other - instantly, with zero fees.

AgentPay is a BTC-native payment protocol designed for AI Agent economies. Built on CKB Fiber Network (Lightning-compatible L2), it enables:

  • Zero-gas micropayments - Pay per API call, no minimum amount
  • Hold Invoice escrow - Lock funds until service delivery is confirmed
  • BTC interoperability - Cross-chain payments via Lightning Network
  • MCP integration - Let Claude/GPT agents make payments natively

Quick Start

Install

bash
npm install @agentpay-dev/sdk @agentpay-dev/core

Create a Payment Agent

typescript
import { AgentWallet } from '@agentpay-dev/sdk';
const wallet = new AgentWallet({ fiberRpcUrl: process.env.FIBER_RPC_URL });
// Pay another agent for a serviceconst result = await wallet.payAndCall(  'https://translator-agent.example.com',  'translate',  { text: 'Hello World', target: 'zh' });

Scaffold a New Project

bash
npx create-agentpay my-agentcd my-agent && npm install

Architecture

+-----------------------------------------------------+|                    Applications                      ||  AI Agents  |  DePIN Devices  |  API Marketplaces    |+-----------------------------------------------------+|                   AgentPay SDK                       ||  AgentWallet  |  ServiceProvider  |  HubClient       |+-----------------------------------------------------+|                   AgentPay Core                      ||  Settlement  |  Metering  |  DID  |  Assets          |+-----------------------------------------------------+|              CKB Fiber Network (L2)                  ||  Payment Channels  |  Hold Invoice  |  HTLC Routing  |+-----------------------------------------------------+|         CKB L1  +  BTC Lightning Network             ||    xUDT Assets  |  RGB++  |  Cross-chain (Cch)       |+-----------------------------------------------------+

Packages

PackagenpmDescription
@agentpay-dev/core[npm]Protocol core: Fiber RPC, settlement, assets, DePIN metering
@agentpay-dev/sdk[npm]Developer SDK: AgentWallet, ServiceProvider, HubClient
@agentpay-dev/mcp-server[npm]MCP Server: 8 payment tools for Claude/GPT
@agentpay-dev/x402-facilitator[npm]HTTP 402 payment middleware with Fiber settlement
@agentpay-dev/ap2[npm]Google AP2 protocol bridge to Fiber
create-agentpay[npm]CLI scaffolding tool

Key Features

Hold Invoice - Trustless Escrow

The killer feature. Agent A locks payment, Agent B delivers, funds release only on confirmation:

typescript
import { ServiceProvider } from '@agentpay-dev/sdk';
const provider = new ServiceProvider({  fiberRpcUrl: process.env.FIBER_RPC_URL,  services: {    translate: {      price: 100_000_000n,  // 1 CKB per request      handler: async (params) => {        const result = await doTranslation(params.text, params.target);        return { translation: result };      }    }  }});
// Hold flow: Lock -> Deliver -> Release (atomic)// If service fails, funds auto-refund via HTLC timeout

MCP Server - AI-Native Payments

Registered on the official MCP Registry as io.github.alefnt/agentpay.

Add to Claude Desktop config:

json
{  "mcpServers": {    "agentpay": {      "command": "npx",      "args": ["@agentpay-dev/mcp-server"],      "env": { "FIBER_RPC_URL": "http://localhost:8227" }    }  }}

8 MCP Tools:

ToolDescription
get_balanceCheck wallet balance (CKB + xUDT)
send_paymentSend a payment via Fiber invoice
create_invoiceGenerate a Fiber invoice to receive payment
pay_for_servicePay-and-call another agent's API
create_hold_invoiceCreate escrow payment (lock funds)
settle_holdRelease held funds after service delivery
cancel_holdCancel and refund held payment
list_channelsView active payment channels

x402 HTTP Compatibility

Any HTTP API becomes a paid API with one middleware:

typescript
import { createX402Middleware } from '@agentpay-dev/x402-facilitator';
const paywall = createX402Middleware({ price: '100000000' });
http.createServer((req, res) => {  paywall(req, res, () => {    res.end(JSON.stringify({ data: 'premium content' }));  });});// Client: HTTP 402 -> pay Fiber invoice -> retry -> get content

BTC Cross-Chain

Pay with BTC, settle on CKB via Lightning-Fiber bridge:

typescript
import { CchClient } from '@agentpay-dev/core';
const cch = new CchClient({ cchRpcUrl: process.env.CCH_RPC_URL });
await cch.sendBtcToCkb({  btcPayReq: 'lnbc100n1p...',  fiberChannelId: '0x...',});

Ecosystem Integration

AgentPay enhances existing payment solutions:

PlatformHow AgentPay Helps
x402 (Coinbase)Zero-gas Fiber settlement backend for HTTP 402 protocol
AP2 (Google)Settlement layer for agent authorization framework
StripeComplements with agent-to-agent micropayments (sub-cent)
Lightning NetworkCross-chain via Cch bridge, expanding BTC payment reach

Project Structure

AgentPay/  packages/    core/               # Protocol core (Fiber RPC, settlement, DePIN)    sdk/                # Developer SDK (Wallet, Provider, Hub)    mcp-server/         # MCP Server for AI agents    x402-facilitator/   # HTTP 402 middleware    ap2/                # Google AP2 bridge    create-agentpay/    # CLI scaffolding  services/    hub/                # Hosted wallet service    registry/           # Agent discovery service  examples/    translate-agent/    # Translation service example    code-review-agent/  # Code review agent example    btc-to-ckb/         # Cross-chain payment example  docs/    product.md          # Product overview    architecture.md     # Technical architecture

Documentation

Tech Stack

  • Runtime: Node.js 20+ / TypeScript 5.5+
  • L2 Network: CKB Fiber Network (Lightning-compatible)
  • L1 Blockchain: Nervos CKB
  • Asset Standard: xUDT (extensible User Defined Token)
  • Identity: .bit decentralized identity
  • Cross-chain: Cch (CKB - BTC Lightning bridge)
  • AI Integration: Model Context Protocol (MCP)
  • Build: pnpm workspace monorepo

Development

bash
git clone https://github.com/alefnt/AgentPay.gitcd AgentPaypnpm installpnpm buildpnpm test

Roadmap

  • Core protocol (Fiber RPC, settlement, assets)
  • SDK (AgentWallet, ServiceProvider, HubClient)
  • MCP Server with 8 payment tools
  • x402 HTTP 402 facilitator
  • AP2 protocol bridge
  • DePIN metering module
  • BTC cross-chain (Cch + LND)
  • RGB++ bridge integration
  • npm packages published
  • MCP Registry registration
  • Fiber mainnet deployment
  • Stablecoin (RUSD) support on CKB
  • Public demo site
  • Production Hub service

License

MIT - see LICENSE for details.


Built for the Agent Economy - where AI agents autonomously discover, negotiate, and pay for services.

来源:README.md,提交 0eec0cb

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Agentpay 集成