Warppay402 Gateway
@warppay402/server ⚡
Model Context Protocol(MCP)AIツール、Hono HTTP API、Cloudflare Monetization Gateway、Base、Solana向けの、すぐに使えるx402 V2収益化SDKおよびセルフホスト型インフラストラクチャ。
@warppay402/server を使用すると、開発者は数行のコードで任意のMCPツールやHTTP APIルートを収益化できます。標準的なx402 V2 HTTP支払いチャレンジを自動生成し、ガスレスEIP-712 / Solana L1署名を検証し、プラットフォーム手数料分割を強制し、プロンプトインジェクション攻撃から保護し、署名リプレイ攻撃を防止します。
公式サイト: https://www.warppay402.com
機能
x402 V2準拠: 標準化された支払いチャレンジヘッダー(
PAYMENT-REQUIRED、PAYMENT-SIGNATURE、PAYMENT-RESPONSE)。マルチチェーン対応: Base Mainnet(
eip155:8453)とSolana Mainnet-Beta(solana:5eykt...)を標準サポートするマルチチェーンチャレンジ生成。ガスレス・オフチェーン署名: クライアントは、ノンカストディアルの手間をかけずに
TransferWithAuthorization(Base)または事前署名済みSPL-USDCトランザクション(Solana)に署名できます。プラットフォーム手数料の自動分割: ベーシスポイント単位で設定可能な手数料分割(例: 50 BPS = 0.5%)が、ファシリテーターの決済時に直接ルーティングされます。
x402-Guard セキュリティ: プロンプトインジェクション攻撃、ペイロードバッファオーバーラン、高頻度のトラフィックスパイクからエンドポイントを保護するプリフライトミドルウェア。
MCPネイティブデコレータ: Model Context Protocol用に書かれたツールをシームレスにラップします。
リプレイ保護: 二重支払いや署名の再利用を防ぐため、組み込みの
MemoryNonceStoreと分散型のRedisNonceStoreドライバーを同梱しています。エッジ互換: Node.js専用APIへの依存ゼロ。Cloudflare Workers、Vercel Edge、Node.js(18+)、Denoでシームレスに動作します。
Related MCP server: obolpay-x402-mcp
インストール
npm install @warppay402/server使用例1: マルチチェーンHono HTTP APIの収益化
import { Hono } from "hono";
import { monetize } from "@warppay402/server";
const app = new Hono();
const monetizeConfig = {
payTo: "0xYourMerchantWalletAddress", // Default Base EVM Wallet
platformWallet: "0xYourPlatformTreasuryWallet",
platformFeeBps: 50, // 0.5% fee split
guard: true, // Enables x402-guard security scanning
facilitatorUrl: "http://localhost:3001",
// Multi-Chain 402 Challenge Configuration
accepts: [
{
scheme: "exact",
network: "eip155:8453", // Base Mainnet
asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // Base USDC
payTo: "0xYourMerchantWalletAddress",
},
{
scheme: "exact",
network: "solana:5eykt4wA89m8E5b9B5658p445VTc28", // Solana Mainnet-Beta
asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // SPL-USDC
payTo: "YourSolanaPhantomPublicKey",
}
]
};
app.use(
"/api/data",
monetize({
...monetizeConfig,
price: "0.01", // $0.01 USDC
})
);
app.get("/api/data", (c) => c.json({ status: "success", content: "Monetized Payload" }));
export default app;使用例2: MCP(Model Context Protocol)ツールの収益化
import { createMonetizedMCPTool } from "@warppay402/server";
const originalTool = {
name: "web_scraper",
description: "Extract clean Markdown content from URLs",
inputSchema: { type: "object", properties: { url: { type: "string" } } },
handler: async ({ url }: { url: string }) => {
return { markdown: "# Cleaned Markdown Content" };
}
};
export const monetizedTool = createMonetizedMCPTool(originalTool, {
price: "0.02", // $0.02 USDC
payTo: "0xYourMerchantWalletAddress",
platformWallet: "0xYourPlatformTreasuryWallet",
platformFeeBps: 50
});使用例3: Redis / Upstashによる分散ナンスロック
import { Redis } from "@upstash/redis";
import { monetize, RedisNonceStore } from "@warppay402/server";
const redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL!,
token: process.env.UPSTASH_REDIS_REST_TOKEN!
});
app.use(
"/api/v1/compute",
monetize({
price: "0.10",
payTo: "0xYourMerchantWalletAddress",
platformWallet: "0xYourPlatformTreasuryWallet",
nonceStore: new RedisNonceStore(redis),
nonceTtlSeconds: 300
})
);ライセンス: MIT © WarpPay402
This server cannot be deployed
Maintenance
Related MCP Connectors
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
x402 pay-per-call APIs over MCP, settled in USDC on Base for autonomous agents and developers.
Pay-per-call tools for autonomous agents, settled in USDC on Base via x402.
Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceDrop-in x402 payment middleware for MCP servers. Charge AI agents per tool call using USDC on Base chain — Python and JavaScript SDKs, no payment processor, no KYC.MIT
- FlicenseAqualityBmaintenanceMCP server for a live x402 payment gateway on Base (USDC). Lets AI agents discover, preview for free, then pay per call — with prepaid gasless payments, signed receipts, and delta delivery.7-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, pay for, and sell HTTP APIs using the x402 micropayment protocol, with USDC settlement on Base mainnet. Includes tools for payment requirements, paying and fetching resources, building seller configurations, and monitoring revenue.453 npm1MIT
- AlicenseNot gradedqualityBmaintenanceMonetization gateway for MCP servers, enabling pay-per-call AI agent access with x402 payment challenges and USDC settlement on Base. Developers can register existing MCP servers, set tool prices, and receive payments without handling payment code.32 npmMIT