Documentation
Two ways in β MCP for agents, CLI for humans and scripts. Same capabilities, different shape.
Two ways in
MCP Β· For AI agents
One HTTPS endpoint. Tools are discovered at runtime, nothing to install.
CLI Β· For humans & scripts
Four npm binaries with explicit flags, exit codes and JSON output.
Both surfaces expose the same business capabilities and field semantics. Admin and payment operations are direct MCP tools; merchant nouns and verbs are reached through progressive discovery.
Quick Start
Control plane first β sign in, create a developer, mint an API key. The runtime CLIs then work with that key.
npm install -g @agenzo/admin-cli @agenzo/token-cli @agenzo/payment-cli @agenzo/merchant-cliInstall the four CLIs (Node.js 22+)
agenzo-admin-cli auth login --email you@example.com --idempotency-key login-001Sign in with a magic link (control plane)
agenzo-admin-cli developers create --developer-name "my-bot" --developer-email you@example.com --bank-beneficiary-name "My Agent LLC" --bank-account-number 1234567890123456 --bank-name "Test Bank" --bank-country US --bank-swift-code TESTUS33 --idempotency-key dev-001Create a developer (bank details required)
agenzo-admin-cli keys create --developer-id <dev_id> --key-name "Prod Key" --scope token,merchant,payment --idempotency-key key-001Mint an API key β shown once, save it
agenzo-token-cli payment-methods add --api-key <key> --email you@example.com --idempotency-key pm-001Add a payment method and complete verification
agenzo-token-cli --yes payment-tokens create --type vcn --api-key <key> --amount 30 --idempotency-key idem_001Mint a $30 virtual card
agenzo-payment-cli payments capture --api-key <key> --payment-token-id <ptk_id> --idempotency-key chg_001 --yesCharge that token
agenzo-merchant-cli services list --api-key <key>Discover the merchant capabilities you can fulfil
Full reference below β
MCP
The platform speaks MCP over Streamable HTTP, so an agent reaches the same capabilities as the CLI without installing anything. Point any MCP client at the endpoint and send your credential as a header.
Endpointβ `https://agent.agenzo.com/mcp/` (the trailing slash is required, otherwise the handshake fails)Transportβ Streamable HTTPProduction discoveryβ all capabilities exposed; admin and payment are direct tools, merchant is progressiveRuntime authβ `X-Api-Key: <api key>` for merchant, payment-method, payment-token and capture capabilitiesAdmin authβ `Authorization: Bearer <access_token>` for control-plane operations. The token expires; refresh it with `agenzo-admin-cli auth login`
Two tool shapes
Production runs full exposure with hybrid discovery. Groups whose capability set is fixed are listed as ordinary tools; merchant services, which grow as providers onboard, are discovered on demand β so the tool list stays small.
Direct tools β admin & payment
Listed individually as `<service>__<verb>` with full parameter schemas. Call them in one step, no drill-down.
orgs__get Β· developers__create Β· keys__create Β· accounts__get Β· payment_methods__add Β· payment_tokens__create Β· payments__captureProgressive discovery β merchant
Fulfilment services sit behind four meta tools. Always start at list_services and follow each step's hint β do not guess service ids or verbs.
list_services() β describe_service(service) β describe_tool(service, verb) β invoke(service, verb, arguments)Client configuration
Most MCP clients take a JSON config. Include both headers when one client needs the full surface; the Bearer token expires and must be refreshed with the admin CLI. Clients that require the transport to be named add `"type": "http"` β there is no `transport` key, and clients that validate strictly reject it.
{
"mcpServers": {
"agenzo": {
"url": "https://agent.agenzo.com/mcp/",
"headers": {
"X-Api-Key": "<runtime api key>",
"Authorization": "Bearer <admin access token>"
}
}
}
}Argumentsβ snake_case, and the same nested JSON shape as the REST bodyWritesβ require `idempotency_key`; reuse the same value to retry without duplicating an order or a chargeErrorsβ returned as `[<code>] <message>`, e.g. `[1001]` for an invalid request
Installation
Requires Node.js 22+. `agenzo-admin-cli` is the control plane and signs in with a Bearer token; `agenzo-token-cli`, `agenzo-payment-cli` and `agenzo-merchant-cli` are runtime planes and take `--api-key` per command.
added 4 packages in 6s
Authentication
Login
Sign in via magic link, then click the link in your inbox. First-time emails are auto-registered and prompt for an organization name; if registration requires an invitation code the CLI asks for it. Credentials are stored under `~/.agenzo-admin-cli/`.
βΉ Magic link sent to you@example.com β Waiting for verification... β Logged in as Acme Corp (org_01HZ...)
Logout
Sign out of the current organization and drop the local credentials. Signing back in needs another magic link.
β Logged out from Acme Corp Local credentials removed
Configuration
Set API host
Point the CLI at another environment. Accepts a full URL or a profile name. Default: `https://agent.agenzo.com` (production).
β API host updated Host https://agent-dev.agenzo.com
Show configuration
Display the current API host and the active organization.
API Host https://agent.agenzo.com Active Org org_01HZ... (Acme Corp)
Reset API host
Return the API host to the production default.
β API host reset Host https://agent.agenzo.com
Organizations
View current organization
Show the name, id, email and status of the active organization.
ID org_01HZ... Name Acme Corp Email admin@acme.com Status ACTIVE
Update organization
Renaming takes effect immediately. Changing the email requires confirming a verification link.
β Organization updated Name New Name
βΉ Verification email sent to new@example.com
List organizations
List every organization signed in locally. The active one is marked with *.
ID Name Status * org_01HZ... Acme Corp ACTIVE org_02AB... Beta Inc ACTIVE
Switch organization
Change the active organization. The target must already be signed in locally.
β Switched to Beta Inc (org_02AB...)
Developers
Bank details are mandatory for every developer regardless of billing mode β they are the payout target. Missing flags are prompted interactively; under `--yes` a missing one fails with `PARAM_INVALID`.
Create a developer
Required: `--developer-name`, `--developer-email`, and the bank group (`--bank-beneficiary-name`, `--bank-account-number`, `--bank-name`, `--bank-country`, `--bank-swift-code`). Optional: `--billing-mode` (`pay_per_call` default, or `monthly_settlement`, which provisions a settlement account). Returns the `developer_id` you need for keys.
β Developer created ID dev_01HZ... Name my-bot Bank ************3456 Status ACTIVE
List developers
List the developers under the active organization. One email can back only one developer per organization.
ID Name Email Status dev_01HZ... my-bot agent@example.com ACTIVE
Get developer details
Show one developer in full. The bank account number is always masked to the last four digits.
ID dev_01HZ... Name my-bot Billing pay_per_call Bank ************3456
Update a developer
Update the name or email. The stored bank account is left alone unless you pass a `--bank-*` flag β then the whole account is replaced, so every required bank field must resolve.
β Developer updated Name New Name
API Keys
Keys are bound to a developer: tokens and cards created with one key are invisible to another. The key format is `sk_<env>_...` β `sk_prod_` in production, `sk_test_` elsewhere.
Create an API key
Required: `--developer-id` and `--key-name`. `--scope` is a comma-separated subset of `token`, `merchant`, `payment` and defaults to all three. The full key is printed once β save it.
β API key created ID key_01HZ... Scope token,merchant,payment β Save this key now. You will not see it again. Key sk_prod_a1b2c3d4...
List API keys
List a developer's keys. Only prefixes are returned, never the full value.
ID Name Prefix Status key_01HZ... Prod Key sk_prod_a1b2... ACTIVE
Get API key details
Show one key's prefix, scope, status and last use.
ID key_01HZ... Prefix sk_prod_a1b2... Scope token,merchant,payment Status ACTIVE
Rotate an API key
Issue a new secret for an existing key. The old secret stops working immediately.
β API key rotated β Save this key now. You will not see it again. Key sk_prod_n3w5ecr3t...
Disable an API key
Permanently disable a key.
β API key disabled ID key_01HZ...
Settlement Accounts
Query a settlement account
Auto-created for `monthly_settlement` developers; returns `account: null` for `pay_per_call` ones (a read, not an error). `balance` is in minor units as a string.
Developer dev_01HZ... Balance 3000000 Currency CNY
Payment Methods
Runtime plane β every command takes `--api-key` (sent as `X-Api-Key`). Adding a payment method is asynchronous: the CLI prints a URL, the cardholder completes the browser step, and the CLI polls to a terminal status.
Add a payment method (3DS)
Prompts for card number, expiry (MMYY) and CVV, then returns a `verification_url` the cardholder opens in a browser for 3DS. The process polls until the card is ACTIVE, so keep it alive. `--mode dropin` runs the hosted Drop-in flow instead, with no card details at the terminal.
ID pm_01HZ... Status PENDING Verification URL https://... β Waiting for 3DS... β Payment method ACTIVE
Add a payment method (UnionPay)
`--payment-brand unionpay` starts enrollment without collecting card details in the terminal. Open the returned `enroll_url`, complete passkey authentication, then let the command poll or run `unionpay-status` later. `--member` is required and caller-defined; reuse the same value for this user.
ID pm_01HZ... Status PENDING Enroll URL https://... β Polling every 5s... β Card ACTIVE (UnionPay ****1234)
List payment methods
List added payment methods, optionally scoped to one member. Both brands share the same field shape, with `payment_brand` telling them apart.
ID Brand Last Four Status pm_01HZ... Mastercard 6789 ACTIVE pm_02AB... UnionPay 1234 ACTIVE
Get payment method details
Show one card. Use it to check verification status later if a poll timed out (PENDING β ACTIVE or FAILED).
ID pm_01HZ... Brand UnionPay Last Four 1234 Status ACTIVE
Disable a payment method
Disable a card and cascade-revoke every active payment token under it.
β Payment method disabled Tokens revoked: 3
Payment Tokens
Runtime plane (`--api-key`). Tokens are single-use β mint a new one per transaction. `--idempotency-key` is required and never auto-generated. Select the payment method with `--payment-method-id`, or use `--card <number>` to match the last four digits.
Amount units differ per flag and are not interchangeable: `--amount` for VCN is USD decimal (the CLI converts it to integer cents on the wire), `--amount` for X402 is USDC micro-units, `--unionpay-amount` is a decimal string forwarded verbatim, and `payments capture` reports integer cents.
Virtual card (VCN)
Mint a one-time virtual card. `--amount` is USD decimal, 0.01β500.00. Optional: `--currency` (default USD), `--member`.
β VCN created Token ID ptk_01HZ... Card 4242 **** **** 1234 Limit $30.00 Status ACTIVE
Network token
Get a network token plus a one-time cryptogram. The real card number never leaves the vault. The selected payment method determines whether the credential is returned synchronously or through UnionPay checkout.
β Network Token created Token ID ptk_01HZ... Last Four 1234 Cryptogram AgAAAAAABk4DFkZGJhY2... Status ACTIVE
Network token (UnionPay)
`unionpay-create` returns a PENDING token and `checkout_url` immediately. Open that URL, complete passkey authentication, then poll with `payment-tokens get` until ACTIVE. Select the UnionPay payment method with `--payment-method-id`; `--unionpay-amount` is a decimal string, recipient name plus email or phone is required, and no `--member` is sent.
Payment Token ID ptk_01HZ... Status PENDING Checkout URL https://... β Polling every 5s... β Token ACTIVE (cryptogram issued)
X402 signature
Sign an EIP-712 payment backed by the selected payment method. `--amount` is in USDC smallest units (1 USDC = 1,000,000). Send the returned signature in your `X-PAYMENT` header.
β X402 signature created Token ID ptk_01HZ... Amount 1.000000 USDC Network base Signature eyJhbGciOiJFUzI1NiIs...
List payment tokens
List tokens, optionally filtered by `--type` (`vcn`, `network-token`, `x402`) and `--member`.
Token ID Type Status Summary ptk_01HZ... vcn ACTIVE **** 1234 | $30.00 ptk_02AB... network_token ACTIVE UnionPay | **** 1234
Get payment token details
Show one token; the shape varies by type. Use it to poll an async UnionPay token that has not turned ACTIVE yet. Add `--reveal` only when you actually need the full card number.
Token ID ptk_01HZ... Type vcn Status ACTIVE Limit $30.00 Balance $25.50
Revoke a payment token
Revoke an active token β a VCN is closed and settled. Tokens already in a terminal state cannot be revoked.
β Payment token revoked Status REVOKED
Charging a Token
`agenzo-payment-cli` does one thing: charge a token that already exists. The amount, currency and fee were fixed when the token was minted, so capture takes neither β only which token to charge.
Capture a payment
Required: `--api-key`, `--payment-token-id` and `--idempotency-key` (unique per charge, sent as a header). The platform reads the brand off the token record and routes to the right rail, so `--payment-brand` is only ever an assertion β a mismatch errors. Amounts come back as integer cents.
{
"charge_no": "chg_...",
"payment_brand": "unionpay",
"amount_cents": 1200,
"fee_cents": 0,
"total_cents": 1200,
"currency": "USD",
"pay_status": "success"
}`pay_status` is `success`, `failed` or `pending`. A `pending` result means the gateway had not settled within the platform's poll window β retry with the same `--idempotency-key` to read the outcome; it will not double-charge.
Merchant Fulfilment
`agenzo-merchant-cli` fulfils real-world commerce. Each capability is a noun, and the set grows over time β run `services list` to see what is live today. The key must carry `merchant` scope. Writes need `--idempotency-key`; output defaults to JSON.
ride-elifeRide-hailing: price a trip, book it, then track or cancel. Note that `get` and `cancel` take the `ride_id` from `book`, not the `rio_...` order id.
Representative workflow
quote β book β get (poll) β cancelhotel-redaugHotel booking: search, inspect rooms, price a rate, then create and settle an order. `create-order` only locks inventory; `pay-order` is the separate step that charges.
Representative workflow
search β hotel-detail β quote β create-order β pay-order β get (poll)flight-flinkInternational flights, including after-sales. Ticketing is asynchronous, so poll `get-order`. Rebooking has its own paid step: `change-pay` charges the fee from `change-detail` and only then triggers change ticketing β it is the step most often missed. Refunds run `refund-apply β refund-detail β refund-confirm`.
Representative workflow
search β verify β create-order β pay-order β get-order Β· change-search β change-apply β change-detail β change-pay β get-orderordersOne read-only index across every provider β use it for a generic "my orders" request. Switch to a domain noun's `list-orders` once you know the business and need its specific fields.
Representative workflow
list (--order-type / --status) β get --order-idCLI β MCP
The same capability under both surfaces. CLI verbs are hyphenated; MCP tool names replace hyphens with underscores. Merchant capabilities are reached through `invoke` rather than being listed one tool per verb.
| CLI | MCP | Auth |
|---|---|---|
agenzo-admin-cli orgs / developers / keys / accounts | orgs__get Β· developers__create Β· keys__create Β· accounts__get | Bearer token |
agenzo-token-cli payment-methods | payment_methods__add Β· list Β· get Β· disable | X-Api-Key |
agenzo-token-cli payment-tokens | payment_tokens__create Β· list Β· get Β· revoke | X-Api-Key |
agenzo-payment-cli payments capture | payments__capture | X-Api-Key |
agenzo-merchant-cli services list | list_services() | X-Api-Key |
agenzo-merchant-cli ride-elife book | invoke("ride-elife", "book", {...}) | X-Api-Key |
agenzo-merchant-cli hotel-redaug pay-order | invoke("hotel-redaug", "pay-order", {...}) | X-Api-Key |
agenzo-merchant-cli flight-flink change-pay | invoke("flight-flink", "change-pay", {...}) | X-Api-Key |
agenzo-merchant-cli orders list | invoke("orders", "list", {...}) | X-Api-Key |
Global Options
--help, -hβ Show help for any command; add `--format json` for a machine-readable schema--version, -vβ Show the CLI version--format <table|json>β Output shape. `agenzo-merchant-cli` defaults to json, the others to table--api-key <sk_...>β Runtime credential for token, merchant and payment commands. Takes the full key string, not the key id--yesβ Non-interactive mode for automation. Nothing is prompted, so every required flag must be supplied--idempotency-key <key>β Sent as the Idempotency-Key header on writes. Required, never auto-generated; reuse it to retry safely