QuinnYates/tomopay-gateway
Payment gateway for MCP servers — monetize your tools with one wrapper. Supports x402, MPP, and Stripe.
Platform-specific configuration:
{
"mcpServers": {
"tomopay-gateway": {
"command": "npx",
"args": [
"-y",
"tomopay-gateway"
]
}
}
}Add the config above to .claude/settings.json under the mcpServers key.
[](https://npmjs.com/package/agentic-mcp-pay) [](LICENSE)
Payment gateway for MCP servers — monetize your tools with one wrapper
Wrap any Model Context Protocol server with payment enforcement. Agents call your tools normally; the gateway intercepts, issues a payment challenge, verifies the proof, then executes. One function. No protocol lock-in.
npm install agentic-mcp-payRequires Node.js 18+.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { withPayments } from "agentic-mcp-pay";
const server = new McpServer({ name: "my-tools", version: "1.0.0" });
server.tool("analyze-data", {}, async (args) => {
return { content: [{ type: "text", text: "analysis result" }] };
});
const { server: paidServer, cleanup, dashboardUrl } = withPayments(server, {
pricing: {
"analyze-data": { amount: 0.50, currency: "usd" },
},
payTo: "0xYourWalletAddress",
protocols: ["x402"],
dashboard: { port: 3100 },
});
// Connect to transport as normal
// paidServer.connect(transport);| Protocol | Description | |----------|-------------| | x402 | Stablecoin micropayments (USDC on Base) via Coinbase facilitator | | mpp | Machine Payments Protocol (Stripe/Tempo) | | stripe | Traditional card payments via Stripe PaymentIntents | | mock | In-memory stub for testing — always verifies |
Agent calls tool
│
▼
Gateway checks pricing table
│
├─ No price set ──────────────────► Execute immediately (passthrough)
│
├─ No _payment arg ───────────────► Return PAYMENT_REQUIRED + challenge
│
└─ _payment arg present
│
▼
Loading reviews...