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 layerPer-agent budgets, spend limits, auto-stop, audit trail
Fee payerSponsors gas so agents pay without holding native tokens
Multi-chainSupports Tempo and Solana as payment rails
Not a protocolMPP is the protocol — MPP Gate builds on top
Not a payment railSolana and Tempo are the rails — MPP Gate sits above

Quick Start

Integrate MPP Gate in two steps:

1

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',
  })],
})
2

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:

  1. Agent requests an MPP-gated API endpoint.
  2. Server responds 402 with a WWW-Authenticate header containing the payment challenge (amount, currency, recipient).
  3. Agent signs a token transfer transaction but does not broadcast it.
  4. MPP Gate checks budget, co-signs as fee payer, broadcasts the transaction, and logs it to the audit trail.
  5. Agent retries the original request with payment credentials.
  6. 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

RailSDKCurrenciesStatus
TempomppxpathUSD, USDC✅ Live
Solana@solana/mppUSDC, SPL, Token2022✅ Supported