微支付网关服务器

x402 Payment Gateway MCP Server是一个基于Solana区块链的微支付网关服务器,支持AI代理之间的USDC小额支付,提供支付请求创建、链上验证、工具定价、收入跟踪和支付历史等功能。

  • by AiAgentKarl
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 AiAgentKarl/x402-mcp-server

使用说明

x402支付网关MCP服务器💰

启用MCP服务器 人工智能代理之间的小额支付 在Solana上使用USDC。基于 x402协议 (需要HTTP 402付款)。

什么是x402?

x402是一种让AI代理自动支付服务费用的协议。当代理调用高级工具时,它会收到“402 Payment Required”响应和付款指令。代理人通过区块链支付,然后获得访问权限。

特性

  • 支付请求 --为任何工具创建x402兼容的付款请求
  • 链上验证 --直接在Solana上验证USDC付款
  • 工具定价 --为单个工具设置每次通话的价格
  • 收入跟踪 --按工具细分的总收入仪表板
  • 支付记录 --所有交易的完整审计跟踪

安装

pip install x402-mcp-server

配置

设置您的商家钱包 .env:

MERCHANT_WALLET=YourSolanaWalletAddress
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

使用Claude代码

{
  "mcpServers": {
    "x402": {
      "command": "uvx",
      "args": ["x402-mcp-server"],
      "env": {
        "MERCHANT_WALLET": "YourSolanaWalletAddress"
      }
    }
  }
}

工具

工具 说明
create_payment_request 为工具创建402付款请求
verify_payment 验证链上USDC支付
get_payment_status 检查付款状态
set_tool_price 为工具设定价格
get_price_list 查看所有工具价格
list_payments 付款历史记录
get_revenue 收入统计

流动

Agent A                    x402 Gateway                 Agent B (Service)
   |                           |                             |
   |-- "Use premium tool" ---->|                             |
   |                           |-- 402 Payment Required ---->|
   |<-- Payment instructions --|                             |
   |                           |                             |
   |-- USDC payment on-chain ->|                             |
   |                           |-- verify_payment ---------->|
   |                           |<-- verified ----------------|
   |<-- Access granted --------|                             |

AiAgentKarl提供的更多MCP服务器

类别 服务器
🔗 区块链 索拉纳
🌍 数据 天气 · 德国 · 农业 · 太空 · 航空 · 欧盟公司
🔒 安全 网络安全 · 策略网关 · 审计跟踪
🤖 代理基础设施 记忆 · 目录 · 中心 · 声誉
🔬 研究 学术的 · LLM基准 · 法律

→ 完整目录(40+台服务器)

许可证

麻省理工学院