MCPaid Logo MCPaid Developer Portal docs.md support
Checking session isolate...
auth@mcpaid.dev: /login
EIP-712 / 2FA
root@mcpaid:~# Developer Account Login

Authenticate with passwordless two-factor email verification to access your MCP servers and earnings.

>
>

Can also be updated at any time in the dashboard.

Transactional 6-digit one-time passcodes delivered via Cloudflare Workers.

DISPATCHED 6-DIGIT CHALLENGE TO:
Available For Payout Net 97% · min $1
$0.0000 USDC
Lifetime Gross Volume
$0.0000 USDC

Gross processed across servers

Platform Fee Cut (3%)
$0.0000 USDC

Automated protocol fee split

Total Paid Tool Calls
0 calls

Autonomous AI executions

Connected Payout Wallets (Base L2)
0x...
>> Monetized MCP Servers
Loading servers...
>> Real-Time Transaction Ledger
TIMESTAMP TOOL AGENT_WALLET GROSS DEV_PAYOUT (97%) PROTOCOL_RAIL
No transactions recorded yet. Invocations stream live automatically.
>> Base L2 Payout & Withdrawal History
Chain ID: 8453 (Base Mainnet)
TIMESTAMP AMOUNT DESTINATION_WALLET STATUS SETTLEMENT_REF
No withdrawal requests recorded yet. Withdraw your balance (minimum $1.00) using >_ Withdraw to Base L2.
[KEY] DEVELOPER API SECRET tp_live_...

Use in Authorization header: Bearer tp_live_... for programmatic configuration.

[BRIDGE] AGENT STDIO CONNECTOR
npx @mcpaid/sdk bridge --gateway https://mcpaid.dev/mcp/<serverId>

Configure Claude Desktop or Cursor to sign EIP-712 permits using AGENT_PRIVATE_KEY.

nano /etc/mcpaid/server.conf

Public HTTPS endpoint reachable from Cloudflare Edge. For local servers, use a tunnel like cloudflared tunnel --url http://localhost:3000.

Accrues 97% net USDC (withdraw from $1.00)

Your Base EVM address for on-chain earnings payouts (developer-initiated withdrawals).

Specify pricing per-tool. Tools not listed default to free.

DISCONNECT MCP SERVER

Are you sure you want to disconnect and remove () from the MCPaid network?

⚠️ Permanent Action
• All registered tool pricing rules will be purged.
• The public edge URL will be deactivated immediately.
• AI agents calling this gateway will receive 404 Not Found.
>_ WITHDRAW TO BASE L2
Available Balance: $0.0000 USDC
Network: Base Mainnet (Chain ID 8453)
Currency: Native USDC (ERC-20)
Protocol Withdrawal Fee: 0.00% (3% already taken per paid call)
Base L2 Network Fee: ~$0.02 deducted from payout

Minimum withdrawal $1.00. A flat Base L2 network fee (~$0.02) is deducted from your payout and retained to offset the ETH gas the relayer fronts — you receive the net amount on-chain. The exact fee is shown in the confirmation.

View on BaseScan
0x...

Net 97% earnings accrue to your verified EVM address on Base L2 — withdraw once you reach $1.00.

SETTLEMENT PIPELINE LIVE STATUS:
[1/3] Locking available balance in ledger...
[2/3] Registering payout disbursement request...
[3/3] Base L2 settlement queued...
Withdrawal Request Registered Successfully!
View Payout Address on BaseScan
Verify Edge Receipts in Your Backend

When an AI agent invokes a monetized tool, the MCPaid Edge Gateway settles the micropayment and injects an authenticated X-MCPaid-Receipt header into the request proxied to your server. Verify this receipt in your backend before executing downstream database writes or stateful actions:

// In your Cloudflare Worker / backend API:
import { verifyEdgeReceipt, D1ReceiptStore } from '@mcpaid/sdk';

export default {
  async fetch(request, env) {
    const error = await verifyEdgeReceipt({
      secret: env.MCPAID_RECEIPT_SECRET,
      store: new D1ReceiptStore(env.DB),
    }, {
      receipt: request.headers.get('X-MCPaid-Receipt'),
      expectedServer: 'server-id',
      expectedTool: 'your_paid_tool',
    });

    if (error) {
      return new Response(JSON.stringify({ error: 'payment_required', message: error }), { status: 402 });
    }

    // Proceed with database write or action — payment is verified and replay is blocked!
  }
};
import express from 'express';
import { createReceiptMiddleware, MemoryReceiptStore } from '@mcpaid/sdk';

const app = express();
const store = new MemoryReceiptStore();

// Protect any downstream endpoint with 1 line of middleware:
app.post('/api/sync', 
  createReceiptMiddleware({
    secret: process.env.MCPAID_RECEIPT_SECRET,
    expectedServer: 'server-id',
    expectedTool: 'your_paid_tool',
    store,
  }), 
  (req, res) => {
    // req.mcpaidReceipt contains verified receipt payload!
    res.json({ success: true, processedBy: req.mcpaidReceipt.agentWallet });
  }
);
# Zero third-party dependencies — Python standard library:
import hmac, hashlib, json, time, base64

# NOTE: this in-memory set only protects a single process. In production,
# persist claimed nonces in Redis/Postgres with a UNIQUE constraint and a
# periodic DELETE-WHERE-expired sweep.
claimed_nonces = set()

def verify_mcpaid_receipt(receipt_b64: str, secret: str, expected_tool: str,
                           expected_server: str = None) -> bool:
    if not receipt_b64 or not secret: return False
    try:
        payload = json.loads(base64.urlsafe_b64decode(
            receipt_b64 + '=' * (-len(receipt_b64) % 4)))
    except Exception:
        return False
    sig = payload.pop("sig", "")
    now = time.time()
    if (payload.get("toolName") != expected_tool
            or (expected_server and payload.get("serverId") != expected_server)
            or now > payload.get("exp", 0) + 60
            or payload.get("settledAt", 0) > now + 60
            or not sig):
        return False
    canonical = json.dumps(payload, separators=(',', ':'), sort_keys=True)
    expected_sig = hmac.new(secret.encode(), canonical.encode(), hashlib.sha256).hexdigest()
    if not hmac.compare_digest(sig, expected_sig):
        return False
    nonce = payload.get("challengeNonce")
    if not nonce or nonce in claimed_nonces:
        return False
    claimed_nonces.add(nonce)
    return True
Need help? Read the full documentation.
>_ MCPaid Gateway • Developer Portal
Home Documentation Support Business MCP Spec