
Company News
AWS Security Hub Adds Socket for Supply Chain Security
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.
m2mcent-sdk
Advanced tools
Ultra-lightweight x402 payment wrapper for AI Agents and MCP Servers. Monetize any API in 3 lines of code.
Ultra-lightweight x402 payment interceptor for AI Agents and MCP Servers. Monetize any API in 3 lines of code.
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 });
});
M2MCent implements the x402 Payment Protocol — a machine-native payment standard inspired by HTTP 402:
402 Payment Required + payment metadata (Base64 encoded)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
| Parameter | Description | Required |
|---|---|---|
rpcUrl | Base Mainnet RPC endpoint | ✅ |
privateKey | Relayer wallet private key (for settlement) | ✅ |
recipient | Treasury address to receive payments | ✅ |
transferWithAuthorization (USDC native)| Parameter | Value |
|---|---|
| Network | Base Mainnet (Chain ID: 8453) |
| USDC Contract | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Escrow Contract | 0xf3c3416A843d13C944554A54Ac274BB7fF264BcC |
| Settlement | Atomic, sub-second finality |
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 });
});
M2MCent powers 100+ production MCP servers on Base Mainnet, processing real USDC micro-payments for AI-to-AI commerce.
MIT © M2MCent
FAQs
Ultra-lightweight x402 payment wrapper for AI Agents and MCP Servers. Monetize any API in 3 lines of code.
The npm package m2mcent-sdk receives a total of 38 weekly downloads. As such, m2mcent-sdk popularity was classified as not popular.
We found that m2mcent-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.

Research
/Security News
Popular npm packages keyv and cacheable compromised.

Security News
A misconfiguration gave three Anthropic models internet access, and one, believing it was in a simulation, shipped a credential-stealing package to PyPI.