MCP-Pay
{"type": "text"}
MCP-Pay
一个基于 Algorand 的 HTTP x402 变现层,让 AI 智能体能够以低于一美分、按次调用的方式为 MCP 工具付费。
问题
使用模型上下文协议(MCP)的自主 AI 智能体无法访问付费工具:信用卡、API 密钥和订阅都是面向人类的工作流程。工具创建者无法按次调用收费,而传统区块链对于机器对机器的微支付来说太慢或太贵。
Related MCP server: Loop MCP DualRail
解决方案
MCP-Pay 可将任何 MCP 工具转换为 Algorand 上即时变现的 x402 端点。
智能体在
GET /mcp/v1/tools发现工具(免费,包含 JSON 模式和价格)。智能体在未付款的情况下调用
POST /mcp/v1/tools/:name/execute。服务器返回
402 Payment Required及付款元数据(USDC 价格、接收方地址、网络)。智能体的本地中间件自动签署 Algorand USDC 转账(ASA 31566704)并重试。
GoPlausible 协调器 在链上验证并结算(<3.3 秒最终性),工具执行,结果在一次往返中返回。
无需账户。无需密钥。无需人工。
独特卖点
典型的付费 API | MCP-Pay |
一个硬编码的端点 | 工具注册表:任何工具都能成为带模式定义的有偿服务 |
为人类编写的文档 | 智能体原生发现:智能体以编程方式列出、比较和选择工具 |
订阅 / 预付费积分 | 真正的按次付费,每次请求均在链上结算 |
EVM 的 Gas 费扼杀了微支付 | Algorand:约 0.001 ALGO 费用,3.3 秒最终性 |
包含的付费工具
工具 | 功能 | 价格 |
| 提取任何公共网页的阅读器模式内容,用于 LLM 上下文 | $0.002 |
| 来自无需密钥的公共数据源的实时加密货币现货价格 | $0.001 |
| 对 Solidity 源码进行静态启发式安全扫描 | $0.005 |
架构
┌────────────────────────┐
│ AI AGENT (client/) │ 1. GET /mcp/v1/tools (discovery)
│ auto-paying MCP agent │ 2. POST .../execute → 402 challenge
└───────────┬────────────┘ 3. sign USDC txn locally
│ 4. retry + X-PAYMENT header
▼
┌────────────────────────┐
│ MCP-PAY SERVER (Hono) │ x402 paymentMiddleware protects each tool route
│ registry + tools/* │ executes tool only after verified settlement
└───────────┬────────────┘
▼
┌────────────────────────┐
│ GOPLAUSIBLE FACILITATOR│ /verify + /settle on Algorand TestNet
│ https://facilitator. │ USDC (ASA 31566704) transfer
│ goplausible.xyz │
└────────────────────────┘技术栈
TypeScript、Hono
@x402-avm/extensions(Bazaar 发现)GoPlausible 协调器、Algorand TestNet USDC
本地运行
1. 前提条件
Node.js 18+、pnpm(
npm i -g pnpm)两个已注资的 Algorand TestNet 账户:
服务器钱包(接收方):仅需地址
智能体钱包(付款方):助记词,保存在本地——切勿提交
通过 Lora 水龙头 注资,在 Lora 中将两个账户都选择加入 USDC,然后从 Circle 水龙头 获取 TestNet USDC(选择 Algorand Testnet)。
2. 配置
pnpm install
cp .env.example .env填写 .env:
AVM_ADDRESS=<server wallet address> # receiver
AVM_MNEMONIC="<agent 25-word mnemonic>" # payer, LOCAL ONLY
SERVER_URL=http://localhost:40213. 启动服务器 + 运行智能体
pnpm server # terminal 1
pnpm agent # terminal 2: discovery → 402 → auto-pay → result链上验证
每次成功调用都会在 TestNet 上结算一笔真实交易:
示例结算交易(来自演示运行):
TODO: paste Lora transaction link after first live runAPI
端点 | 付款 | 描述 |
| 免费 | 存活检查 |
| 免费 | 带模式和价格的工具目录 |
| x402 | 执行工具,按次付费 |
路线图
支出策略防护:由中间件执行的每个智能体预算
创建者仪表盘:在几分钟内注册您自己的 MCP 工具并定价
在 GoPlausible 上架 Bazaar,以便任何第三方智能体都能发现 MCP-Pay 工具
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to search, pay for, and call paid APIs using the x402 protocol, with automatic USDC settlement.2MIT
Loop MCP DualRailofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to pay for MCP tool calls using either Bitcoin/Lightning (L402) or USDC (x402) rails, with unified settlement and a 21% discount for Bitcoin payments.32MIT- AlicenseAqualityBmaintenanceEnables MCP clients to access all endpoints of an x402 gateway by paying real-time microtransactions (USDC on Base) per API call, with automatic tool discovery and spend guardrails.2389MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, query, and pay for HTTP endpoints and MCP tools using Stellar USDC/SEP-41 stablecoins through a federated P2P bazaar catalog and x402 payment facilitator.Apache 2.0
Related MCP Connectors
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Agent x402 Paywall MCP — Coinbase HTTP 402 protocol + on-chain settlement. Agents pay per-call
Pay-per-use weather, environment, finance, and on-chain intelligence tools for AI agents via x402.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/challalokesh08/mcp-pay'
If you have feedback or need assistance with the MCP directory API, please join our Discord server