M2mcent

io.github.Evozim由 GitHub 帳號 Evozim 發布v1.0.5更新於 Oct 24, 2026

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

概覽

AI 產生的概覽

M2mcent 是 x402 付款封裝 SDK,讓助理或 MCP 伺服器在 Base L2 上對受保護的 API 端點收取 USDC 微付款。

可以做什麼
  • 用一次 requirePayment 呼叫把 Express API 或 MCP 工具端點包進 USDC 付費牆
  • 回傳 HTTP 402 付款中繼資料,並接受付費代理簽署的 EIP-712 / EIP-3009 授權
  • 透過 Base 主網上的 M2mcent 託管合約原子化結算付款
  • 回傳付費回應以及結算交易收據
  • 清單中未列出具體工具;此套件是嵌入自有伺服器程式的函式庫。
適用情境
適合在自建 API 或 MCP 伺服器上依請求向其他代理收取 Base 上的 USDC,或需要為現有端點快速加上 x402 付費牆的情境。
執行需求
以 npm 套件 m2mcent-sdk 在本機透過 stdio 執行。需要 Base 主網 RPC 端點網址(BASE_RPC_URL)、中繼錢包私鑰(RELAYER_PRIVATE_KEY)與收款金庫位址(TREASURY_ADDRESS),並需能連線 Base 網路及一個有資金的中繼錢包用於結算。
安裝前請注意
需要錢包私鑰(RELAYER_PRIVATE_KEY)來簽署鏈上結算,私鑰外洩會危及該錢包資金,建議使用專用且餘額很少的中繼錢包。它會轉移 Base 主網上的真實 USDC,設定錯誤可能把資金送到錯誤的金庫位址。README 中關於非託管、付款方免 gas 與採用規模的說法屬廠商自述,此處未獨立查證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 M2mcent,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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

bash
npm install m2mcent-sdk
typescript
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 paywallapp.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 + metadataAgent ◄── signs EIP-712 authorizationAgent ──► API Server + Payment-Signature header          └──► Escrow.settle() on Base L2Agent ◄── 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:

typescript
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 monetizableapp.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

來源:README.md,提交 88718c8

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.5最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分