Documentation
Integrate MPP Gate as your payment control layer for AI agents.
Overview
MPP Gate is a payment control layer for autonomous AI agents, built on the Machine Payments Protocol (MPP).
It sits between your agents and the payment rail — giving you per-agent budgets, spend limits, auto-stop, and a full audit trail of every payment an agent makes.
MPP Gate also acts as a fee payer, co-signing transactions so your agents never need to hold gas tokens — just stablecoins like USDC.
What MPP Gate Does
| ✅ | Control layer | Per-agent budgets, spend limits, auto-stop, audit trail |
| ✅ | Fee payer | Sponsors gas so agents pay without holding native tokens |
| ✅ | Multi-chain | Supports Tempo and Solana as payment rails |
| ❌ | Not a protocol | MPP is the protocol — MPP Gate builds on top |
| ❌ | Not a payment rail | Solana and Tempo are the rails — MPP Gate sits above |
Quick Start
Integrate MPP Gate in two steps:
Server — point feePayerUrl to MPP Gate
import { Mppx, tempo } from 'mppx/express'
const mppx = Mppx.create({
secretKey: process.env.MPP_SECRET_KEY,
methods: [tempo({
currency: '0x20c000000000000000000000b9537d11c60e8b50',
recipient: '0xYourAddress',
feePayerUrl: 'https://facilitator.mppgate.com',
})],
})Client — create an MPP client for your agent
import { Mppx, tempo } from 'mppx/client'
import { privateKeyToAccount } from 'viem/accounts'
const client = Mppx.create({
methods: [tempo({
account: privateKeyToAccount(process.env.AGENT_KEY),
})],
})
// Paid fetch — handles 402 → pay → retry automatically
const res = await client.fetch('https://api.example.com/endpoint', {
method: 'POST',
body: JSON.stringify({ query: 'hello' }),
})How It Works
The MPP payment flow with MPP Gate as the control layer:
- Agent requests an MPP-gated API endpoint.
- Server responds 402 with a
WWW-Authenticateheader containing the payment challenge (amount, currency, recipient). - Agent signs a token transfer transaction but does not broadcast it.
- MPP Gate checks budget, co-signs as fee payer, broadcasts the transaction, and logs it to the audit trail.
- Agent retries the original request with payment credentials.
- Server verifies the payment on-chain and serves the response.
Push vs Pull Mode
MPP supports two payment modes:
Push Mode
The client broadcasts the transaction and sends the tx hash. Used by browser wallets. No fee payer needed — the client pays their own gas.
Pull Mode
The client signs but does not broadcast. MPP Gate co-signs and broadcasts. Default for agents and bots. Fee payer required.
MPP Gate is essential for pull mode — the mode most AI agents use. Without it, every agent would need to hold gas tokens on every chain.
Supported Payment Rails
| Rail | SDK | Currencies | Status |
|---|---|---|---|
| Tempo | mppx | pathUSD, USDC | ✅ Live |
| Solana | @solana/mpp | USDC, SPL, Token2022 | ✅ Supported |