Clawallex MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Clawallex MCP Server Pay $20 for my ChatGPT Plus subscription using USDC"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@clawallex/mcp-server
MCP Server for the Clawallex payment API. Pay for anything with USDC — Clawallex converts your stablecoin balance into virtual cards that work at any online checkout.
Quick Start
1. Install
npm install -g @clawallex/mcp-serverOr use directly via npx (no install needed).
2. Get API Credentials
Sign up at Clawallex and create an API Key pair (api_key + api_secret).
3. Configure Your AI Client
Choose your client and add the configuration:
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"clawallex": {
"command": "npx",
"args": ["@clawallex/mcp-server"],
"env": {
"CLAWALLEX_API_KEY": "your_api_key",
"CLAWALLEX_API_SECRET": "your_api_secret"
}
}
}
}Claude Code
claude mcp add --scope local clawallex -- npx @clawallex/mcp-server \
--api-key your_api_key \
--api-secret your_api_secretCodex CLI
Add to your ~/.codex/config.toml or .codex/config.toml:
[mcp_servers.clawallex]
command = "npx"
args = [
"@clawallex/mcp-server",
"--api-key",
"your_api_key",
"--api-secret",
"your_api_secret",
]Gemini CLI
Add to your ~/.gemini/settings.json:
{
"mcpServers": {
"clawallex": {
"command": "npx",
"args": [
"@clawallex/mcp-server",
"--api-key", "your_api_key",
"--api-secret", "your_api_secret"
]
}
}
}OpenCode
Add to your opencode.json:
{
"mcp": {
"clawallex": {
"type": "local",
"command": ["npx", "@clawallex/mcp-server", "--api-key", "your_api_key", "--api-secret", "your_api_secret"],
"enabled": true
}
}
}4. Initialize Connection
After configuring, tell your AI agent:
"Run clawallex_setup to check the connection"
clawallex_setup verifies your API Key and automatically binds a client_id for data isolation. You only need to do this once.
5. Start Using
One-time payment:
"Pay $50 for OpenAI API credits"
Agent calls clawallex_pay → creates virtual card → get_card_details → decrypt_card_data → fills checkout.
Subscription:
"Set up a $100 card for AWS monthly billing"
Agent calls clawallex_subscribe → creates reloadable card → clawallex_refill when balance is low.
6. Smoke Test
Verify everything works:
clawallex_setup → should show "ready" with bound client_id
get_wallet → should return wallet balance
list_cards → should return card list (empty if no cards yet)Related MCP server: AgentCard MCP Server
Typical Flows
Payment Flow (Mode A — Wallet Balance)
1. clawallex_setup → verify connection & bind identity
2. get_wallet → check USDC balance
3. clawallex_pay({ amount, description }) → create a one-time virtual card
4. get_card_details({ card_id }) → get encrypted card data
5. decrypt_card_data({ nonce, ciphertext }) → decrypt PAN/CVV for checkoutSubscription Flow
1. clawallex_setup → verify connection
2. get_wallet → check USDC balance
3. clawallex_subscribe({ initial_amount, description }) → create reloadable card
4. get_card_details({ card_id }) → get card number
5. clawallex_refill({ card_id, amount }) → top up when neededTools
High-Level (Recommended)
Tool | Description |
| Check connection status and bind agent identity |
| One-time payment — creates a single-use virtual card |
| Recurring subscription — creates a reloadable card |
| Top up a subscription card balance |
Identity & Binding
Tool | Description |
| Query current API Key binding status (read-only) |
| Bind a client_id to this API Key |
Wallet & Query
Tool | Description |
| Get wallet balance and status |
| Get on-chain USDC deposit addresses |
| List virtual cards created by this agent |
| Get card balance and status |
| Check balances for multiple cards in one call |
| Update card risk controls (tx_limit, allowed_mcc, blocked_mcc) |
| Get card details including risk controls, cardholder info, and encrypted PAN/CVV |
| Decrypt PAN/CVV from get_card_details |
| List card transactions with optional filters |
Advanced (x402 On-Chain)
Tool | Description |
| Get on-chain receiving address for x402 payments |
| Create a card with full control (supports Mode B two-stage) |
| Refill a stream card with x402 or custom idempotency keys |
CLI Options
Option | Env Variable | Required | Default | Description |
|
| Yes | — | Clawallex API Key |
|
| Yes | — | Clawallex API Secret (HMAC-SHA256 signing) |
|
| No |
| API base URL |
|
| No | auto-generated | Agent identity UUID. See Client ID section. |
| — | No |
| Transport mode: |
| — | No |
| HTTP port for |
CLI arguments take precedence over environment variables. You can mix both — e.g. set credentials via env vars and override --transport via CLI.
Requirements
Node.js >= 22
Client ID
client_id is the agent's stable identity, separate from the API Key. It is sent as X-Client-Id on every /payment/* request.
Key concept: An agent can have multiple API Keys (for rotation/revocation), but the client_id never changes. When switching to a new API Key, keep using the same client_id — the new key auto-binds on first request.
Data isolation:
Wallet: user-level, shared — all agents using the same API key see the same wallet balance
Cards & Transactions:
client_id-scoped — each agent only sees data it created
Binding rules:
clawallex_setupautomatically callsbootstrapto bindclient_idon first useOnce bound, the
client_idcannot be changed for that API Key (TOFU — Trust On First Use)Losing the
client_id= losing access to all cards created under it
Resolution order at startup:
--client-id <value>CLI argument (must be >= 36 characters)~/.clawallex-mcp/client_ids.jsonlocal file (from a previous run)Auto-generate UUID v4 and save locally
Recommendation: Always pass --client-id explicitly in production to avoid relying on the local file.
Transport Modes
stdio (default — local agent / Claude Desktop)
npx @clawallex/mcp-server \
--api-key your_api_key \
--api-secret your_api_secretSSE (remote agent, compatible with older MCP clients)
npx @clawallex/mcp-server \
--api-key your_api_key \
--api-secret your_api_secret \
--transport sse \
--port 18080Agent connects to: http://localhost:18080/sse
Streamable HTTP (MCP SDK 1.0+ recommended)
npx @clawallex/mcp-server \
--api-key your_api_key \
--api-secret your_api_secret \
--transport http \
--port 18080Agent connects to: http://localhost:18080/mcp
Local Development
npm install
npm run build
# List all tools (stdio)
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| node dist/index.js \
--api-key your_api_key \
--api-secret your_api_secret \
2>/dev/nullSecurity
Authentication
Every API request is signed with HMAC-SHA256:
canonical = METHOD + "\n" + PATH + "\n" + TIMESTAMP + "\n" + hex(sha256(body))
X-Signature = base64(hmac_sha256(api_secret, canonical))Signing is handled automatically by the MCP server.
Card Details Encryption
get_card_details returns encrypted_sensitive_data containing card PAN and CVV. Use decrypt_card_data to decrypt:
Derive key:
HKDF-SHA256(ikm=api_secret, info="clawallex/card-sensitive-data/v1", length=32)Decrypt:
AES-256-GCM(key, nonce, ciphertext)Result:
{ "pan": "4111...", "cvv": "123" }
Decrypted PAN/CVV must NEVER be displayed to the user — only used for filling checkout forms.
Available Tools
18 toolsbatch_card_balancesB
Check balances for multiple cards in one call.
Inputs: card_ids (required).
bootstrapA
Bind a client_id to the current API Key, or let the server generate one. This is the recommended way to establish agent identity before making payment calls. Once bound, the client_id cannot be changed for this API Key. Behavior: • API Key not yet bound + no preferred_client_id → server generates a ca_ prefixed ID. • API Key not yet bound + preferred_client_id → binds the provided value. • API Key already bound + same value (or omitted) → idempotent, returns existing binding. • API Key already bound + different value → 409 conflict. On success, the returned client_id is automatically saved locally. Example: bootstrap() → { client_id: 'ca_abc123', created: true } Example: bootstrap({ preferred_client_id: 'my-agent-uuid' }) → { client_id: 'my-agent-uuid', created: true }
Inputs: preferred_client_id.
clawallex_payA
Pay for a product or service using USDC. Creates a single-use flash virtual card (card_type=100), deducts from wallet balance, returns card details for checkout.
Mode A (mode_code=100, default): wallet balance → flash card. Immediate settlement. Mode B (mode_code=200): for callers with self-custody wallets — signing is performed by the caller. x402 on-chain two-stage flow: Stage 1 (Quote): POST with mode_code=200, chain_code, token_code. The 402 response is EXPECTED — it is a quote, NOT an error. Returns: card_order_id, client_request_id, x402_reference_id, payee_address, asset_address, final_card_amount, issue_fee_amount, fx_fee_amount, fee_amount, payable_amount. Agent signs: construct and sign an EIP-3009 transferWithAuthorization using your own wallet/signing library. Stage 2 requires the resulting signature and your wallet address (authorization.from). authorization fields: from=your wallet address, to=payee_address, value=maxAmountRequired, validAfter/validBefore=unix seconds validity window, nonce=random 32-byte hex (unique per auth). Stage 2 (Settle): POST again with SAME client_request_id + signed x402 data: - payment_requirements.payTo MUST equal payee_address from Stage 1 - payment_requirements.asset MUST equal asset_address from Stage 1 - payment_requirements.maxAmountRequired MUST equal payable_amount × 10^decimals (USDC = 6 decimals, e.g. '207.59' → '207590000') - payment_requirements.extra.referenceId MUST equal x402_reference_id from Stage 1 - extra.card_amount MUST equal amount, extra.paid_amount MUST equal amount + fee_amount - If settle is rejected, order stays pending_payment — fix params and retry with same client_request_id.
Fee structure: fee_amount = issue_fee_amount + fx_fee_amount. total_amount = amount + fee_amount.
Example (Mode A): clawallex_pay({ amount: 50, description: 'OpenAI API credits' })
Inputs: amount (required), description (required), mode_code, tx_limit, +11 more.
clawallex_refillA
Top up the balance of a subscription (stream) card. Only stream cards (card_type=200) can be refilled. Refill mode follows the card's creation mode.
Mode A: deducts from wallet balance. client_request_id is the idempotency key (auto-generated if omitted). Mode B: x402 settle (no 402 challenge stage) — agent must first call get_x402_payee_address to get payee_address, then construct payment_requirements.payTo from it. Requires x402_reference_id, x402_version, payment_payload, payment_requirements. Mode B idempotency key is x402_reference_id (not client_request_id).
Tip: use get_card_balance first to check current balance. Example: clawallex_refill({ card_id: 'c_123', amount: 50 })
Inputs: card_id (required), amount (required), client_request_id, x402_reference_id, +4 more.
clawallex_setupA
Check current Clawallex connection status and ensure agent identity is bound. Calls whoami to verify API Key, then bootstrap to bind client_id if not yet bound. Use this after starting the MCP server to confirm everything is ready for payment operations. Returns: user_id, api_key_id, bound_client_id, client_id_bound status.
Inputs: no named parameters.
clawallex_subscribeA
Set up a reloadable virtual card for recurring/subscription payments. Creates a stream card (card_type=200) that stays active and can be refilled via clawallex_refill.
Mode A (mode_code=100, default): wallet balance → stream card. Immediate settlement. Mode B (mode_code=200): for callers with self-custody wallets — signing is performed by the caller. Same x402 two-stage flow as clawallex_pay. The 402 response is EXPECTED (a quote, not an error). See clawallex_pay for full Stage 1/2 details.
Fee structure: fee_amount = issue_fee_amount + monthly_fee_amount + fx_fee_amount.
Example: clawallex_subscribe({ initial_amount: 100, description: 'AWS monthly billing' })
Inputs: initial_amount (required), description (required), mode_code, tx_limit, +11 more.
create_card_orderA
Advanced: create a virtual card with full control over payment mode and card type. Maps directly to POST /payment/card-orders. Most agents should use clawallex_pay or clawallex_subscribe instead.
Mode A (mode_code=100): wallet balance deduction, immediate settlement. Mode B (mode_code=200): for callers with self-custody wallets — signing is performed by the caller. x402 two-stage flow: Stage 1 (Quote): provide chain_code + token_code. The 402 response is EXPECTED (a quote, NOT an error). Returns: payee_address, asset_address, x402_reference_id, fee breakdown, payable_amount. Agent signs: construct and sign an EIP-3009 transferWithAuthorization using your own wallet/signing library. Stage 2 requires the resulting signature and your wallet address (authorization.from). authorization fields: from=your wallet, to=payee_address, value=maxAmountRequired, validAfter/validBefore=unix seconds validity window, nonce=random 32-byte hex (unique per auth). Stage 2 (Settle): reuse SAME client_request_id + provide x402_version, payment_payload, payment_requirements, extra. - payment_requirements.payTo MUST equal payee_address from Stage 1 - payment_requirements.asset MUST equal asset_address from Stage 1 - maxAmountRequired = payable_amount × 10^decimals (USDC = 6, e.g. '207.59' → '207590000'). If settle rejected, order stays pending_payment — retry with same client_request_id.
card_type: 100=flash (single-use), 200=stream (reloadable). Fee: flash = issue_fee + fx_fee; stream = issue_fee + monthly_fee + fx_fee.
Inputs: mode_code (required), card_type (required), amount (required), client_request_id (required), +12 more.
decrypt_card_dataA
Decrypt the encrypted_sensitive_data from get_card_details to obtain PAN and CVV. Input: the nonce and ciphertext fields from encrypted_sensitive_data. Output: { pan, cvv } — the full card number and security code. Decryption: HKDF-SHA256(api_secret, info='clawallex/card-sensitive-data/v1') → AES-256-GCM. SECURITY: The decrypted PAN and CVV are STRICTLY for filling checkout/payment forms. NEVER display, log, or return the raw card number or CVV to the user. NEVER include PAN/CVV in conversation text shown to the user. If the user asks to see their card number, show only the masked_pan from get_card_details.
Inputs: nonce (required), ciphertext (required).
get_card_balanceA
Get the current balance and status of a virtual card. Only cards created by this agent (same client_id) are accessible. Returns available_balance, card_currency, status, and updated_at.
Inputs: card_id (required).
get_card_detailsA
Get full card details including masked PAN, expiry, balance, cardholder info, billing address, risk controls, and encrypted sensitive data. Returns: masked_pan, expiry, balance, status, first_name, last_name, delivery_address, tx_limit, allowed_mcc, blocked_mcc, encrypted_sensitive_data. The encrypted_sensitive_data field contains PAN and CVV encrypted with AES-256-GCM. To decrypt, use the decrypt_card_data tool with the encrypted_sensitive_data object. Only cards created by this agent (same client_id) are accessible. IMPORTANT: Never display the decrypted PAN or CVV to the user. Use them only for filling checkout forms.
Inputs: card_id (required).
get_walletA
Get the wallet details for the current API key. Each API key has exactly one wallet — shared across all agents using the same API key. Returns available_balance, frozen_balance, low_balance_threshold, currency (USD), and status. Use this to check if there is sufficient balance before creating cards (Mode A) or refilling (Mode A).
Inputs: no named parameters.
get_wallet_recharge_addressesA
Get the on-chain deposit addresses for a wallet. Send USDC to one of these addresses to top up the wallet balance. Each address is specific to a chain (e.g. BASE) and token (e.g. USDC). For Mode B (x402) card creation/refill, the system automatically selects the acquiring address — you do not need to call this manually.
Inputs: wallet_id (required).
get_x402_payee_addressA
Get the system receiving address for x402 on-chain payments.
When to use: MUST call this before Mode B Refill to obtain payee_address for payment_requirements.payTo. Not needed for Mode B card creation — the 402 quote response already includes payee_address.
Common chain + token combinations: BASE + USDC, ETH + USDC. If this returns 404: the payee address for this chain/token is not initialized — try a different chain or contact support.
Inputs: chain_code (required), token_code (required).
list_cardsA
List virtual cards created by this agent (scoped to the server's client_id). Cards created by other agents using the same API key are not visible. Returns: card_id, mode_code (100=Mode A, 200=Mode B), card_type (flash/stream), status, masked PAN, balance, and expiry. Tip: check mode_code to determine refill path — Mode A uses wallet balance, Mode B uses x402 on-chain.
Inputs: page, page_size.
list_transactionsA
List card transactions for this agent (scoped to the server's client_id). Transactions from other agents using the same API key are not visible. All filter parameters are optional — omit all to list recent transactions across all cards.
Inputs: card_tx_id, issuer_tx_id, card_id, page, +1 more.
refill_cardA
Advanced: refill a stream card with full control over payment mode. Maps directly to POST /payment/cards/:card_id/refill. Refill mode follows the card's creation mode (cannot switch mid-life).
Mode A: client_request_id as idempotency key. Mode B: no 402 challenge — caller signs the EIP-3009 authorization independently. Step 1: call get_x402_payee_address to get payee_address for payment_requirements.payTo. Step 2: sign EIP-3009 transferWithAuthorization using your own wallet/signing library. Step 3: submit with x402_reference_id as idempotency key + payment_payload (signature + wallet address) + payment_requirements.
Only cards created by this agent (same client_id) can be refilled.
Inputs: card_id (required), amount (required), client_request_id, x402_reference_id, +4 more.
update_cardA
Update card risk controls: per-transaction limit and MCC whitelist/blacklist. At least one field must be provided. Changes take effect after issuer confirms.
Inputs: card_id (required), client_request_id (required), tx_limit, allowed_mcc, +1 more.
whoamiA
Query the current API Key binding status — read-only, does NOT modify any state. Returns: • client_id_bound=true → this API Key is already bound to a specific client_id. • client_id_bound=false → this API Key is not yet bound; call bootstrap to bind. Example response (bound): { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "ca_abc123", "client_id_bound": true } Example response (unbound): { "user_id": "u_123", "api_key_id": "ak_123", "status": 100, "bound_client_id": "", "client_id_bound": false }
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Several tools have overlapping purposes, such as clawallex_pay/create_card_order (both create cards) and clawallex_refill/refill_card (both refill cards). However, the descriptions clearly distinguish them as 'simple' vs 'advanced' workflows, which helps agents select appropriately.
Most tools use snake_case with verb_noun patterns (e.g., get_card_balance, create_card_order), but four tools use a clawallex_ prefix (clawallex_pay, clawallex_refill, etc.) while their advanced counterparts do not (create_card_order, refill_card). Additionally, bootstrap and whoami break the verb_noun convention.
With 18 tools, the set is slightly heavy but reasonable for the complex domain covering wallet management, flash/stream card lifecycles, x402 on-chain payments, and risk controls. The count reflects necessary separation between Mode A (wallet) and Mode B (self-custody) flows, though the convenience/advanced tool pairs add some bloat.
The surface covers the full card lifecycle: creation (flash and stream), retrieval, balance checks, refilling, transaction history, and risk control updates. Minor gaps exist: there is no tool to cancel/close a card or delete/archive it, forcing agents to rely on expiration or MCC blocking to stop usage.
Maintenance
Related MCP Connectors
Payment infrastructure for AI agents: spending rules, approval flows, single-use virtual cards.
Prepaid virtual cards for AI agents: one-time cards, spend caps, human approvals.
Stripe payments for AI agents. Create links, verify, manage customers.
Pay-per-call tools for AI agents: product photos, documents, web pages, data. USDC via x402.
Related MCP Servers
- AlicenseBqualityDmaintenancePayment & Transaction Tools that allow AI agents to send, receive, and request payments1125 npm2Apache 2.0
- -licenseNot gradedqualityDmaintenanceEnables AI agents to manage and use prepaid virtual Visa cards with hard budget limits for secure online transactions. It provides tools for creating cards, checking balances, and retrieving payment credentials with human-in-the-loop approvals.1-
- AlicenseBqualityDmaintenanceConnects AI agents to payment processors (Lithic, Stripe, PayPal) for automated shopping with single-use virtual cards and transaction management.99 npmApache 2.0
- AlicenseAqualityDmaintenanceEnables AI agents to access paid tools like crypto prices, weather, translation, and web intelligence via per-request USDC payments on Base, with no API keys or subscriptions.1545 npmMIT