AgentPay

io.github.yyxqqq777Published by GitHub account yyxqqq777v0.1.3Updated Nov 2, 2026

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

The publisher's own server: AgentPay — Pay-per-call AI Microservices

VerifiedStreamable HTTPWeb executableWeb Search & ScrapingFinance

Overview

AI-generated overview

AgentPay lets an assistant pay per call in USDC on Base to fetch Xiaohongshu notes and wholesale pricing through x402 micropayments.

What you can do
  • Fetch a Xiaohongshu note's detail for a given link
  • List the notes a Xiaohongshu user has posted
  • Query factory-direct wholesale prices from 1688 and Yiwu
  • Check payment configuration, wallet address and spending limits for free
  • Sign and retry paid requests automatically after a 402 response
When to use it
Useful when you want an assistant to pull Xiaohongshu note content or wholesale price data that sits behind a paid x402 API, and you are willing to fund a wallet with USDC on Base for small per-call charges.
Requirements
A remote endpoint is available, or run the PyPI package locally with uvx or pip, which needs Python. Paid tools require the AGENT_PRIVATE_KEY environment variable holding an EVM wallet private key funded with USDC on Base. MAX_SPEND_PER_CALL and GATEWAY_BASE_URL are optional. Network access to the gateway is needed.
Before you install
The server needs a wallet private key (AGENT_PRIVATE_KEY) and signs real USDC payments on Base, so calls spend money; keep the wallet small and set MAX_SPEND_PER_CALL low. Requests and payment details go to a third-party gateway. The free status tool only reads configuration.

Installation

In SourceWeft

  1. Open AgentPay in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Web executable via Streamable HTTP. Remote servers run from the web runtime once configured in a workspace.

Use with an agent

Paste this prompt into Claude Code, Codex, Cursor or another agent — or into SourceWeft chat. The agent reads this server's install guide, shows you its publisher, endpoint and sign-in, and adds it to your client once you agree. Keys never go into a command.

Read https://sourceweft.com/mcp/io.github.yyxqqq777%2Fagentpay/install.md and connect the MCP server it describes to my client. Before changing any config, show me its publisher, endpoint and sign-in method and wait for my OK. Never put an API key in a command or in a file I would commit; ask me where it should come from.

Read the install guide the agent follows

Other MCP clients

Add this to your client's mcpServers config.

{
  "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

Source: README.md at commit 7a83171

Tools

0
SourceWeft has not read this server's tools yet.

Version history

1
  1. v0.1.3LatestSep 16, 2026

Score

85% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 daysRequired25 pts
  • Auth declaredRequired10 pts
  • Tools listedRequired15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Agentpay integrations