支付机器人mcp
MCP服务器 PayBot --通过模型上下文协议为AI代理提供支付工具。
安装
npm install paybot-mcp paybot-sdk使用Claude Desktop
增添 claude_desktop_config.json:
{
"mcpServers": {
"paybot": {
"command": "npx",
"args": ["paybot-mcp"],
"env": {
"PAYBOT_API_KEY": "pb_...",
"PAYBOT_FACILITATOR_URL": "https://facilitator.paybot.dev",
"PAYBOT_BOT_ID": "my-agent"
}
}
}
}使用Claude代码
{
"mcpServers": {
"paybot": {
"command": "npx",
"args": ["paybot-mcp"],
"env": {
"PAYBOT_API_KEY": "pb_...",
"PAYBOT_BOT_ID": "my-agent"
}
}
}
}环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
PAYBOT_API_KEY | PayBot API密钥 | (必需) |
PAYBOT_FACILITATOR_URL | 主持人服务器URL | http://localhost:3000 |
PAYBOT_BOT_ID | 默认机器人标识符 | mcp-agent |
PAYBOT_WALLET_KEY | 用于真实支付的钱包私钥 | (可选) |
可用工具
| 工具 | 说明 |
|---|---|
paybot_pay | 为API、服务或资源支付USDC |
paybot_balance | 检查信任级别、支出限制和剩余预算 |
paybot_history | 查看最近的付款历史记录和审计事件 |
paybot_register | 向主持人注册新的机器人 |
paybot_pay
amount: string - Amount in USD (e.g., "0.05")
recipient: string - Recipient wallet address (0x...)
resource: string - URL or description of what you're paying for
botId?: string - Bot identifier (defaults to env)
network?: string - Network CAIP-2 ID (default: Base Sepolia)薪酬平衡
botId?: string - Bot identifier (defaults to env)paybot_历史
botId?: string - Bot identifier (defaults to env)
limit?: number - Max events to return (default: 10)paybot_register
botId: string - Unique bot identifier
trustLevel?: number - Initial trust level 0-5 (default: 1)程序化使用
import { createMcpServer } from 'paybot-mcp/server';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = createMcpServer();
const transport = new StdioServerTransport();
await server.connect(transport);