@moonpay/cli
v1.101.4
Published
MoonPay CLI — how agents move money
Readme
MoonPay CLI
Your agent needs money. Give your agents crypto.
MoonPay is how agents move money — non-custodial wallets, swaps, bridges, transfers, deposits, market data, and fiat on/off ramps. One CLI for everything.
- Install:
npm i -g @moonpay/cli - Primary command:
moonpay - Alias:
mp
Quick start
npm i -g @moonpay/cli
mp consent accept
mp login --email [email protected]
mp verify --email [email protected] --code 123456
mp wallet create --name "main"Wallets
Local wallets stored encrypted in ~/.config/moonpay/wallets/, one file per wallet, under a random passphrase held in your OS keychain. Keys never leave the machine. Record your mnemonic somewhere off the machine — it is the only recovery path if the keychain entry is lost.
First-time key creation waits for any other initializer to finish. If it times out, stop all MoonPay CLI processes using that configuration directory before removing only the .lock file named in the error, then retry. Locks are never reclaimed automatically: a slow keychain prompt must not allow a second process to replace the key. Do not remove the key file itself. If a fallback key file is unreadable or empty, restore access to the original file or recover it from a backup; the CLI refuses to generate a replacement.
mp wallet create --name "main"
mp wallet list
mp wallet retrieve --wallet "main"
mp wallet export --wallet "main" # interactive only
mp wallet delete --wallet "main" --confirmBalances
mp token balance list --wallet <address> --chain solana
mp token balance list --wallet 0x... --chain ethereum
mp bitcoin balance retrieve --wallet <btc-address>Token research
mp token trending list --chain solana --limit 5 --page 1
mp token search --query "USDC" --chain solana
mp token retrieve --token <address> --chain solanaSwap and bridge
# Same-chain swap
mp token swap \
--wallet main --chain solana \
--from-token So11111111111111111111111111111111111111111 \
--from-amount 0.1 \
--to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Cross-chain bridge
mp token bridge \
--from-wallet main --from-chain ethereum \
--from-token 0x0000000000000000000000000000000000000000 \
--from-amount 0.003 \
--to-chain polygon \
--to-token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174Buy with fiat
mp buy --token SOL --chain solana --amount 1 --wallet mainSkills
Skills teach AI agents how to use the CLI. Install them for Claude Code, Claude Desktop, or any MCP-compatible agent.
mp skill list
mp skill installMCP server
Run as an MCP server for Claude Desktop or Claude Code:
mp mcpLocal API (mp serve)
Same routes as production, on loopback — keeps a warm Node process so UIs don't pay CLI spawn cost:
mp serve # 127.0.0.1:8787
mp serve --port 8787GET http://127.0.0.1:8787/healthPOST http://127.0.0.1:8787/api/tools/<tool_name>— same path + JSON body ashttps://agents.moonpay.com/api/tools/<tool_name>
Writes ~/.config/moonpay/serve.json for discovery. A second mp serve on the same port exits after confirming the existing instance is healthy. Loopback only.
All commands
mp toolsTroubleshooting
- Auth errors: run
mp loginagain. - Outdated CLI: run
npm i -g @moonpay/clito update.
