MCP servers
erc20-mcp
The token module. It turns token actions into encoded calls ready for your wallet. It never sends anything itself.
Install#
Add it to your MCP client's config. Requires Node.js 20 or newer. See the quick start for where the config file lives.
{
"mcpServers": {
"erc20": { "command": "npx", "args": ["-y", "@roxi-os/erc20-mcp"] }
}
}From source
git clone https://github.com/ROXI-OS-SI/erc20-mcp.git
cd erc20-mcp
pnpm install
pnpm buildThen use "command": "node" with the absolute path to build/index.js as the argument.
How results are used#
Every prepare-* tool returns prepareForAction, the token contract as address, and the encoded data. The agent finishes with the metamask-mcp tool named in prepareForAction:
send-transaction
transfer, approve, mint
Asks for your signature
call
allowance, total supply
Free read, then resolve-*
deploy-contract
new token
Asks for your signature
Walkthrough: Send ERC-20 tokens.
Tools#
Writes
prepare-transfer
Prepare a token transfer. Finish with send-transaction.
| Parameter | Type | Description |
|---|---|---|
| tokenAddress | string (0x…) | The token contract address. |
| tokenDecimal | number | The token's decimals, for example 6 for USDC. |
| to | string (0x…) | Recipient address. |
| amount | string | Amount in normal units, such as "12.5". |
prepare-approve
Prepare an approval letting a spender move your tokens. Finish with send-transaction.
| Parameter | Type | Description |
|---|---|---|
| tokenAddress | string (0x…) | The token contract address. |
| tokenDecimal | number | The token's decimals, for example 6 for USDC. |
| spender | string (0x…) | Address allowed to spend. |
| amount | string | Amount in normal units, such as "12.5". |
prepare-mint
Prepare a mint on a token with a public mint function. Finish with send-transaction.
| Parameter | Type | Description |
|---|---|---|
| tokenAddress | string (0x…) | The token contract address. |
| tokenDecimal | number | The token's decimals, for example 6 for USDC. |
| to | string (0x…) | Address receiving the new tokens. |
| amount | string | Amount in normal units, such as "12.5". |
prepare-deploy-erc20-contract
Prepare a new token deployment from compiled bytecode. Finish with deploy-contract.
| Parameter | Type | Description |
|---|---|---|
| bytecode | string (0x…) | Compiled bytecode, for example from solc-mcp. |
| name | string | Token name. |
| symbol | string | Token symbol. |
| decimal | number | Token decimals, usually 18. |
Reads
prepare-total-supply
Prepare a read of the total supply. Finish with call, then resolve-total-supply.
| Parameter | Type | Description |
|---|---|---|
| tokenAddress | string (0x…) | The token contract address. |
resolve-total-supply
Decode the total supply into a readable amount.
| Parameter | Type | Description |
|---|---|---|
| tokenDecimal | number | The token's decimals, for example 6 for USDC. |
| data | string (0x…) | The raw result returned by metamask-mcp's call. |
prepare-allowance
Prepare a read of how much a spender may move for an owner. Finish with call, then resolve-allowance.
| Parameter | Type | Description |
|---|---|---|
| tokenAddress | string (0x…) | The token contract address. |
| owner | string (0x…) | Token owner. |
| spender | string (0x…) | Approved spender. |
resolve-allowance
Decode the allowance into a readable amount.
| Parameter | Type | Description |
|---|---|---|
| tokenDecimal | number | The token's decimals, for example 6 for USDC. |
| data | string (0x…) | The raw result returned by metamask-mcp's call. |
Prompts#
generate-erc20-contract asks the agent to write an ERC-20, with a Solmate-based contract as its example. See Compile and deploy.
mint is public with no access control. Restrict it before deploying a real token.