MCP-Pay

MCP-Pay

Enables AI agents to discover and pay for MCP tools on a sub-cent, pay-per-call basis using x402 and Algorand USDC settlements.

Category
访问服务器

README

MCP-Pay

An HTTP x402 monetization layer on Algorand that lets AI agents pay for MCP tools on a sub-cent, pay-per-call basis.

Screenshots

Landing page Tool catalog
Agent payment settlement On-chain proof on Lora

(All six captures live in docs/.)

Problem

Autonomous AI agents using the Model Context Protocol (MCP) cannot access paid tools: credit cards, API keys, and subscriptions are human workflows. Tool creators have no way to charge per call, and legacy chains are too slow or expensive for machine-to-machine micropayments.

Solution

MCP-Pay converts any MCP tool into an instantly monetized x402 endpoint on Algorand.

  1. An agent discovers tools at GET /mcp/v1/tools (free, includes JSON schemas + prices).
  2. The agent invokes POST /mcp/v1/tools/:name/execute without payment.
  3. The server answers 402 Payment Required with payment metadata (price in USDC, receiver address, network).
  4. The agent's local middleware auto-signs an Algorand USDC transfer (ASA 31566704) and retries.
  5. The GoPlausible facilitator verifies and settles on-chain (<3.3s finality), the tool executes, and results return in one round-trip.

No accounts. No keys. No humans.

USP

Typical paid API MCP-Pay
One hardcoded endpoint Tool registry: any tool becomes a priced service with a schema
Docs written for humans Agent-native discovery: agents list, compare, and select tools programmatically
Subscriptions / prepaid credits True pay-per-call settled on-chain per request
EVM gas kills micropayments Algorand: ~0.001 ALGO fee, 3.3s finality

Paid Tools Included

Tool What it does Price
web_research Reader-mode extraction of any public web page for LLM context $0.002
market_data Live crypto spot prices from a keyless public feed $0.001
contract_audit Static heuristic security scan of Solidity source $0.005

Architecture

┌────────────────────────┐
│   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       │
└────────────────────────┘

Tech Stack

Run Locally

1. Prerequisites

  • Node.js 18+, pnpm (npm i -g pnpm)
  • Two funded Algorand TestNet accounts:
    • Server wallet (receiver): address only
    • Agent wallet (payer): mnemonic, kept local — never committed

Fund via Lora faucet, opt both into USDC in Lora, then get TestNet USDC from the Circle faucet (choose Algorand Testnet).

2. Configure

pnpm install
cp .env.example .env

Fill .env:

AVM_ADDRESS=<server wallet address>          # receiver
AVM_MNEMONIC="<agent 25-word mnemonic>"      # payer, LOCAL ONLY
SERVER_URL=http://localhost:4021

3. Start server + run agent

pnpm server        # terminal 1
pnpm agent         # terminal 2: discovery → 402 → auto-pay → result

Live Deployment

Production server running on Railway:

https://mcp-pay-production.up.railway.app

Try it: GET /health or browse GET /mcp/v1/tools — then pay with any x402 client.

Verify On-Chain

Every successful call settles a real TestNet transaction:

Verified settlements from actual demo runs:

Tool Price Transaction
web_research $0.002 PNSX3OTXTMP5V7JEDDWD2G3H7KS3R7NTB2DO4RFXNR3URYUCPPPQ
market_data $0.001 E4OFWPYIXJNGWRYMAJIA2EZOBAQXZ7HI4UOBOFRZPLLNGPAKMZKA
contract_audit $0.005 settled (see facilitator dashboard)
market_data (production) $0.001 DUITAVSQ3TU7WNHMQSNGHXBHG6MFEIBNYJY5HAYC2NNZVG5244YQ

API

Endpoint Payment Description
GET /health free liveness
GET /mcp/v1/tools free tool catalog with schemas + prices
POST /mcp/v1/tools/:name/execute x402 execute a tool, pay-per-call

Roadmap

  • Spend-policy guard: per-agent budgets enforced by the middleware
  • Creator dashboard: register your own MCP tool + price in minutes
  • Bazaar listing at GoPlausible so any third-party agent can discover MCP-Pay tools

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选