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
Visit Server

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured