CLI toolkit and MCP server for the Tempo blockchain.
- 126 MCP Tools - Complete blockchain operations accessible via Model Context Protocol
- CLI Interface - Command-line interface for all operations
- TIP-20 Token Operations - Transfer, approve, mint, burn, and role management
- DEX Integration - Swap, limit orders, and price calculations
- Account Management - Balances, nonces, fee tokens
- Access Key Management - Authorize and revoke access keys
- Policy System - Create and manage transfer policies (TIP-403)
- Rewards Distribution - Claim and distribute rewards
- Testnet Faucet - Fund addresses on testnet
Install globally to use the baton command anywhere:
npm install -g @augmnt-sh/batonOr run directly with npx (no installation required):
npx @augmnt-sh/baton <command>Install as a project dependency:
npm install @augmnt-sh/batongit clone https://github.com/augmnt/baton.git
cd baton
npm install
npm run buildThe fastest way to get started is using the interactive setup wizard:
baton initThis will guide you through:
- Creating a new wallet or importing an existing one
- Choosing your network (testnet or mainnet)
- Saving your configuration to
.env - Optionally funding your wallet from the testnet faucet
$ baton init
██████╗ █████╗ ████████╗ ██████╗ ███╗ ██╗
██╔══██╗██╔══██╗╚══██╔══╝██╔═══██╗████╗ ██║
██████╔╝███████║ ██║ ██║ ██║██╔██╗ ██║
██╔══██╗██╔══██║ ██║ ██║ ██║██║╚██╗██║
██████╔╝██║ ██║ ██║ ╚██████╔╝██║ ╚████║
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
Welcome to Baton Setup
? How would you like to set up your wallet?
❯ Create a new wallet
Import existing wallet (private key)
Import from mnemonic phrase
? Generate recovery phrase (mnemonic)? Yes
✓ Wallet generated successfully!
Address: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
Mnemonic: word1 word2 word3 ... word12
⚠️ IMPORTANT: Write down your mnemonic phrase and store it safely!
? Which network would you like to use?
❯ Testnet (recommended for getting started)
Mainnet
? Save configuration to .env file? Yes
✓ Configuration saved to .env
? Fund wallet from testnet faucet? Yes
✓ Funded successfully!
🚀 You're all set!
To update your configuration later:
# Interactive configuration menu
baton config
# Or use specific commands:
baton config show # View current config
baton config set-key # Update private key (secure input)
baton config set-network # Change networkSecurity Note: The set-key command uses secure password-style input - your private key is never visible on screen or saved to shell history.
Baton uses the following environment variables:
| Variable | Required | Description |
|---|---|---|
TEMPO_PRIVATE_KEY |
For write ops | Private key for signing transactions |
TEMPO_RPC_URL |
No | Custom RPC endpoint (defaults to Tempo testnet) |
TEMPO_EXPLORER_URL |
No | Custom block explorer URL |
TEMPO_NETWORK |
No | mainnet or testnet (default: testnet) |
Option 1: MCP Server Config (Recommended for Claude)
Pass environment variables directly when adding the MCP server:
claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcpThis is the most secure method as the key is stored in Claude's MCP configuration and not exposed in shell history or environment.
Option 2: Shell Profile
Add to ~/.zshrc or ~/.bashrc:
export TEMPO_PRIVATE_KEY=0x...
export TEMPO_NETWORK=testnetOption 3: .env File
Create a .env file in the working directory:
TEMPO_PRIVATE_KEY=0x...
TEMPO_RPC_URL=https://rpc.moderato.tempo.xyz
TEMPO_NETWORK=testnetNote: For MCP servers, the .env file must be in the directory where Claude is running (your project directory), not the baton installation directory.
# Interactive setup wizard (recommended for new users)
baton init
# Configuration management
baton config # Interactive config menu
baton config show # View current configuration
baton config set-key # Update private key (secure input)
baton config set-network # Change network (mainnet/testnet)# Generate a new wallet
baton wallet new
# Generate with mnemonic
baton wallet new --mnemonic
# Derive address from private key
baton wallet derive <privateKey>
# Derive from mnemonic
baton wallet from-mnemonic "word1 word2 ..."# Get all balances
baton balances <address>
# Get specific token balance
baton account balance <address> --token <tokenAddress>
# Get account info
baton account info <address>
# Get nonce
baton account nonce <address># Get token info
baton token info <tokenAddress>
# Transfer tokens
baton token transfer <tokenAddress> <to> <amount>
# Transfer with memo
baton token transfer <tokenAddress> <to> <amount> --memo "Payment for services"
# Approve spender
baton token approve <tokenAddress> <spender> <amount>
# Get allowance
baton token allowance <tokenAddress> <owner> <spender>
# Mint tokens (requires MINTER_ROLE)
baton token mint <tokenAddress> <to> <amount>
# Burn tokens
baton token burn <tokenAddress> <amount># Get swap quote
baton dex quote <tokenIn> <tokenOut> <amountIn>
# Execute swap
baton dex swap <tokenIn> <tokenOut> <amountIn>
# Place limit order
baton dex order <token> <amount> <tick> --buy
baton dex order <token> <amount> <tick> --sell
# Cancel order
baton dex cancel <orderId>
# Get order info
baton dex order-info <orderId>
# Price utilities
baton dex price --tick 100
baton dex price --price 1.01# Get chain info
baton chain info
# Get block number
baton chain block-number
# Get block
baton chain block <blockNumber>
# Get transaction
baton chain tx <txHash># Fund address
baton faucet fund <address>
# Check faucet status
baton faucet status
# Check cooldown
baton faucet cooldown <address># Use testnet
baton --network testnet <command>
# Use custom RPC
baton --rpc https://custom-rpc.example.com <command>
# JSON output
baton <command> -o jsonbaton mcpBasic setup (read-only operations):
claude mcp add baton -- npx @augmnt-sh/baton mcpWith private key for write operations:
claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcpFor testnet:
claude mcp add baton -e TEMPO_NETWORK=testnet -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcpTo update configuration, remove and re-add:
claude mcp remove baton
claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcpUser-level (available in all projects):
claude mcp add -s user baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcpAdd the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"baton": {
"command": "node",
"args": ["/path/to/baton/dist/src/mcp-server.js"],
"env": {
"TEMPO_NETWORK": "testnet",
"TEMPO_PRIVATE_KEY": "0x..."
}
}
}
}Or if installed globally via npm:
{
"mcpServers": {
"baton": {
"command": "npx",
"args": ["@augmnt-sh/baton", "mcp"],
"env": {
"TEMPO_NETWORK": "testnet"
}
}
}
}The MCP server provides 126 tools organized by domain:
| Domain | Tools | Description |
|---|---|---|
| Chain | 5 | Block and transaction queries |
| Wallet | 6 | Wallet generation and derivation |
| Account | 13 | Balance and account info |
| Token | 14 | TIP-20 token operations |
| DEX | 10 | Swap and order management |
| Fees | 9 | Fee token management |
| Fee AMM | 7 | Fee liquidity operations |
| Keychain | 11 | Access key management |
| Policy | 8 | Transfer policy management |
| Rewards | 10 | Rewards distribution |
| History | 7 | Transfer history |
| Faucet | 8 | Testnet faucet |
| Contracts | 8 | Generic contract operations |
| Utils | 10 | Utility functions |
tempo://tokens/known- Known token addressestempo://contracts/addresses- Contract addressestempo://contracts/abis/tip20- TIP-20 ABItempo://config/network- Current network config
transfer-tokens- Guided token transfer workflowswap-tokens- Guided swap workflowcheck-account- Complete account overviewnew-wallet- Generate and fund new wallet
import {
generateWallet,
getBalances,
transfer,
getSwapQuote,
swap,
} from '@augmnt-sh/baton'
// Generate wallet
const wallet = generateWallet()
console.log(wallet.address)
// Get balances
const balances = await getBalances('0x...')
// Transfer tokens
const result = await transfer({
token: '0x20c0000000000000000000000000000000000001',
to: '0x...',
amount: 100000000n, // 100 tokens (6 decimals)
})
// Swap tokens
const quote = await getSwapQuote({
tokenIn: '0x20c0000000000000000000000000000000000000',
tokenOut: '0x20c0000000000000000000000000000000000001',
amountIn: 100000000n,
})
const swapResult = await swap({
tokenIn: '0x20c0000000000000000000000000000000000000',
tokenOut: '0x20c0000000000000000000000000000000000001',
amountIn: 100000000n,
})All TIP-20 tokens use 6 decimal places. Amounts in the CLI are human-readable:
# Transfer 100.5 tokens
baton token transfer <token> <to> 100.5In code, use the smallest unit:
import { parseAmount, formatAmount } from '@augmnt-sh/baton'
const amount = parseAmount('100.5') // 100500000n
const formatted = formatAmount(100500000n) // "100.5"Memos are encoded as bytes32:
# String memo (max 31 chars)
baton token transfer <token> <to> 100 --memo "Payment"
# Or hex bytes32
baton token transfer <token> <to> 100 --memo "0x..."DEX prices use tick values:
import { priceToTick, tickToPrice } from '@augmnt-sh/baton'
const tick = priceToTick(1.0001) // Get tick for price
const price = tickToPrice(100) // Get price from tick| Token | Address |
|---|---|
| pathUSD | 0x20c0000000000000000000000000000000000000 |
| AlphaUSD | 0x20c0000000000000000000000000000000000001 |
| BetaUSD | 0x20c0000000000000000000000000000000000002 |
| ThetaUSD | 0x20c0000000000000000000000000000000000003 |
| Contract | Address |
|---|---|
| TIP20_FACTORY | 0x20fc000000000000000000000000000000000000 |
| STABLECOIN_DEX | 0xdec0000000000000000000000000000000000000 |
| FEE_MANAGER | 0xfeec000000000000000000000000000000000000 |
| ACCOUNT_KEYCHAIN | 0xAAAAAAAA00000000000000000000000000000000 |
| FEE_AMM | 0xfee0000000000000000000000000000000000000 |
| POLICY_REGISTRY | 0x403000000000000000000000000000000000000 |
| MULTICALL3 | 0xcA11bde05977b3631167028862bE2a173976CA11 |
- Never share your private key
- Private keys are read from
TEMPO_PRIVATE_KEYenvironment variable - Keys are never logged or stored
- Use access keys for delegated permissions
MIT