Back to Browse

M2mcent Sdk MCP Server

by Evozim
Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

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

About

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

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (2 strong, 4 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

4 files analyzed ยท 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

What You'll Need

Set these up before or after installing:

Base Mainnet RPC endpoint URLOptional

Environment variable: BASE_RPC_URL

Relayer wallet private key for on-chain settlementRequired

Environment variable: RELAYER_PRIVATE_KEY

Treasury wallet address to receive paymentsOptional

Environment variable: TREASURY_ADDRESS

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-evozim-m2mcent": {
      "env": {
        "BASE_RPC_URL": "your-base-rpc-url-here",
        "TREASURY_ADDRESS": "your-treasury-address-here",
        "RELAYER_PRIVATE_KEY": "your-relayer-private-key-here"
      },
      "args": [
        "-y",
        "m2mcent-sdk"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub 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

ParameterDescriptionRequired
rpcUrlBase Mainnet RPC endpointโœ…
privateKeyRelayer wallet private key (for settlement)โœ…
recipientTreasury 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

ParameterValue
NetworkBase Mainnet (Chain ID: 8453)
USDC Contract0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Escrow Contract0xf3c3416A843d13C944554A54Ac274BB7fF264BcC
SettlementAtomic, 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

Reviews

No reviews yet

Be the first to review this server!