Guides
Send ERC-20 tokens
Send, approve and check allowances for any ERC-20 token, with every state change confirmed in your wallet.
You'll need metamask-mcp and erc20-mcp enabled, and a connected wallet. This guide uses Sepolia USDC (0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238).
Send tokens#
Send 5 USDC to 0x9A3f…72b1 on Sepolia.Find the token's decimals
The agent calls
get-tokenon metamask-mcp. USDC uses 6 decimals, which erc20-mcp needs to encode the amount correctly.Prepare the transfer
prepare-transferon erc20-mcp takes the amount in normal units, here"5", and converts it using the decimals.prepare-transfer input{ "tokenAddress": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238", "tokenDecimal": 6, "to": "0x9A3f…72b1", "amount": "5" }It returns
prepareForAction: "send-transaction"with the token contract asaddressand the encoded call asdata.Approve it in MetaMask
The agent passes
addressasto, with thedata, intosend-transaction. MetaMask shows the transfer. Check the recipient, amount and network, then confirm.Wait for confirmation
wait-for-transaction-receiptreturns once the transaction is in a block, and the agent reports the hash.
Approve a spender#
Some contracts, such as exchanges, need permission to move your tokens. prepare-approve works like a transfer, with a spender instead of a recipient:
Approve 0xC0ffee…0001 to spend 20 USDC on Sepolia.Check an allowance or total supply#
Reads use the same pattern, but finish with a free call instead of a signature:
Prepare the read
prepare-allowance(withownerandspender) orprepare-total-supplyreturnsprepareForAction: "call".Call the contract
metamask-mcp's
callruns it without a transaction and returns raw hex.Decode the result
resolve-allowanceorresolve-total-supplyturns the hex into a readable amount, using the token's decimals.
get-token-balance on metamask-mcp does it in one step.