payclaw
payclaw
适用于 MCP 服务器的 x402 支付中间件。让 AI 代理每次工具调用使用 Base 链上的 USDC 付款 — 10 行代码,无需支付处理器,无需 KYC。
资金直接流转:代理钱包 → 你的钱包。payclaw 从不持有资金。
快速开始
Python
pip install payclawfrom fastapi import FastAPI, Request
from payclaw import require_payment, PayclawConfig
app = FastAPI()
config = PayclawConfig(price_usdc=0.001, wallet_address="0xYourWallet")
@app.post("/tool")
@require_payment(config)
async def my_tool(request: Request):
return {"result": "tool output"}JavaScript / TypeScript
npm install payclaw-x402import { requirePayment } from "payclaw-x402";
const gate = requirePayment({ priceUsdc: 0.001, walletAddress: "0xYourWallet" });
export default { fetch: gate.wrapFetch(async (req) => {
return Response.json({ result: "tool output" });
})};Related MCP server: @true402.dev/mcp-server
运作原理
代理调用你的工具端点
无有效付款 → 服务器返回 HTTP 402,附上价格和钱包地址
代理在 Base 链支付 USDC,获取 tx hash
代理携带
X-Payment: <tx_hash>header 重试payclaw 在链上验证 → 执行你的工具
软件包
软件包 | 安装 | 文档 |
Python SDK |
| |
JavaScript SDK |
| |
payclaw Search MCP | — |
在线端点: https://payclaw-mcp.vercel.app/api/mcp
连接 Claude Desktop:
{
"mcpServers": {
"payclaw": {
"command": "npx",
"args": ["mcp-remote", "https://payclaw-mcp.vercel.app/api/mcp"]
}
}
}Base 主网
from payclaw import mainnet_config
config = mainnet_config(price_usdc=0.001, wallet_address="0xYourWallet")const gate = requirePayment({
priceUsdc: 0.001, walletAddress: "0xYourWallet",
network: "base", chainId: 8453,
usdcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
rpcUrl: "https://mainnet.base.org",
});安全性
通过 SQLite (Python) 或 Redis/KV (JS) 实现重放保护
ERC-20 转账事件验证(非
tx.value)链 ID 验证(防止测试网重放攻击)
收据状态检查(拒绝已回滚的交易)
USDC 金额的整数数学运算(无浮点数)
法律声明
MIT 许可证。payclaw 仅为基础设施软件。它不是支付处理器、货币传输商或金融服务。它不托管资金。IP 地址可能仅出于速率限制目的被临时存储。使用风险自负。遵守制裁(OFAC)及适用法规是部署方的责任。
payclaw(繁體中文)
適用於 MCP 伺服器的 x402 支付中介軟體。讓 AI 代理每次工具呼叫使用 Base 鏈上的 USDC 付款 — 10 行程式碼,無需支付處理器,無需 KYC。
資金直接流轉:Agent 錢包 → 你的錢包。payclaw 從不持有資金。
快速開始
Python
pip install payclawfrom fastapi import FastAPI, Request
from payclaw import require_payment, PayclawConfig
app = FastAPI()
config = PayclawConfig(price_usdc=0.001, wallet_address="0x你的錢包")
@app.post("/tool")
@require_payment(config)
async def my_tool(request: Request):
return {"result": "工具輸出"}JavaScript / TypeScript
npm install payclaw-x402import { requirePayment } from "payclaw-x402";
const gate = requirePayment({ priceUsdc: 0.001, walletAddress: "0x你的錢包" });
export default { fetch: gate.wrapFetch(async (req) => {
return Response.json({ result: "工具輸出" });
})};運作原理
Agent 呼叫你的工具端點
無有效付款 → 伺服器返回 HTTP 402,附上價格和錢包地址
Agent 在 Base 鏈支付 USDC,取得 tx hash
Agent 帶上
X-Payment: <tx_hash>header 重試payclaw 在鏈上驗證 → 執行工具
套件
套件 | 安裝 | 文件 |
Python SDK |
| |
JavaScript SDK |
| |
payclaw Search MCP | — |
線上端點: https://payclaw-mcp.vercel.app/api/mcp
法律聲明
MIT 授權。payclaw 僅為基礎設施軟體,並非支付處理器、貨幣傳輸業者或金融服務。本軟體不持有任何資金。使用風險由使用者自行承擔。遵守制裁(OFAC)及相關法規是部署方的責任。
This server cannot be deployed
Maintenance
Related MCP Connectors
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
x402 pay-per-call APIs over MCP, settled in USDC on Base for autonomous agents and developers.
Pay-per-call x402 MCP for AI agents: 35 tools, USDC on Base, from $0.001/call, no API keys.
15 paid AI agent primitives via x402 (USDC on Base). Pay-per-call MCP server.
Related MCP Servers
- AlicenseBqualityBmaintenanceagenticpay lets MCP server developers monetize tools via per-call USDC micropayments on Solana, using the x402 protocol. Each tool declares a price; agents pay via signed Solana transactions; settlement happens on-chain in ~1.5–2 seconds.13MIT
- AlicenseAqualityAmaintenanceAn MCP server that enables AI agents to access paid AI inference and web tools via HTTP 402 micropayments in USDC on Base, using the agent's wallet as identity.36164 npmMIT
- FlicenseAqualityBmaintenanceMCP server for a live x402 payment gateway on Base (USDC). Lets AI agents discover, preview for free, then pay per call — with prepaid gasless payments, signed receipts, and delta delivery.7-
- AlicenseBqualityFmaintenanceAn MCP server providing 22 pay-per-call utility tools for AI agents (scrape, validate, embed, store, moderate, notify, convert, prevent loops) without accounts or API keys, using USDC payments via the x402 protocol.1775 npm1MIT