Squid MPP Adapter

AI agents and backend services can now accept and make payments across any EVM chain using the Squid MPP adapter — a Machine Payments Protocol (MPP)arrow-up-right adapter powered by Squid to abstract away the complexity of cross-chain bridging.

Instead of managing bridges or writing complex multi-chain payment logic, developers can integrate the Squid MPP adapter to automatically handle bridging and paying for 402 resources in a single, seamless integration. Clients settle automatically by scanning their available balances across all Squid-supported EVM chains and routing through the Squid API to Tempo mainnetarrow-up-right.


Features

  • Auto chain selection — scans all Squid-supported EVM chains for available balances and picks the best source token automatically

  • Cross-chain bridging — routes tokens from any supported chain to Tempo mainnet via Squid Router

  • HTTP 402 payment flow — standard MPP challenge/credential cycle: server issues a challenge, client pays and retries with a credential

Info The Squid MPP adapter currently supports EVM chains only.


Getting Started

Requirements

Server integration

Protect any HTTP endpoint so that only clients who have paid can access it. Install the mppxarrow-up-right library:

npm install mppx

Generate a secret key for credential signing:

Add the output to your environment variables:

Add mppx.charge() as middleware on any route you want to gate. The tempo() method configures the settlement token and recipient on Tempo mainnet:

Unauthenticated requests receive an HTTP 402 with the charge parameters. Requests that include a valid credential pass through to the handler.

Learn more about protecting endpoints with MPP at the official MPP docsarrow-up-right.

Client integration

Access any MPP-protected endpoint and pay from any supported EVM chain — no manual bridging required. Install @0xsquid/mpp alongside mppx and viem:

You will need a funded agent wallet (USDC or any Squid-supported token on any supported chain) and your Squid Integrator ID.

Wrap your fetch calls with Mppx.create() using squid() as the payment method. When a 402 is received, the library handles the entire bridge flow:

squid(config) options

Option
Type
Required
Description

account

Account

Yes

A viem Accountarrow-up-right (e.g. from privateKeyToAccount)

integratorId

string

Yes

Your Squid integrator ID

onPayment

(summary: PaymentSummary) => void

No

Callback fired after a successful payment with amount, token, and source chain info

Learn more about MPP clients at the official MPP docsarrow-up-right.


Payment Flow

Last updated