AgentPay

io.github.yyxqqq777由 GitHub 帳號 yyxqqq777 發布v0.1.3更新於 Nov 2, 2026

x402 micropayments MCP: Xiaohongshu notes and paid APIs settled in USDC on Base.

發布方自己的服務:AgentPay — Pay-per-call AI Microservices

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取金融

概覽

AI 產生的概覽

AgentPay 讓助理透過 x402 微支付,以 Base 上的 USDC 按次付費,取得小紅書筆記與批發價格資料。

可以做什麼
  • 依連結取得小紅書筆記詳情
  • 列出小紅書使用者已發布的筆記清單
  • 查詢 1688 與義烏的工廠直供批發價格
  • 免費檢視付款設定、錢包地址與消費上限
  • 收到 402 回應後自動簽署付款並重試請求
適用情境
當你希望助理取得位於付費 x402 API 之後的小紅書筆記內容或批發價格資料,並願意用 Base 上的 USDC 錢包支付少量按次費用時適用。
執行需求
可使用遠端端點,或以 uvx、pip 在本機執行 PyPI 套件(需要 Python)。付費工具需要環境變數 AGENT_PRIVATE_KEY,即持有 Base 上 USDC 的 EVM 錢包私鑰。MAX_SPEND_PER_CALL 與 GATEWAY_BASE_URL 為選用。需要能連線至閘道的網路。
安裝前請注意
此伺服器需要錢包私鑰(AGENT_PRIVATE_KEY),並在 Base 上簽署真實的 USDC 付款,呼叫會花錢;請使用小額錢包並把 MAX_SPEND_PER_CALL 設低。請求與付款資訊會傳送給第三方閘道。免費的狀態工具僅讀取設定。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 AgentPay,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.yyxqqq777%2Fagentpay/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "agentpay": {
      "type": "http",
      "url": "https://agentpay-xhs-production.up.railway.app/mcp"
    }
  }
}

README

AgentPay MCP Server

Agent-to-Agent micropayments via x402 + MCP — let AI agents autonomously pay for API access with USDC on Base.

Install

Option A — Remote MCP(推荐,无需本地安装)

在 Cursor / Claude / 任意支持 Streamable HTTP 的客户端添加:

https://agentpay-xhs-production.up.railway.app/mcp

官方 Registry 条目:io.github.yyxqqq777/agentpay

Option B — 本地 stdio(uvx / PyPI)

json
{  "mcpServers": {    "agentpay": {      "command": "uvx",      "args": ["mcp-server-agentpay"],      "env": {        "AGENT_PRIVATE_KEY": "0xYourAgentPrivateKey"      }    }  }}

只需填付款钱包私钥(需有 USDC)。网关地址已内置,一般不用改。

或永久安装:

bash
pip install mcp-server-agentpay# oruv tool install mcp-server-agentpay

Tools

ToolDescriptionCost
xhs_get_note_detailXiaohongshu note detail0.01 USDC/call
xhs_get_user_notesXiaohongshu user posted notes list0.01 USDC/call
china_wholesale_pricing_queryFactory-direct wholesale pricing (1688/Yiwu)0.01 USDC/call
agentpay_payment_statusView payment config, wallet, and spending limitsFree

Example prompts

  • "帮我看看这条小红书笔记写了什么:https://www.xiaohongshu.com/explore/..."
  • "拉一下这个博主最近发的笔记,user_id=..."
  • "Search wholesale prices for wireless earbuds under $3"
  • "What's my AgentPay wallet and spending limit?"

Environment Variables

VariableRequiredDescription
AGENT_PRIVATE_KEYYes(付费工具)付款钱包私钥
MAX_SPEND_PER_CALLNo单次上限(默认 0.10)
GATEWAY_BASE_URLNo网关地址(默认已指向公网 Gateway)

How it works

MCP Client  →  mcp-server-agentpay  →  x402 Gateway  →  Paid API              (auto 402 → sign → retry)   (verify USDC)
  1. Tool call hits a paid API endpoint
  2. Gateway returns 402 Payment Required with USDC payment details
  3. MCP server signs payment and retries automatically
  4. JSON data flows back to the LLM

Self-host the Gateway

If you operate the paid API, deploy the gateway separately:

bash
pip install "mcp-server-agentpay[gateway]"# .env: PAYMENT_MODE=production + upstream keys + your receive walletagentpay-gateway

Real USDC settlement (x402)

ModeBehavior
PAYMENT_MODE=demoLocal fake pay (dev only)
PAYMENT_MODE=productionOfficial Facilitator verify + settle on-chain

Testnet (Base Sepolia) — use https://x402.org/facilitator, network eip155:84532.

bash
# Fund a test agent with Sepolia USDC, then:PYTHONPATH=src python scripts/test_x402_settlement.py

Mainnet — set PAYMENT_NETWORK=eip155:8453 and a mainnet facilitator (https://api.cdp.coinbase.com/platform/v2/x402 or PayAI). USDC goes to WALLET_RECIPIENT_ADDRESS.

See .env.example.

Publish to MCP Registry

This package is designed for the official MCP Registry.

bash
# 1. Publish to PyPIpip install build twinepython -m build && twine upload dist/*
# 2. Publish to MCP Registry (packages + remotes)./scripts/publish_all.sh

Or create a GitHub Release (v0.1.0) — Actions uses Trusted Publishing to PyPI then updates the Registry.

Before publishing, update server.json and README mcp-name with your GitHub namespace (io.github.<username>/agentpay).

Development

bash
git clone https://github.com/yyxqqq777/mcp-server-agentpaycd mcp-server-agentpaypython -m venv .venv && source .venv/bin/activatepip install -e ".[dev]"pytest tests/ -v

License

MIT

來源:README.md,提交 7a83171

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

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

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Agentpay 整合