Skip to main content
Glama

payclaw

English | 繁體中文

ko-fi


MCPサーバー向けのドロップイン型x402決済ミドルウェア。Baseチェーン上のUSDCを使用して、AIエージェントのツール呼び出しごとに課金可能。10行のコードで実装でき、決済プロセッサやKYCは不要です。

資金は直接移動します:エージェントのウォレット → あなたのウォレット。payclawが資金を保持することはありません。


クイックスタート

Python

pip install payclaw
from 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-x402
import { 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

仕組み

  1. エージェントがあなたのツールエンドポイントを呼び出す

  2. 有効な支払いがない場合 → サーバーは価格とウォレットアドレスを含む HTTP 402 を返す

  3. エージェントがBaseチェーンでUSDCを支払い、tx hashを取得する

  4. エージェントが X-Payment: <tx_hash> ヘッダーを付けて再試行する

  5. payclawがオンチェーンで検証 → ツールを実行する


パッケージ

パッケージ

インストール

ドキュメント

Python SDK

pip install payclaw

sdk/python

JavaScript SDK

npm install payclaw-x402

sdk/js

payclaw Search MCP

demo-mcp-server

ライブエンドポイント: 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 Transferイベントの検証 (tx.value ではない)

  • チェーンIDの検証 (テストネットでのリプレイ攻撃を防止)

  • レシートステータスのチェック (失敗したトランザクションを拒否)

  • USDC金額の整数演算 (浮動小数点数を使用しない)


法的免責事項

MITライセンス。payclawはインフラストラクチャソフトウェアに過ぎません。決済プロセッサ、資金移動業者、金融サービスではありません。資金の保管は行いません。IPアドレスはレート制限の目的でのみ一時的に保存される場合があります。自己責任でご利用ください。制裁(OFAC)および適用される規制の遵守は、デプロイ側の責任となります。


payclaw(繁體中文)

ko-fi

適用於 MCP 伺服器的 x402 支付中介軟體。讓 AI 代理每次工具呼叫使用 Base 鏈上的 USDC 付款 — 10 行程式碼,無需支付處理器,無需 KYC。

資金直接流轉:Agent 錢包 → 你的錢包。payclaw 從不持有資金。


快速開始

Python

pip install payclaw
from 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-x402
import { requirePayment } from "payclaw-x402";

const gate = requirePayment({ priceUsdc: 0.001, walletAddress: "0x你的錢包" });

export default { fetch: gate.wrapFetch(async (req) => {
  return Response.json({ result: "工具輸出" });
})};

運作原理

  1. Agent 呼叫你的工具端點

  2. 無有效付款 → 伺服器返回 HTTP 402,附上價格和錢包地址

  3. Agent 在 Base 鏈支付 USDC,取得 tx hash

  4. Agent 帶上 X-Payment: <tx_hash> header 重試

  5. payclaw 在鏈上驗證 → 執行工具


套件

套件

安裝

文件

Python SDK

pip install payclaw

sdk/python

JavaScript SDK

npm install payclaw-x402

sdk/js

payclaw Search MCP

demo-mcp-server

線上端點: https://payclaw-mcp.vercel.app/api/mcp


法律聲明

MIT 授權。payclaw 僅為基礎設施軟體,並非支付處理器、貨幣傳輸業者或金融服務。本軟體不持有任何資金。使用風險由使用者自行承擔。遵守制裁(OFAC)及相關法規是部署方的責任。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
9hResponse time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TeaBay/payclaw'

If you have feedback or need assistance with the MCP directory API, please join our Discord server