# andresdefi/zerodust [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/andresdefi/zerodust  
**GitHub Stars:** 2  
**npm Downloads (last month):** 496  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/andresdefi-zerodust

## Description
Sweep an agent's native gas balance to exactly zero on 25+ EVM chains via EIP-7702 sponsored execution — a relayer pays the gas and is reimbursed from the sweep, so nothing is left stranded. Same-chain or cross-chain. Read-only by default; sweeping is opt-in and destination-allowlisted, so a prompt-injected agent still cannot redirect funds. npx @zerodust/mcp-server

## Tools
Capabilities this server exposes over MCP:

- **zerodust_get_chains** — List the EVM chains a native gas balance can be emptied to exactly zero on. Returns chain IDs, names, and native tokens. Call this to check whether a specific chain is supported before quoting or sweeping.
- **zerodust_get_balances** — Find leftover native gas token (ETH, BNB, POL, ...) stranded across every supported EVM chain for one address, and report which of it can be recovered. Normally these balances are unrecoverable: you cannot transfer 100% of a gas token, because paying for the transfer consumes the thing you are transferring, so a remainder is always left behind. This reports what is stuck and what could be moved out. Useful when a wallet has small amounts scattered over many chains, when someone cannot send their full balance, or before closing out, winding down or decommissioning a wallet.
- **zerodust_get_quote** — Price out emptying a chain's native gas balance to exactly zero: how much actually arrives, the full fee breakdown, and whether the balance is even large enough to be worth recovering. Call this before sweeping so the user sees the numbers first. Returns a quote ID; quotes expire after about 60 seconds.
- **zerodust_get_sweep_status** — Check how a previously submitted sweep is progressing. Returns the current status (pending, simulating, executing, bridging, completed, failed), the transaction hash once there is one, and the error message if it failed.
- **zerodust_list_sweeps** — List past sweeps for a wallet address, with status and amounts. Useful for confirming a chain was already emptied before trying again.
- **zerodust_register_api_key** — Issue this agent its own ZeroDust API key for higher rate limits, with no human signup step. The read-only tools work without a key, so only call this when rate limits are actually being hit, or when setting up an unattended agent that will run repeatedly. The key is returned once and is not stored by this server - report it to the operator so they can set ZERODUST_API_KEY.
- **zerodust_info** — Explain how a native gas balance can be emptied to exactly zero, what it costs, and how to set this server up to do it. Call this when asked how ZeroDust works, why a full balance normally cannot be sent, or what sweeping will cost.
- **zerodust_get_agent_address** — Show which wallet this ZeroDust server signs with, where its key comes from, and which destinations it is allowed to sweep to. Call this before any sweep to confirm the right wallet is about to be emptied. Requires ZERODUST_ALLOW_EXECUTE=true plus a signing key; without them this tool returns an error and moves no funds. Pass dryRun=true to rehearse the whole flow without moving anything.
- **zerodust_sweep** — Empty one chain completely: move 100% of the native gas token off it and leave the balance at exactly zero. This is the operation an ordinary transfer cannot do, because sending the gas token requires keeping some gas token back to pay for the send. Use when the goal is to close out, wind down, decommission or fully exit a chain, or to recover a leftover or stranded balance that is too small to move normally. Moves real funds. Call zerodust_get_quote first to show the user what they will receive. Requires ZERODUST_ALLOW_EXECUTE=true plus a signing key; without them this tool returns an error and moves no funds. Pass dryRun=true to rehearse the whole flow without moving anything.
- **zerodust_sweep_all** — Empty every chain that still holds a native gas balance, consolidating all of it onto one destination chain and leaving each source at exactly zero. Use when the goal is to clean up a wallet across chains, collect scattered leftover gas, or retire a wallet entirely. Moves real funds across multiple chains. Call zerodust_get_balances first to show the user what will be swept. Requires ZERODUST_ALLOW_EXECUTE=true plus a signing key; without them this tool returns an error and moves no funds. Pass dryRun=true to rehearse the whole flow without moving anything.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "zerodust": {
    "command": "npx",
    "args": ["@zerodust/mcp-server"],
    "env": {
      "ZERODUST_API_KEY": "",
      "ZERODUST_ALLOW_EXECUTE": "",
      "ZERODUST_SIGNER_MODULE": "",
      "ZERODUST_KEYSTORE_FILE": "",
      "ZERODUST_PRIVATE_KEY_FILE": "",
      "ZERODUST_PRIVATE_KEY": "",
      "ZERODUST_ALLOWED_DESTINATIONS": ""
    }
  }
}
```

**Requires environment variables:** `ZERODUST_API_KEY`, `ZERODUST_ALLOW_EXECUTE`, `ZERODUST_SIGNER_MODULE`, `ZERODUST_KEYSTORE_FILE`, `ZERODUST_PRIVATE_KEY_FILE`, `ZERODUST_PRIVATE_KEY`, `ZERODUST_ALLOWED_DESTINATIONS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What andresdefi/zerodust MCP server does

The andresdefi/zerodust MCP server helps an agent identify and recover native gas token balances that are normally too small to transfer completely. It supports 25 live EVM mainnets through the API, including Ethereum, Base, Arbitrum, Optimism, BNB Chain, Polygon, and others. The authoritative supported-chain list comes from the service API, so agents should query it before presenting a quote or attempting a sweep.

A sweep can empty one source chain or consolidate balances from multiple chains onto one destination. Supported flows include same-chain transfers to another address, cross-chain transfers to the same address, and cross-chain transfers to a different address. The source balance is intended to end at exactly zero wei.

## How it works

Ordinary native-token transfers cannot send the entire balance because the transaction itself requires native gas. ZeroDust uses EIP-7702 sponsored execution: the wallet authorizes the operation, a relayer submits and pays for execution, and the cost is accounted for in the amount delivered. Cross-chain operations can also invoke a bridge target as part of the execution.

The normal agent flow is to inspect balances, request a quote, confirm the signing address and permitted destinations, and then submit a sweep. Quotes include the expected received amount and fee breakdown, and expire after about 60 seconds. Status can be checked later using the returned sweep information.

## Setup and configuration

The hosted MCP endpoint is available at `https://api.zerodust.xyz/mcp`. It provides read-only discovery and quoting without installing the package or supplying a key. For local execution, configure the `@zerodust/mcp-server` package through an MCP client and set `ZERODUST_ALLOW_EXECUTE=true` together with one signing-key source.

Supported key sources include a signer module, an encrypted V3 keystore plus a separate password file, a private-key file, or a directly configured private key. A signer module can return a viem `LocalAccount`, which allows custody-provider adapters to supply the account. `ZERODUST_ALLOWED_DESTINATIONS` can further restrict where funds may be sent; otherwise funds can go only to the agent's own address.

The server can issue an API key for higher rate limits through `zerodust_register_api_key`. The key is returned once and must be reported to the operator for configuration as `ZERODUST_API_KEY`.

## Tools and capabilities

The andresdefi/zerodust MCP server exposes tools for:

- Listing supported chains and their native tokens.
- Finding recoverable native balances across chains for an address.
- Producing short-lived quotes with delivery and fee details.
- Checking sweep status and listing previous sweeps.
- Showing the configured signing address and allowed destinations.
- Sweeping one chain or all funded chains.
- Explaining the execution model and setup requirements.
- Registering an API key when rate limits require one.

Execution tools support `dryRun`. A dry run obtains a real quote and creates the signatures needed for the flow but stops before broadcasting, so funds are not moved.

## Limitations and notes

The andresdefi/zerodust MCP server serves mainnet chains only; there is no testnet API environment. Use `dryRun` instead of a testnet flag for rehearsal. Actual sweeps require both the explicit execution opt-in and a signing key; without them, the execution tools return an error and move no funds.

The browser interface depends on a non-standard `wallet_signAuthorization` RPC that shipping wallets do not yet expose, but agents signing locally are described as unaffected. Destination restrictions should be reviewed before enabling unattended execution, and agents should call the address and balance inspection tools before moving funds.

_Full upstream README: https://allmcps.com/mcp/andresdefi-zerodust/readme_

