Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

x402 payment wrapper for AI Agents and MCP Servers. USDC settlements on Base L2.

README.md

🛰️ M2MCent SDK — x402 Payment Wrapper for AI Agents

![npm version](https://www.npmjs.com/package/m2mcent-sdk) ![License: MIT](https://opensource.org/licenses/MIT) ![Base Mainnet](https://base.org)

Ultra-lightweight x402 payment interceptor for AI Agents and MCP Servers. Monetize any API in 3 lines of code.

🚀 Quick Start

npm install m2mcent-sdk
import { X402Handler } from 'm2mcent-sdk';

const x402 = new X402Handler({
  rpcUrl: 'https://mainnet.base.org',
  privateKey: process.env.RELAYER_PRIVATE_KEY!,
  recipient: process.env.TREASURY_ADDRESS!
});

// Protect any Express endpoint with a USDC paywall
app.post('/api/analyze', x402.requirePayment("100000"), (req, res) => {
  res.json({ result: "Premium analysis complete", receipt: req.paymentTx });
});

📐 How It Works

M2MCent implements the x402 Payment Protocol — a machine-native payment standard inspired by HTTP 402:

  1. Agent requests a protected endpoint
  2. Server responds with 402 Payment Required + payment metadata (Base64 encoded)
  3. Agent signs an EIP-712 typed data authorization (gasless for the payer)
  4. Server settles atomically on-chain via the M2MCent Escrow contract
  5. Agent receives the premium response + transaction receipt
Agent ──► API Server ──► 402 + metadata
Agent ◄── signs EIP-712 authorization
Agent ──► API Server + Payment-Signature header
          └──► Escrow.settle() on Base L2
Agent ◄── Premium Response + tx hash

⚙️ Configuration

| Parameter | Description | Required | |:---|:---|:---| | rpcUrl | Base Mainnet RPC endpoint | ✅ | | privateKey | Relayer wallet private key (for settlement) | ✅ | | recipient | Treasury address to receive payments | ✅ |

🔒 Security

  • Non-custodial: Funds flow directly from payer → treasury via on-chain escrow
  • Gasless for payers: Uses EIP-3009 transferWithAuthorization (USDC native)
  • Zero-Leak: No agent data is retained after settlement
  • Atomic: Payment and service delivery happen in a single request cycle

🌐 Network Details

| Parameter | Value | |:---|:---| | Network | Base Mainnet (Chain ID: 8453) | | USDC Contract | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | | Escrow Contract | 0xf3c3416A843d13C944554A54Ac274BB7fF264BcC | | Settlement | Atomic, sub-second finality |

🧩 MCP Server Integration

Perfect for Model Context Protocol servers:

import express from 'express';
import { X402Handler } from 'm2mcent-sdk';

const app = express();
const x402 = new X402Handler({
  rpcUrl: process.env.BASE_RPC_URL!,
  privateKey: process.env.RELAYER_PRIVATE_KEY!,
  recipient: process.env.TREASURY_ADDRESS!
});

// Any MCP tool endpoint becomes monetizable
app.post('/api/tools/analyze', x402.requirePayment("50000"), async (req, res) => {
  const result = await runMCPTool(req.body);
  res.json({ ...result, paymentTx: req.paymentTx });
});

📊 Ecosystem

M2MCent powers 100+ production MCP servers on Base Mainnet, processing real USDC micro-payments for AI-to-AI commerce.

📄 License

MIT © M2MCent

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Finance & Payments servers.