ton-cli
Original:🇺🇸 English
Translated
Call TON MCP tools directly from the command line. Use when you want to query wallet info, check balances, send transactions, or run any TON wallet tool without starting an MCP server session. Works via `npx @ton/mcp@alpha <tool_name> [--arg value ...]`.
15installs
Sourceton-connect/kit
Added on
NPX Install
npx skill4agent add ton-connect/kit ton-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →TON MCP Raw CLI Mode
Run any TON wallet MCP tool directly from the command line. The binary invokes the tool, prints the JSON result to stdout, and exits.
Invocation Modes
| Command | Description |
|---|---|
| stdio MCP server (for Claude Desktop / MCP clients) |
| HTTP MCP server |
| Raw CLI: call one tool and exit |
Use exactly one mode for a given workflow: either MCP server mode (/) or raw CLI. Do not combine them in the same task/session.
stdio--httpRaw CLI Usage
bash
# No arguments
npx @ton/mcp@alpha get_balance
# Named arguments (--key value)
npx @ton/mcp@alpha get_transactions --limit 5
npx @ton/mcp@alpha get_jetton_balance --jettonAddress EQAbc...
# All values are passed as plain strings; JSON objects/arrays are also accepted
npx @ton/mcp@alpha get_transactions --limit 10
npx @ton/mcp@alpha send_ton --toAddress UQA... --amount 0.1 --comment "hi"Arguments are passed as pairs. Objects/arrays ( / ) are JSON-parsed; everything else is kept as a plain string.
--key value{...}[...]Output
All tools print JSON to stdout. Errors are printed to stderr and the process exits with code .
1bash
# Capture output for scripting
BALANCE=$(npx @ton/mcp@alpha get_balance)
echo $BALANCE | jq '.balance'Environment Variables
The CLI respects the same environment variables as the server:
| Variable | Description |
|---|---|
| |
| 24-word mnemonic for single-wallet mode |
| Hex-encoded private key (alternative to mnemonic) |
| |
| Optional Toncenter API key |
| Path to config file (default: |
Without or , the CLI uses the local config registry at (registry mode). In registry mode, wallet-scoped tools accept an optional to target a specific wallet by id, name, or address.
MNEMONICPRIVATE_KEY~/.config/ton/config.json--walletSelectorTool Reference
Wallet & Balance
| Tool | Required args | Optional args |
|---|---|---|
| — | |
| — | |
| | |
| | |
| — | |
| | |
| | |
| — | |
| | |
| — | — |
Wallet Registry (config-registry mode only)
| Tool | Required args | Optional args |
|---|---|---|
| — | — |
| — | — |
| | — |
| | — |
Transfers
| Tool | Required args | Optional args |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
Swaps
| Tool | Required args | Optional args |
|---|---|---|
| | |
NFTs
| Tool | Required args | Optional args |
|---|---|---|
| — | |
| | |
| | |
DNS
| Tool | Required args | Optional args |
|---|---|---|
| | |
| | |
Example Session
bash
# Check wallet address and network
npx @ton/mcp@alpha get_wallet
# Check TON balance
npx @ton/mcp@alpha get_balance
# List all tokens
npx @ton/mcp@alpha get_jettons
# Last 10 transactions
npx @ton/mcp@alpha get_transactions --limit 10
# Get balance of a specific jetton
npx @ton/mcp@alpha get_jetton_balance --jettonAddress EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs
# Resolve a .ton domain
npx @ton/mcp@alpha resolve_dns --domain foundation.ton
# In registry mode: check balances for a named wallet
npx @ton/mcp@alpha get_balance --walletSelector "my-hot-wallet"
# In registry mode: list all registered wallets
npx @ton/mcp@alpha list_wallets
# Send TON (always confirm with user first)
npx @ton/mcp@alpha send_ton --toAddress UQA... --amount 0.5 --comment "payment"
# Swap quote
npx @ton/mcp@alpha get_swap_quote --fromToken TON --toToken EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs --amount 1Notes
- Use to dry-run any transaction before sending — it returns expected balance changes, fees, and high-level actions
emulate_transaction - Always confirm with the user before running ,
send_ton,send_jetton, orsend_nft;send_raw_transaction - For confirmations and small option sets, prefer the host client's structured confirmation/choice UI when available; otherwise use a short natural-language yes/no prompt and never require an exact magic word;
- After sending, poll until status is
get_transaction_status --normalizedHash <hash>orcompleted(unless the user asks to skip).failed - In registry mode the active wallet from is used by default.
~/.config/ton/config.json