Warpay402 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 支付挑战,验证无 Gas 的 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...)生成多链挑战。无 Gas 链下签名: 客户端签署
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 的分布式 Nonce 锁定
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 installed
Maintenance
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 gradedqualityBmaintenanceProduction-grade suite of monetized tools for autonomous AI agent-to-agent commerce, enabling payments and task execution via x402 protocol and MCP.223MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.2231MIT
Related MCP Connectors
Monetize any MCP server: x402 paywall, pay-per-call billing in USDC on Base, agent marketplace.
Pay for HTTP APIs and charge for your own: x402 micropayments in USDC on Base.
Agent-commerce MCP server for x402/USDC payments and affiliate splits on Base.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/golfgolfgolf200/warppay402-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server