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.
| Inputs | An Order and a consumer LocalAccount. |
| Surface | The SDK and the relayer API. |
| Output | A RelaySuccess. |
| Status | Shipped. |
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.
| Inputs | A capability name and params; the agent’s own signer. |
| Surface | The x402 gateway, then a relayer’s POST /broker. |
| Output | A RelaySuccess (the same settlement). |
| Status | Shipped (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).
| Inputs | Tool calls; the agent signs the typed data build_order returns. |
| Surface | The MCP server, wrapping @caplane/shared and a relayer. |
| Output | The same Brokered settlement. |
| Status | Shipped. The agent signs; the server never holds a key. |
See also
- The binding: why every door produces the same
orderHash. - Order encoding and the relayer API: the surfaces all three share.
- Composes with, not competes: how x402 and MCP fit the wider ecosystem.

