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#

prompt
Send 5 USDC to 0x9A3f…72b1 on Sepolia.
  1. Find the token's decimals

    The agent calls get-token on metamask-mcp. USDC uses 6 decimals, which erc20-mcp needs to encode the amount correctly.

  2. Prepare the transfer

    prepare-transfer on 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 as address and the encoded call as data.

  3. Approve it in MetaMask

    The agent passes address as to, with the data, into send-transaction. MetaMask shows the transfer. Check the recipient, amount and network, then confirm.

  4. Wait for confirmation

    wait-for-transaction-receipt returns 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:

prompt
Approve 0xC0ffee…0001 to spend 20 USDC on Sepolia.
Important. Approve only the amount you need. An approval stays in place until you change it, and the spender can use it at any time.

Check an allowance or total supply#

Reads use the same pattern, but finish with a free call instead of a signature:

  1. Prepare the read

    prepare-allowance (with owner and spender) or prepare-total-supply returns prepareForAction: "call".

  2. Call the contract

    metamask-mcp's call runs it without a transaction and returns raw hex.

  3. Decode the result

    resolve-allowance or resolve-total-supply turns the hex into a readable amount, using the token's decimals.

Tip. To check a plain balance, skip all of this: get-token-balance on metamask-mcp does it in one step.