io.github.nirholas/x402-bridge icon

x402 Universal Payer

Pay any x402 endpoint on the open web: auto-paying bridge with Bazaar discovery and spend caps.

stdiocommunityservice

Package Details

Transportstdio
Runtimenpx

Environment Variables

MCP_BRIDGE_EVM_PRIVATE_KEY(str)
Secret

0x-prefixed 32-byte hex private key that funds USDC payments on EVM chains (Base, Arbitrum, …). At least one of the EVM/SVM keys is required. Treat like cash — use a dedicated low-balance wallet.

MCP_BRIDGE_SVM_PRIVATE_KEY(str)
Secret

Solana secret key that funds USDC payments: base58 64-byte secret key (Phantom / solana-keygen format) or a JSON array of 64 integers. At least one of the EVM/SVM keys is required. Treat like cash.

MCP_BRIDGE_MAX_PRICE_PER_CALL_ATOMIC(num)
Default:100000

Per-call spending cap in atomic units (USDC has 6 decimals). Payments above this abort with a clear reason.

MCP_BRIDGE_MAX_TOTAL_ATOMIC(num)
Default:1000000

Cumulative session spending ceiling in atomic units. Once total spend would exceed it, further payments abort until restart.

MCP_BRIDGE_ALLOWED_PAYTO(str)

Comma-separated payee allowlist. When set, any payment whose payTo address is not listed is refused.

MCP_BRIDGE_ALLOWED_HOSTS(str)

Comma-separated hostname allowlist for outbound paid requests. When set, any other host is refused before a request is signed.

MCP_BRIDGE_ALLOW_HTTP(bool)
Default:0

Set to 1 to allow http:// targets (local development only). https is enforced otherwise.

MCP_BRIDGE_DISCOVER_LIMIT(num)
Default:20

Max number of x402 Bazaar resources to register as dynamic tools at startup. Set 0 to disable discovery.

MCP_BRIDGE_BAZAAR_URL(str)
Default:https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources

x402 Bazaar discovery endpoint. Override to point at a self-hosted or alternative bazaar.

MCP_BRIDGE_BATCH_DEPOSIT_MULTIPLIER(num)
Default:5

How many request-amounts to deposit at once when opening an EVM batch-settlement channel.

MCP_BRIDGE_MAX_DEPOSIT_ATOMIC(num)
Default:5000000

Hard cap in atomic units on a single batch-settlement channel deposit or top-up.

X402_MCP_BRIDGE_CHANNELS_DIR(str)
Default:~/.x402-mcp-bridge/channels

Directory for persisted batch-settlement channel state (survives client restarts).

RPC_URL_8453(str)

Per-chain RPC override, one variable per chain id (RPC_URL_<chainId>, e.g. RPC_URL_8453 for Base). Defaults to viem's public RPC for that chain.