Skip to content

MPP (Machine Payments Protocol)

Last updated View as MarkdownAgent setup

Machine Payments Protocol (MPP) is an open protocol for machine-to-machine payments. It standardizes the HTTP 402 Payment Required status code with a formal authentication scheme proposed to the IETF. MPP gives agents, applications, and people one interface to pay for a service in the same HTTP request.

MPP is payment-method agnostic. It supports stablecoins, cards through Stripe, and custom payment methods. A service can offer more than one method.

How it works

  1. An Agent or HTTP client requests a paid resource.
  2. The service returns 402 Payment Required with a payment Challenge.
  3. The client fulfills the payment.
  4. The client retries with a payment Credential.
  5. The service returns the resource with a payment Receipt.

HTTP services exchange payment data in authentication headers. Model Context Protocol (MCP) tools use the same flow through JSON-RPC.

Payment intents

MPP defines three payment intents:

  • charge — Collect a one-time payment.
  • session — Charge for measured usage.
  • subscription — Sell recurring access.

For more information, refer to MPP payment intents.

Compatibility with x402

MPP is backwards-compatible with x402. MPP clients can consume existing x402 services without changes to those services.

Build on Cloudflare

SDKs

MPP provides SDKs for TypeScript, Python, Rust, Go, and Ruby. The Cloudflare guides use the TypeScript mppx SDK.

For current packages and integrations, refer to the MPP SDK documentation.

Was this helpful?