Skip to main content
There are three ways to reach a Caplane settlement. They differ only in how a signed order gets to the chain. The on-chain result is identical: the same abi.encode(order), the same orderHash, the same Brokered event. One settlement, three doors. Whichever door you use, the consumer signs in its own wallet and the relayer is msg.sender.

TS SDK

The primary path. Build and sign with @caplane/shared (plus the @caplane/consumer-agent connect() convenience), then send to any relayer’s POST /broker.
InputsAn Order and a consumer LocalAccount.
SurfaceThe SDK and the relayer API.
OutputA RelaySuccess.
StatusShipped.
The how-to is broker a capability.

x402 envelope

Caplane is itself an EIP-3009 primitive, so a Caplane order maps onto an x402-style payment flow. The repository’s x402 gateway (agents/x402-gateway) resolves a capability, reads the live adapter.quote(params), and returns an x402 402 payment-required envelope. It is a menu, not a cashier: it fills the order template with a placeholder consumer, and the agent substitutes its own signer and a fresh nonce, signs, and submits. The relayer’s recomputed orderHash binds whatever the agent actually signed.
InputsA capability name and params; the agent’s own signer.
SurfaceThe x402 gateway, then a relayer’s POST /broker.
OutputA RelaySuccess (the same settlement).
StatusShipped (the gateway emits the envelope; the agent owns the final order).

MCP tool

The broker flow exposed as Model Context Protocol tools, for an agent that speaks MCP. The server (agents/mcp) adds no settlement logic and holds no key. It exposes five tools: list_capabilities, quote_capability, request_faucet, build_order (returns the EIP-712 typed data for the agent to sign in its own wallet), and broker_capability (submits an already-signed order to a relayer).
InputsTool calls; the agent signs the typed data build_order returns.
SurfaceThe MCP server, wrapping @caplane/shared and a relayer.
OutputThe same Brokered settlement.
StatusShipped. The agent signs; the server never holds a key.

See also