npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

m2mcent-sdk

v1.0.2

Published

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

Readme

🛰️ M2MCent SDK — x402 Payment Wrapper for AI Agents

npm version License: MIT Base Mainnet

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