Commands
agent-commerce doctor
Diagnose config, gateway, backend, protocol and payment health — against the live gateway.
agent-commerce doctor [--config <path>] [--gateway <url>] [--json]Options
--config <path>Path to the config.
--gateway <url>default: derived from config, else http://localhost:8080The running gateway to check against.
--jsondefault: falseMachine-readable JSON instead of the formatted report.
Output
$ 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 passedThat 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
| Check | Looks at |
|---|---|
| Config | the same validation as validate |
| Gateway | health and readiness at the gateway URL |
| Backend | whether each backend host is reachable |
| Protocols | which surfaces are on, and their mounts |
| A2A · ACP · AP2 | status, pinned spec and the full unsupported list when enabled |
| Payments | rail, deployment mode, destination and facilitator |
| Payments (MPP) | planned — reported as INFO |
| Storage | schema version, writability, receipt count |
| Protocol versions | pins reported by /.well-known/agent-commerce, or local pins if unreachable |
| Status | Meaning | Scored |
|---|---|---|
PASS | healthy | yes |
WARN | working, with a caveat — e.g. an unauthenticated mainnet facilitator | yes |
FAIL | broken; the run exits 1 | yes |
INFO | context only, e.g. a disabled adapter | no |
JSON output
{
"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.