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 集成