AgentPay MCP Server
This MCP server lets AI agents make paid API calls (USDC micropayments via x402) to fetch Xiaohongshu (小红书) content and Chinese wholesale pricing data. It also provides payment status. Capabilities include:
xhs_get_note_detail: Fetch note details (title, description, author, stats, images, video) for a Xiaohongshu note URL or ID, with optional note type hint.xhs_get_user_notes: Fetch a paginated list of notes posted by a Xiaohongshu user, using user ID and optional cursor.china_wholesale_pricing_query: Query factory-direct wholesale pricing, MOQ, and supplier verification from Chinese manufacturing hubs (1688/Yiwu), using keyword, optional category filter, and max price.agentpay_payment_status: View current payment configuration (network, amount, spending limits, mode) at no cost.
All paid tools cost 0.01 USDC per call, with payments automatically handled by the server.
Provides tools for fetching Xiaohongshu note details and user-posted note lists, with each API call paid automatically in USDC via the AgentPay gateway.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AgentPay MCP Server Get wholesale prices for wireless earbuds under $3"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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)
{
"mcpServers": {
"agentpay": {
"command": "uvx",
"args": ["mcp-server-agentpay"],
"env": {
"AGENT_PRIVATE_KEY": "0xYourAgentPrivateKey"
}
}
}
}只需填付款钱包私钥(需有 USDC)。网关地址已内置,一般不用改。
或永久安装:
pip install mcp-server-agentpay
# or
uv tool install mcp-server-agentpayRelated MCP server: @bridgenode/mcp
Tools
Tool | Description | Cost |
| Xiaohongshu note detail | 0.01 USDC/call |
| Xiaohongshu user posted notes list | 0.01 USDC/call |
| Factory-direct wholesale pricing (1688/Yiwu) | 0.01 USDC/call |
| View payment config, wallet, and spending limits | Free |
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
Variable | Required | Description |
| Yes(付费工具) | 付款钱包私钥 |
| No | 单次上限(默认 |
| No | 网关地址(默认已指向公网 Gateway) |
How it works
MCP Client → mcp-server-agentpay → x402 Gateway → Paid API
(auto 402 → sign → retry) (verify USDC)Tool call hits a paid API endpoint
Gateway returns
402 Payment Requiredwith USDC payment detailsMCP server signs payment and retries automatically
JSON data flows back to the LLM
Self-host the Gateway
If you operate the paid API, deploy the gateway separately:
pip install "mcp-server-agentpay[gateway]"
# .env: PAYMENT_MODE=production + upstream keys + your receive wallet
agentpay-gatewayReal USDC settlement (x402)
Mode | Behavior |
| Local fake pay (dev only) |
| Official Facilitator verify + settle on-chain |
Testnet (Base Sepolia) — use https://x402.org/facilitator, network eip155:84532.
# Fund a test agent with Sepolia USDC, then:
PYTHONPATH=src python scripts/test_x402_settlement.pyMainnet — 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.
# 1. Publish to PyPI
pip install build twine
python -m build && twine upload dist/*
# 2. Publish to MCP Registry (packages + remotes)
./scripts/publish_all.shOr 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
git clone https://github.com/yyxqqq777/mcp-server-agentpay
cd mcp-server-agentpay
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -vLicense
MIT
Available Tools
4 toolsagentpay_payment_statusCheck AgentPay payment statusARead-onlyIdempotentInspect
Return AgentPay payment configuration without charging: network, price, spending limit, payment mode, gateway URL, and agent wallet address. Call this before paid tools to verify the wallet is configured, or after a payment error.
Inputs: include_wallet. Returns: result
china_wholesale_pricing_queryQuery China wholesale pricingARead-onlyIdempotentInspect
Search factory-direct wholesale pricing samples for a product keyword (1688 / Yiwu style catalog). Returns items with MOQ, unit price USD, factory location, and supplier verification flags. Use for China sourcing research. Settles ~0.01 USDC via x402 per query.
Inputs: keyword (required), max_price, category_id. Returns: result
xhs_get_note_detailGet Xiaohongshu note detailARead-onlyIdempotentInspect
Fetch one Xiaohongshu (小红书) note by share URL or 24-char note_id and return title, description, author, engagement stats, images, and video URL as JSON. Call this when the user pastes an xiaohongshu.com/explore link or a note id. Settles ~0.01 USDC via x402 on each successful call.
Inputs: note (required), note_type. Returns: result
xhs_get_user_notesList Xiaohongshu user notesARead-onlyIdempotentInspect
List posted notes for a Xiaohongshu user_id (paginated). Returns note summaries and next_cursor for pagination. Use when the user asks for a creator's recent posts. Settles ~0.01 USDC via x402 per page.
Inputs: user_id (required), cursor. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct action: payment status check, wholesale pricing search, XHS note detail, and XHS user note listing. The two XHS tools are complementary (single item vs. list) rather than overlapping, so an agent can disambiguate easily.
Names mix conventions: `agentpay_payment_status` and `china_wholesale_pricing_query` are noun-heavy and lack a clear verb, while `xhs_get_note_detail` and `xhs_get_user_notes` follow a get_object pattern. The shared prefixes are helpful, but the action verbs are inconsistent and not uniformly placed.
4 tools is at the low end of a reasonable count. The number is not problematic by itself, but it spans several unrelated domains (payment, China wholesale, Xiaohongshu), making the set feel like a small fragment of a broader service rather than a cohesive server.
The payment domain is represented only by a status check, and the data tools each provide one narrow read operation: wholesale has only a search, and XHS lacks obvious endpoints like search by keyword or fetching user profile/context. This leaves common workflows with no corresponding tool on the server.
Maintenance
Related MCP Connectors
Let an AI agent find and pay for x402 APIs and products in USDC on Base, within owner-set limits.
Real-time Chinese social media trending data for AI agents. x402 USDC settlement on Base mainnet.
Machine-payable API infrastructure for autonomous agents. Per-call x402 settlement in USDC.
Autonomous AI agent selling pay-per-call skills settled with x402 micropayments (USDC).
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to make micropayments using USDC on Solana via the x402 protocol, supporting payment requests, on-chain verification, and revenue tracking.MIT

@bridgenode/mcpofficial
AlicenseAqualityBmaintenanceEnables AI agents to make pay-as-you-go AI inference requests through x402 with automatic Solana USDC payments, no API keys or registration, while enforcing configurable spending limits.3143 npm1MIT No Attribution- AlicenseNot gradedqualityCmaintenanceEnables AI agents to autonomously pay for metered web APIs on a per-call basis, settling x402 v2 USDC micropayments via EIP-3009 authorization on Base Sepolia without human involvement. Spending is bounded by configurable per-call caps and host restrictions, and exposes tools to fetch paywalled URLs and inspect the agent wallet's address and balance.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to make pay-per-call USDC payments on Base via x402 for headless page rendering, temporary file hosting, scheduled callbacks, and pump.fun launch and trend feeds.MIT