anvil
Start or check a local Ethereum development node, optionally forking a live network, to test contracts with funded accounts.
Instructions
Start or check a local Anvil development node. Supports forking from a live network. Default port: 8545.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "anvil"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Port to listen on (default: 8545) | |
| action | Yes | 'start' launches anvil in the background and returns when ready. 'check' tests if anvil is reachable at the given port. | |
| balance | No | ETH balance for each generated account in ether (default: 10000) | |
| chainId | No | Chain ID to use | |
| forkUrl | No | RPC URL to fork from | |
| accounts | No | Number of funded accounts to generate (default: 10) | |
| blockTime | No | Block time in seconds for auto-mining | |
| autoImpersonate | No | Enable auto-impersonation of all accounts | |
| forkBlockNumber | No | Block number to fork from (requires forkUrl) |