AgentPay MCP
Payment layer for AI agents via Model Context Protocol. AgentPay MCP gives your AI agent the ability to make payments, track spending, and manage payment channels -- without leaving the agent runtime.
Works with Claude Desktop, Cursor, Cline, Windsurf, and any MCP-compatible environment.
What It Does
- - Make payments: Send USDC on Polygon directly from agent tool calls
- Budget management: Hard spending limits enforced per-session and per-day
- Payment channels: Open Handshake58-style channels for sub-cent micropayments
- CCTP bridge: Cross-chain USDC settlement (Ethereum, Base, Polygon, Arbitrum)
- Non-custodial: Agent holds its own keys -- no third-party custody
Installation
CODEBLOCK0
Add to your MCP config (~/.config/claude/mcp.json or equivalent):
CODEBLOCK1
Tools Exposed
| Tool | Description |
|---|
| INLINECODE1 | Send USDC to an address (enforces spend limits) |
| INLINECODE2 |
Query agent wallet balance |
|
get_spending | Current session and daily spend totals |
|
open_channel | Open a micropayment channel (Handshake58 compatible) |
|
pay_channel | Issue a signed payment voucher (zero gas) |
|
close_channel | Settle and reclaim unused channel funds |
|
bridge_usdc | Cross-chain USDC via CCTP |
Usage Example
In Claude Desktop with AgentPay MCP configured:
"Pay 5 USDC to 0xABC...123 for the API call results"
The agent calls pay(to="0xABC...123", amount=5, token="USDC"). If within limits, it executes immediately. If over limits, it returns a request for human approval.
Environment Variables
| Variable | Required | Description |
|---|
| INLINECODE9 | Yes | Agent's signing key (0x-prefixed) |
| INLINECODE10 |
Yes | Polygon JSON-RPC endpoint |
|
MAX_TX_USDC | No | Per-transaction limit in USDC (default: 25) |
|
MAX_DAILY_USDC | No | Daily spending limit in USDC (default: 500) |
GitHub
https://github.com/AI-Agent-Economy/agentpay-mcp
License
MIT
AgentPay MCP
通过模型上下文协议为AI智能体提供支付层。AgentPay MCP赋予您的AI智能体支付、追踪支出和管理支付通道的能力——无需离开智能体运行环境。
兼容Claude Desktop、Cursor、Cline、Windsurf以及任何支持MCP的环境。
功能特性
- - 发起支付: 通过智能体工具调用直接在Polygon上发送USDC
- 预算管理: 按会话和按日强制执行硬性支出限额
- 支付通道: 开启Handshake58风格的通道,实现亚美分微支付
- CCTP跨链桥: 跨链USDC结算(以太坊、Base、Polygon、Arbitrum)
- 非托管: 智能体持有自身密钥——无需第三方托管
安装
bash
npm install -g agentpay-mcp
添加到您的MCP配置文件(~/.config/claude/mcp.json或等效文件):
json
{
mcpServers: {
agentpay: {
command: agentpay-mcp,
env: {
AGENTPRIVATEKEY: 0x...,
RPC_URL: https://polygon-rpc.com,
MAXTXUSDC: 25,
MAXDAILYUSDC: 500
}
}
}
}
暴露的工具
| 工具 | 描述 |
|---|
| pay | 向地址发送USDC(强制执行支出限额) |
| check_balance |
查询智能体钱包余额 |
| get_spending | 当前会话和每日支出总额 |
| open_channel | 开启微支付通道(兼容Handshake58) |
| pay_channel | 签发已签名的支付凭证(零Gas费) |
| close_channel | 结算并回收未使用的通道资金 |
| bridge_usdc | 通过CCTP进行跨链USDC转账 |
使用示例
在配置了AgentPay MCP的Claude Desktop中:
向0xABC...123支付5 USDC以获取API调用结果
智能体调用pay(to=0xABC...123, amount=5, token=USDC)。如果在限额内,则立即执行。如果超出限额,则返回请求人工审批。
环境变量
| 变量 | 必填 | 描述 |
|---|
| AGENTPRIVATEKEY | 是 | 智能体的签名密钥(以0x为前缀) |
| RPC_URL |
是 | Polygon JSON-RPC端点 |
| MAX
TXUSDC | 否 | 单笔交易USDC限额(默认:25) |
| MAX
DAILYUSDC | 否 | 每日USDC支出限额(默认:500) |
GitHub
https://github.com/AI-Agent-Economy/agentpay-mcp
许可证
MIT