erc20-mcp: Token Operations

The erc20-mcp server allows agents to interact with ERC-20 tokens across supported chains in a safe, modular, and non-custodial way.

This module enables LLM agents to:

  • Check balances

  • Transfer tokens

  • Approve spending

  • Prepare ERC-20 payloads for wallet signing

It operates as a read/write utility layer for token interactions, without ever signing or broadcasting on its own.


What It Does

  • Fetches token metadata and balances

  • Prepares unsigned transfer, approve, or permit transactions

  • Returns payloads ready for tools like metamask-mcp to sign

  • Works across chains, using resolved RPCs via chainlist-mcp


Tool 1: erc20.balanceOf

Request

Response

  • token: Ticker or address (resolved internally)

  • wallet: Wallet address to check

  • chain: Optional — defaults to mainnet


Tool 2: erc20.transfer

Request

Response

This unsigned transaction can now be passed to metamask-mcp for signing.


Tool 3: erc20.approve

Request

Response


Server Setup

To run erc20-mcp locally:

Default endpoint: http://localhost:3040

Update pilso.config.json:


Token Resolution Logic

erc20-mcp supports both:

  • Common token names (e.g. USDC, WETH)

  • Full contract addresses

If you provide a symbol, it auto-resolves via:

  • Chain-specific token maps

  • Internal token registry

  • Chain ID via chainlist-mcp

To override or customize token maps, you can extend the internal JSONs in /tokens/.


Test Call Locally


Security Best Practices

  • Do not expose erc20.transfer to general-purpose roles

  • Use role-level guardrails like "Never transfer without confirmation"

  • Always preview the unsignedTx in the logs before signing

  • Only allow trusted tokens or whitelisted contracts in production agents


Future Additions

  • Support for EIP-2612 permit() meta-transactions

  • Multi-transfer batch support

  • AI-assisted gas estimation per chain/token


✅ Summary

Property
Value

Tool names

erc20.balanceOf, erc20.transfer, erc20.approve

Port

3040 (default)

Signature

Only prepares payloads — does not sign or broadcast

Chain support

EVM-based chains only

Integrates with

chainlist-mcp, metamask-mcp

erc20-mcp is the token layer of PILSO OS — enabling any role-scoped agent to interact with ERC-20 contracts in a safe, modular way.

Last updated