Hi all,
I’ve been building on the mm plugins beta for the last couple of days and wanted to share what came out of it, plus some feedback for the team.
The problem. An agent that swaps and trades accumulates ERC-20 approvals, often unlimited ones, and nothing in the current CLI lets you see or clean them up. Humans use revoke.cash for this. Agents had nothing.
What I built. mm-plugin-allowances, two commands:
mm allowances auditscans Approval events for the active wallet, lists what’s still live, flags unlimited allowances, and labels well-known spenders (Uniswap, Aave, 1inch, Permit2…). Multi-chain.mm allowances revokesendsapprove(spender, 0)through the wallet’s normal pipeline, so Guard Mode policy, simulation, Blockaid and 2FA all apply. Explicit gas flags for chains where the estimator runs low.
Everything uses named flags and structured JSON output so an agent can drive it safely. MIT, verified end to end on Sepolia.
Try it. It’s not on npm yet, so for now it installs from the GitHub checkout. That needs the unverified-installs opt-in the docs describe for development:
git clone https://github.com/akugone/mm-plugin-allowances && cd mm-plugin-allowances
npm install && npm run build
mm config set experimentalAllowUnverifiedInstalls true
mm plugins install "file:$PWD" --accept-permissions
mm allowances audit
Requires mm ≥ 6.2.0. npm publish will follow once I’ve had some feedback.
What worked well on the plugin API. The oclif-based structure made it quick to get going, the consent screen that lists commands and requested capabilities is exactly what you want for agent-facing tooling, and routing writes through the wallet’s own pipeline meant I didn’t have to reinvent any safety.
Two things I hit along the way.
- With the “Build a plugin” flow,
mm plugins install file:$PWDsymlinks the folder, so Node loads the plugin’s own devDependency copy of@metamask/agent-walletinstead of the host’s, and the consent hook rejects the command with a confusingwindow.addEventListener is not a function. Symlinking the host install into the plugin’snode_modulesfixes it. Happy to file an issue with a repro if useful. - On Sepolia the server wallet’s fee estimate sometimes lands under what the RPC accepts and the revoke fails with
rpc_fee_too_low. I added--max-fee-gwei/--priority-fee-gweiflags as a workaround, but a--gas-speedstyle option onsend-transactionitself would save every plugin author from doing the same.
Happy to answer questions, and very open to feedback from the team on whether this is the right shape for a plugin.
Martin