MoonPay CLI
Your agent needs money. Give your agents crypto.
MoonPay is the crypto onramp for AI agents — non-custodial wallets, swaps, bridges, transfers, DCA, limit orders, deposits, market data, and fiat on/off ramps. One CLI for everything.
Base URL: INLINECODE0
What is MoonPay CLI?
MoonPay CLI gives AI agents and humans full access to crypto:
- - Non-custodial — Local wallets with OS keychain encryption. Keys never leave the machine.
- Multi-chain — Solana, Ethereum, Base, Polygon, Arbitrum, Optimism, BNB, Avalanche, TRON, Bitcoin
- Multi-surface — MoonPay CLI (
mp), local MCP server (mp mcp), web chat - Trading — Swap, bridge, transfer, DCA, limit orders, stop losses
- Market intelligence — Trending tokens, token analysis, price data, price alerts
- Deposits — Multi-chain deposit links with automatic stablecoin conversion
- Fiat on/off-ramp — Buy crypto with fiat (USD), virtual accounts with KYC
- Deposits — Multi-chain deposit links with automatic stablecoin conversion
Quick Start
Option A: CLI (Recommended)
CODEBLOCK0
Option B: MCP Server (Local)
Run mp mcp to start a local MCP server over stdio. This exposes all CLI + remote tools to any MCP-compatible client (Claude Desktop, Cursor, Claude Code).
CODEBLOCK1
Option C: REST API
CODEBLOCK2
Authentication
CLI: Run mp login --email you@example.com to open a browser page with hCaptcha. After solving the captcha, a verification code is sent to your email. Run mp verify --email you@example.com --code 123456. Credentials are stored encrypted at ~/.config/moonpay/credentials.json and auto-refresh. Run mp logout to clear stored credentials.
REST API: Use a Bearer token in the Authorization header. Obtain tokens via the login/verify flow or OAuth 2.0 with PKCE.
Rate limits: 5 requests/min (anonymous), 60 requests/min (authenticated).
Terms of Use: https://www.moonpay.com/legal/termsofuseeuropehypermint
Core Tools
Wallet Management
Wallets are HD (BIP39) — one mnemonic derives addresses for all chains. EVM wallets share a single address across Ethereum, Base, Polygon, Arbitrum, Optimism, BNB, and Avalanche.
CODEBLOCK3
Token Trading
Swaps, bridges, and transfers sign locally — keys never leave the machine.
CODEBLOCK4
Market Data
CODEBLOCK5
Fiat On-Ramp
CODEBLOCK6
Deposits
CODEBLOCK7
Signing
CODEBLOCK8
Safety Rules
CLI tools (mp token swap, mp token bridge, mp token transfer) handle the full build, sign, broadcast flow automatically. Keys are signed locally and never sent to the server.
For server-side tools (REST API / MCP), use the simulate-then-execute pattern:
- 1. Always simulate first — call with
"simulation": true to get a quote - Show the quote — display expected output, fees, slippage
- Get explicit confirmation — never auto-execute without user approval
- Execute — call with
"simulation": false only after confirmation
CLI Tools by Category
Auth
| Tool | Description |
|---|
| INLINECODE14 | Open browser for hCaptcha verification, sends email code |
| INLINECODE15 |
Verify login code and store encrypted credentials |
|
logout | Log out and clear stored credentials |
|
user retrieve | Get the currently authenticated user |
|
consent check | Check whether Terms of Service have been accepted |
|
consent accept | Accept the Terms of Service and Privacy Policy |
Wallet
| Tool | Description |
|---|
| INLINECODE20 | Create multi-chain HD wallet |
| INLINECODE21 |
Import from mnemonic or private key |
|
wallet list | List all local wallets |
|
wallet retrieve | Get wallet details |
|
wallet rename | Rename a wallet |
|
wallet delete | Delete a local wallet |
|
wallet export | Export mnemonic (interactive only) |
Token Trading
| Tool | Description |
|---|
| INLINECODE27 | Swap tokens on the same chain |
| INLINECODE28 |
Bridge tokens across chains |
|
token transfer | Transfer tokens to another address |
Market Data
| Tool | Description |
|---|
| INLINECODE30 | Search tokens by name/symbol/address |
| INLINECODE31 |
Token metadata + market data |
|
token trending list | Trending tokens by chain |
|
token balance list | List token balances for a wallet |
|
bitcoin balance retrieve | Get BTC balance |
Transactions
| Tool | Description |
|---|
| INLINECODE35 | List swap/bridge transaction history |
| INLINECODE36 |
Get transaction details |
|
transaction sign | Sign a transaction locally |
|
transaction send | Broadcast a signed transaction |
|
message sign | Sign a message (EIP-191, ed25519, ECDSA) |
Fiat
| Tool | Description |
|---|
| INLINECODE40 | Buy crypto with fiat via MoonPay checkout (amount in USD) |
| INLINECODE41 |
Create virtual account + start KYC |
|
virtual-account retrieve | Get account status |
|
virtual-account wallet list | List wallets registered for fiat on-ramp |
|
virtual-account wallet register | Register wallet for fiat on-ramp |
|
virtual-account onramp create | Create fiat to stablecoin onramp |
|
virtual-account onramp retrieve | Get onramp details and banking info |
|
virtual-account onramp list | List onramps |
|
virtual-account onramp delete | Cancel an onramp |
|
virtual-account onramp payment create | Create open banking payment link |
|
virtual-account onramp payment retrieve | Get payment status |
|
virtual-account transaction list | List fiat to stablecoin conversion history |
|
virtual-account kyc restart | Start or restart KYC verification |
|
virtual-account kyc continue | Check KYC status or get verification link |
|
virtual-account agreement list | List legal agreements (pending or accepted) |
|
virtual-account agreement accept | Accept a required legal agreement |
Deposits
| Tool | Description |
|---|
| INLINECODE56 | Create multi-chain deposit link (USDC, USDC.e, USDT) |
| INLINECODE57 |
Get deposit details |
|
deposit transaction list | List incoming deposit transactions |
x402
| Tool | Description |
|---|
| INLINECODE59 | Make paid API request with automatic payment |
Skills
| Tool | Description |
|---|
| INLINECODE60 | List available AI skills |
| INLINECODE61 |
Get skill instructions |
|
skill install | Install skills for Claude Code |
Feedback
| Tool | Description |
|---|
| INLINECODE63 | Submit feedback (type: bug, feature, or general) |
x402 Rate Limit Upgrade
Pay to increase your API rate limit via the x402 protocol.
Endpoint: POST https://agents.moonpay.com/x402/upgrade
| Duration | Price | Length |
|---|
| day | $1 USDC | 24 hours |
| month |
$20 USDC | 30 days |
CODEBLOCK9
Payment: USDC via x402 on Solana or Base. Requires login. Payment is only settled on success.
Pre-Built Skills
Install AI skills for Claude Code:
CODEBLOCK10
| Skill | Description |
|---|
| INLINECODE65 | CLI setup, login, wallet creation |
| INLINECODE66 |
Open tx/wallet/token in chain explorers |
|
moonpay-buy-crypto | Buy crypto with fiat |
|
moonpay-check-wallet | View balances and portfolio |
|
moonpay-deposit | Create deposit links with stablecoin conversion |
|
moonpay-discover-tokens | Search, trending, risk assessment |
|
moonpay-export-data | Export portfolio/tx history to CSV/JSON |
|
moonpay-feedback | Submit bug reports and feature requests |
|
moonpay-mcp | Configure MoonPay as MCP server |
|
moonpay-missions | Guided walkthrough of capabilities |
|
moonpay-polymarket-ready | Fund Polygon wallet for Polymarket |
|
moonpay-price-alerts | Desktop notifications at target prices |
|
moonpay-swap-tokens | Swap and bridge tokens |
|
moonpay-trading-automation | DCA, limit orders, stop losses via cron/launchd |
|
moonpay-upgrade | Upgrade rate limit via x402 payment |
|
moonpay-virtual-account | Fiat on-ramp with KYC |
|
moonpay-x402 | Paid API requests |
Supported Chains
| Chain | Chain ID | Features |
|---|
| Solana | INLINECODE82 | Full trading, limit orders, DCA |
| Ethereum |
ethereum | Swap, bridge, transfer, market data |
| Base |
base | Swap, bridge, transfer, market data |
| Polygon |
polygon | Swap, bridge, transfer, market data |
| Arbitrum |
arbitrum | Swap, bridge, transfer, market data |
| Optimism |
optimism | Swap, bridge, transfer, market data |
| BNB |
bnb | Swap, bridge, transfer, market data |
| Avalanche |
avalanche | Swap, bridge, transfer, market data |
| TRON |
tron | Wallet addresses |
| Bitcoin |
bitcoin | Balance, bridges |
Tips for Agents
- - Resolve token addresses first — call
token search before trading if you only have a name/symbol - Check balances — use
token balance list before trading to confirm available amounts - Native token addresses — Solana:
So11111111111111111111111111111111111111111, EVM: INLINECODE95 - EVM wallets share one address across Ethereum, Base, Polygon, Arbitrum, Optimism, BNB, Avalanche
- CLI signs locally —
mp token swap, mp token bridge, mp token transfer handle the full flow (build → sign → broadcast) - Use
-f compact when piping CLI output to jq for scripting
Links
- - Web App: https://agents.moonpay.com
- CLI: INLINECODE101
- MCP Server:
mp mcp (local, stdio) - Skills: INLINECODE103
MoonPay CLI
你的智能体需要资金。给你的智能体加密货币。
MoonPay 是面向AI智能体的加密货币入口——提供非托管钱包、兑换、跨链桥、转账、定投、限价单、存款、市场数据和法币出入金。一个CLI搞定一切。
基础URL: https://agents.moonpay.com
什么是MoonPay CLI?
MoonPay CLI让AI智能体和人类都能完全访问加密货币:
- - 非托管 — 使用操作系统密钥链加密的本地钱包。密钥永不离开机器。
- 多链 — Solana、Ethereum、Base、Polygon、Arbitrum、Optimism、BNB、Avalanche、TRON、Bitcoin
- 多界面 — MoonPay CLI (mp)、本地MCP服务器 (mp mcp)、网页聊天
- 交易 — 兑换、跨链桥、转账、定投、限价单、止损
- 市场情报 — 热门代币、代币分析、价格数据、价格提醒
- 存款 — 多链存款链接,自动兑换稳定币
- 法币出入金 — 用法币(USD)购买加密货币,支持KYC的虚拟账户
- 存款 — 多链存款链接,自动兑换稳定币
快速开始
选项A:CLI(推荐)
bash
安装
npm install -g @moonpay/cli
登录(打开浏览器进行验证码验证)
mp login --email you@example.com
打开URL,完成验证码,从邮箱获取验证码
mp verify --email you@example.com --code 123456
创建钱包
mp wallet create --name main
列出工具
mp tools
搜索代币
mp token search --query SOL --chain solana --limit 5
查看余额
mp token balance list --wallet main --chain solana
选项B:MCP服务器(本地)
运行 mp mcp 启动一个基于stdio的本地MCP服务器。这将向任何兼容MCP的客户端(Claude Desktop、Cursor、Claude Code)暴露所有CLI和远程工具。
json
{
mcpServers: {
moonpay: {
command: mp,
args: [mcp]
}
}
}
选项C:REST API
bash
curl -X POST https://agents.moonpay.com/api/tools/token_search \
-H Authorization: Bearer YOURACCESSTOKEN \
-H Content-Type: application/json \
-d {query: SOL, chain: solana, limit: 5}
身份认证
CLI: 运行 mp login --email you@example.com 打开一个带有hCaptcha的浏览器页面。完成验证码后,验证码会发送到你的邮箱。运行 mp verify --email you@example.com --code 123456。凭证加密存储在 ~/.config/moonpay/credentials.json 并自动刷新。运行 mp logout 清除存储的凭证。
REST API: 在 Authorization 头部使用Bearer令牌。通过登录/验证流程或OAuth 2.0 with PKCE获取令牌。
速率限制: 5次/分钟(匿名),60次/分钟(已认证)。
使用条款: https://www.moonpay.com/legal/termsofuseeuropehypermint
核心工具
钱包管理
钱包是HD(BIP39)钱包——一个助记词派生所有链的地址。EVM钱包在Ethereum、Base、Polygon、Arbitrum、Optimism、BNB和Avalanche上共享一个地址。
bash
mp wallet create --name main # 创建HD钱包(Solana + EVM + Bitcoin + TRON)
mp wallet import --name funded # 从助记词或私钥导入(交互式)
mp wallet list # 列出所有钱包(显示所有链地址)
mp wallet retrieve --wallet main # 获取钱包详情
mp wallet rename --wallet old --name new # 重命名钱包
mp wallet export --wallet main # 导出助记词(仅交互式)
mp wallet delete --wallet old # 永久删除钱包
代币交易
兑换、跨链桥和转账在本地签名——密钥永不离开机器。
bash
兑换(同链)
mp token swap \
--wallet main --chain solana \
--from-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--from-amount 5 \
--to-token So11111111111111111111111111111111111111111
跨链桥(跨链)
mp token bridge \
--from-wallet main --from-chain polygon \
--from-token 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174 \
--from-amount 6 \
--to-chain solana \
--to-token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--to-wallet
转账
mp token transfer \
--wallet main --chain solana \
--token EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--amount 10 \
--to
市场数据
bash
搜索代币
mp token search --query BONK --chain solana --limit 5
代币详情 + 市场数据
mp token retrieve --token --chain solana
热门代币
mp token trending list --chain solana --limit 10 --page 1
查看余额
mp token balance list --wallet --chain solana
法币入金
bash
用法币购买加密货币(金额以美元计,返回结账URL)
mp buy --token sol --amount 50 --wallet --email
虚拟账户(基于KYC的法币入金)
mp virtual-account create
mp virtual-account wallet register --wallet main --chain solana
mp virtual-account onramp create --name USD to USDC --fiat USD --chain solana --stablecoin USDC
存款
bash
创建多链存款链接
mp deposit create --name My Deposit --wallet --chain solana --token USDC
查看存款详情
mp deposit retrieve --id
列出存款交易
mp deposit transaction list --id
签名
bash
签名消息
mp message sign --wallet main --chain solana --message hello
签名交易
mp transaction sign --wallet main --chain solana --transaction
发送已签名的交易
mp transaction send --chain solana --transaction
安全规则
CLI工具(mp token swap、mp token bridge、mp token transfer)自动处理完整的构建、签名、广播流程。密钥在本地签名,永不发送到服务器。
对于服务器端工具(REST API / MCP),使用先模拟后执行模式:
- 1. 始终先模拟 — 使用 simulation: true 调用以获取报价
- 显示报价 — 展示预期输出、费用、滑点
- 获取明确确认 — 未经用户批准绝不自动执行
- 执行 — 仅在确认后使用 simulation: false 调用
按类别分类的CLI工具
认证
| 工具 | 描述 |
|---|
| login | 打开浏览器进行hCaptcha验证,发送邮箱验证码 |
| verify |
验证登录验证码并存储加密凭证 |
| logout | 登出并清除存储的凭证 |
| user retrieve | 获取当前已认证用户 |
| consent check | 检查是否已接受服务条款 |
| consent accept | 接受服务条款和隐私政策 |
钱包
| 工具 | 描述 |
|---|
| wallet create | 创建多链HD钱包 |
| wallet import |
从助记词或私钥导入 |
| wallet list | 列出所有本地钱包 |
| wallet retrieve | 获取钱包详情 |
| wallet rename | 重命名钱包 |
| wallet delete | 删除本地钱包 |
| wallet export | 导出助记词(仅交互式