Commands

agent-commerce doctor

Diagnose config, gateway, backend, protocol and payment health — against the live gateway.

Usagebash
agent-commerce doctor [--config <path>] [--gateway <url>] [--json]

Options

--config <path>
Path to the config.
--gateway <url>default: derived from config, else http://localhost:8080
The running gateway to check against.
--jsondefault: false
Machine-readable JSON instead of the formatted report.

Output

console
$ npm run agent-commerce -- doctor --config config-demo.yaml

PASS  Config               valid - 2 resource(s), merchant "Demo Data Store" (using local chain manifest .deploy/local.json for X402_ASSET, X402_ASSET_NAME, X402_ASSET_VERSION, X402_ASSET_DECIMALS, MERCHANT_WALLET, X402_FACILITATOR_PRIVATE_KEY)
PASS  Gateway              healthy and ready at http://127.0.0.1:8080
PASS  Backend              2/2 backend host(s) reachable
PASS  Protocols            http=on mcp=on (/mcp) a2a=off acp=off
INFO  A2A                  disabled
INFO  ACP                  disabled
INFO  AP2                  disabled
PASS  Payments             x402 v2 (scheme=exact) enabled - LOCAL dev chain (eip155:84532, chain id shared with Base Sepolia), destination=0x7099…79C8, facilitator=local
INFO  Payments (MPP)       planned - not implemented in this release
PASS  Storage              sqlite schema v1 writable; receipts=2
PASS  Protocol versions    reported by gateway /.well-known/agent-commerce

Score: 7/7 checks passed

That is real output. doctor also cross-checks the live gateway's settlement configuration against what your local config resolves to, and fails if they disagree — a diagnostic that passes while the system is misconfigured is worse than none.

Checks

CheckLooks at
Configthe same validation as validate
Gatewayhealth and readiness at the gateway URL
Backendwhether each backend host is reachable
Protocolswhich surfaces are on, and their mounts
A2A · ACP · AP2status, pinned spec and the full unsupported list when enabled
Paymentsrail, deployment mode, destination and facilitator
Payments (MPP)planned — reported as INFO
Storageschema version, writability, receipt count
Protocol versionspins reported by /.well-known/agent-commerce, or local pins if unreachable
StatusMeaningScored
PASShealthyyes
WARNworking, with a caveat — e.g. an unauthenticated mainnet facilitatoryes
FAILbroken; the run exits 1yes
INFOcontext only, e.g. a disabled adapterno

JSON output

json
{
  "checks": [
    { "name": "Config", "status": "PASS", "detail": "valid - 2 resource(s), …" },
    { "name": "Gateway", "status": "PASS", "detail": "healthy and ready at http://127.0.0.1:8080" },
    { "name": "A2A", "status": "INFO", "detail": "disabled" }
  ],
  "score": { "passed": 7, "total": 7 },
  "exitCode": 0
}
Run agent-commerce doctor --json after every deploy: it exits non-zero on any FAIL.