OWS Hackathon 2026 · Track 03 · Live on Base Sepolia

Monetize Any
MCP Tool
in 3 Lines

The first native monetization layer for Model Context Protocol servers. No API keys, no subscriptions, no accounts — just an OWS Wallet and an HTTP request.

Installnpm install @nikhilraikwar/mcpay
x402 Payment ProtocolOWS CLI Wallet SigningBase Sepolia USDCXMTP Wallet ReceiptsZerion Real BalancesDynamic Surge PricingAIML API InferenceClaude · GPT-4o · GeminiNo API Keys — EverAgent-Native Paymentsnpm i @nikhilraikwar/mcpayLive on Base Sepoliax402 Payment ProtocolOWS CLI Wallet SigningBase Sepolia USDCXMTP Wallet ReceiptsZerion Real BalancesDynamic Surge PricingAIML API InferenceClaude · GPT-4o · GeminiNo API Keys — EverAgent-Native Paymentsnpm i @nikhilraikwar/mcpayLive on Base Sepolia
Protocol Flow

How MCPay Works

01
Agent Sends HTTP POST
An autonomous Claude or GPT agent calls any MCPay-wrapped tool endpoint via standard HTTP. Zero agent-side changes — works with any MCP client.
Standard HTTP
02
402 Payment Required
MCPay middleware intercepts instantly, returning HTTP 402 with x402 headers: USDC amount, destination OWS wallet, and Base Sepolia chain ID.
x402 Protocol
03
OWS Wallet Signs
The agent's OWS CLI evaluates spend policy (maxPrice, chain allowlist), signs the USDC transfer with its private key, and broadcasts to Base Sepolia.
OWS CLI + EIP-155
04
x402 Verifies On-Chain
MCPay's x402 facilitator confirms the on-chain USDC transfer. Only after cryptographic verification does the tool execute and return results.
Trustless
05
XMTP Notifications
Owner receives XMTP wallet notification instantly. Every request generated a cryptographically signed receipt stored directly in the agent's XMTP inbox — verifiable on-chain.
On-Chain Proof
Integration

One Middleware.
Any Tool.

import express from 'express'
import { mcpay } from '@nikhilraikwar/mcpay'  // npm i @nikhilraikwar/mcpay

const app = express()

// ── TOOL 1: Weather — $0.01 flat ──
app.use(...mcpay({
  price:         '$0.01',
  walletAddress: process.env.TOOL_WALLET_ADDRESS,
  toolName:      'weather-data',
  description:   'Real-time weather for any city',
}))

// ── TOOL 2: AI Inference — dynamic pricing by model ──
app.use(...mcpay({
  price:         (req) => getDynamicPrice(req.body.model),
  walletAddress: process.env.TOOL_WALLET_ADDRESS,
  toolName:      'ai-inference',
  description:   'Pay-per-inference across 5 AI models',
}))
Partner Stack

Integrations That
Win Prizes

OWS + x402
Core Protocol
Every payment in MCPay flows through OWS CLI for wallet signing and x402 for protocol enforcement. Agents never share private keys — OWS signs every USDC transfer autonomously using its policy engine.
OWS spend policy: maxPrice, chain allowlist, vendor restrictions
x402 facilitator verifies on-chain USDC before tool executes
Settlement on Base Sepolia — every tx verifiable on Basescan
💬
XMTP
Shipped
Every OWS payment triggers a wallet-native XMTP message — no email, no webhooks. Tool owner gets a push notification instantly. Agent receives a cryptographically signed receipt.
Tool owner alert: '0xCc9A paid $0.01 for weather-data'
Agent receipt stored in XMTP conversation as on-chain proof
Built with @xmtp/node-sdk — decentralised, censorship-resistant
Zerion API
Live Balance
Dashboard shows real USDC earned — not a fake counter. Zerion API pulls live wallet balance, DeFi positions, and decoded transaction history for the OWS tool wallet.
Real-time USDC balance from Base Sepolia on-chain state
Per-transaction earnings visible immediately after settlement
Portfolio P&L tracking — proves actual revenue, not simulation
🧠
AIML API
Dynamic Pricing
MCPay is the first x402 inference marketplace. Each AI model has its own price tier — Claude Opus at $0.05, Llama at $0.001. Surge multiplier activates under queue pressure. OWS policy prevents overpay.
5 models live: Claude, GPT-4o, Gemini, Llama, Sonnet
Surge pricing (1x–10x) based on real queue depth
OWS maxPrice ceiling — agent budget is always enforced
Developer SDK

mcpay — The Full SDK

mcpay middleware
npm install @nikhilraikwar/mcpay
3-line Express middleware. Wraps any route with x402 enforcement, OWS wallet destination, XMTP notification dispatch, and stats tracking. Ships to npm.
Shipped ✓
x402 Agent Client
ows pay request <url> --wallet mcpay-agent
OWS CLI is the agent's payment engine. Evaluates spend policy, signs USDC transfers on Base Sepolia, and retries the original request after settlement.
Shipped ✓
AI Playground
localhost:3000 → AI Playground tab
ChatGPT-style interface where any prompt triggers a real agent loop: Plan → OWS Pay → Execute → Respond. Full live demo with payment receipts visible.
Shipped ✓
XMTP Notifier
import { sendPaymentAlert } from './xmtp'
On every x402 settlement, MCPay sends a wallet-to-wallet XMTP message to the tool owner. Receipt goes to agent's XMTP inbox. No email, no config.
Shipped ✓
Registry API
GET /tools · GET /stats · GET /agent-logs
MCPay server exposes a full REST API. Agents auto-discover tools, prices, and chains. Dashboard polls live stats, earnings, and settlement history.
Shipped ✓
mcpay CLI
npx mcpay wrap --port 3001 --price $0.01
Wrap any HTTP server with x402 payments from the terminal. Zero code changes — point it at a running port. Planned for next release of the mcpay npm package.
Coming Soon
// Agent-side: mcpayFetch auto-handles 402 + OWS payment
import { mcpayFetch } from '@nikhilraikwar/mcpay'

const result = await mcpayFetch('http://localhost:3001/tools/weather-data', {
  method:    'POST',
  body:      JSON.stringify({ city: 'Delhi' }),
  owsWallet: 'mcpay-agent',   // OWS wallet name
  maxPrice:  '$0.05'            // OWS policy ceiling
})
// → { city: 'Delhi', temperature: '28°C', _mcpay: { paid: '$0.01' } }
// 402 intercepted → OWS CLI pays → result returned automatically
AIML API Integration

Dynamic Inference Pricing

MCPay wraps AIML API behind x402 with per-model pricing. The first pay-per-inference layer that covers Track 03 and Track 04 simultaneously.

ModelBase PriceSurge (10x)Status
claude-opus-4-6
Anthropic via AIML API
$0.05
$0.50
Live
gpt-4o
OpenAI via AIML API
$0.03
$0.30
Live
claude-sonnet-4-6
Anthropic via AIML API
$0.02
$0.20
Live
gemini-2.0-flash
Google via AIML API
$0.005
$0.05
Live
llama-3.3-70b
Meta via AIML API
$0.001
$0.01
Live
deepseek-r1
DeepSeek via AIML API
$0.001
$0.01
Soon

Surge pricing activates when queue depth > 10 concurrent requests. OWS policy maxPrice ceiling prevents agents from overpaying.

Why MCPay

Built for the
Agentic Economy

3-Line Middleware
app.use(mcpay({ price:'$0.01', walletAddress })) — works on any Express route. No restructuring, no new infra. Ship in minutes.
🔐
OWS Wallet Native
Agents sign every payment with OWS CLI. No shared secrets, no API keys. Private key never leaves the agent's machine. Fully self-sovereign.
💬
XMTP Push Receipts
Real-time wallet-to-wallet XMTP alert on every settlement. Owners know instantly when paid. Agents get a signed receipt in their inbox.
📊
On-Chain Proof
Every dollar earned is a real USDC transfer on Base Sepolia. Zerion API shows live balance. Basescan link on every transaction. Nothing is simulated.
💹
Surge Pricing Engine
Static or dynamic price functions. claude-opus-4-6 costs $0.05, llama-3.3-70b costs $0.001. Queue-depth surge 1x–10x — first of its kind on x402.
🛡
OWS Spend Governance
OWS policy engine enforces maxPrice ceiling, chain allowlists, and vendor restrictions before signing. Agents can never be drained or overspend.