Get started
Installation
Install the CLI and the library, and add only the optional peers for the rails you use.
One package ships two things: the agent-commerce CLI (init, import openapi, validate, start, doctor, reconcile, resolve, backup, demo, version) and a library for embedding the gateway in your own process. It requires Node ≥ 22.
Install the CLI
npx @devlab.group/agent-commerce --help # no install neededThe default install excludes the optional protocol, payment and authorization peers, so it pulls no blockchain or wallet dependencies. The OpenAPI parser behind import openapi is a regular dependency, because import is part of the CLI.
Optional peers
The MCP adapter, the x402 and MPP providers and AP2 verification live on their own subpaths, because each needs a dependency the rest of the package does not. A gateway serving free HTTP resources installs none of them. Install only the rails you use.
| You want | Install | Import from |
|---|---|---|
| gateway, config, receipts, A2A/ACP, CLI | @devlab.group/agent-commerce | @devlab.group/agent-commerce |
| resources as MCP tools | @modelcontextprotocol/server | @devlab.group/agent-commerce/mcp |
| accept x402 payments | @x402/core @x402/evm viem | @devlab.group/agent-commerce/x402 |
| accept x402 on Solana | x402 peers + @x402/svm @solana/kit | no import — loaded for a Solana offer |
| accept x402 on NEAR | x402 peers + @x402/near | no import — loaded for a NEAR offer |
| accept MPP payments | mppx viem @x402/core @x402/evm | @devlab.group/agent-commerce/mpp |
| verify AP2 mandates, sign checkout JWTs | jose @sd-jwt/core canonicalize | @devlab.group/agent-commerce/ap2 |
| CDP facilitator auth | @coinbase/x402 | no import — loaded on demand |
The x402 entry needs @x402/core, @x402/evm and viem even when every offer is on Solana or NEAR. MPP settles through an x402 facilitator, so its entry also needs the x402 peers.
npm install @devlab.group/[email protected] @modelcontextprotocol/[email protected] @x402/[email protected] @x402/[email protected] [email protected]import { mcp } from '@devlab.group/agent-commerce/mcp';
import { x402 } from '@devlab.group/agent-commerce/x402';
import { mpp } from '@devlab.group/agent-commerce/mpp';
import { ap2 } from '@devlab.group/agent-commerce/ap2';facilitator.auth.type: cdp is configured, and it adds @coinbase/cdp-sdk, axios and a Solana dependency tree. Audit that installation before you use it. auth.type: bearer covers any facilitator with a static token and installs nothing.Entry points
| Import | Exports |
|---|---|
@devlab.group/agent-commerce | createGateway, loadConfig, parseConfig, receipts (alias of createSqliteReceiptStore), createA2aAdapter, createAcpAdapter, canonical types and error codes |
…/mcp | mcp (alias of createMcpAdapter) |
…/x402 | x402 (alias of createX402PaymentProvider), createPaymentProof, SUPPORTED_NETWORK_IDS |
…/mpp | mpp (alias of createMppPaymentProvider), MPP profile and spec constants |
…/ap2 | ap2 (alias of createAp2AuthorizationProvider), createCheckoutJwt, AP2 constants |
…/testing | receiptStoreConformanceCases for a custom ReceiptStore (experimental); imports no test runner or SQLite driver |
Verify the install
agent-commerce --version # the CLI version
agent-commerce version # plus every pinned protocol and SDK versionNext: run the local demo or go straight to the integration guide.