Practical overview
When it fits
Use it when an Ape project needs to work with Foundry’s local Anvil network, a remote Anvil node, or an Ethereum mainnet fork through an upstream Ape provider.
Who it is for
- Developers using Ape Framework projects who want Foundry’s Anvil network as their development provider.
- Teams configuring Ape to connect to a remote Anvil node.
- Developers using a mainnet fork for development or transaction testing.
Documented uses
- Select Foundry’s local network for Ape commands.
- Connect an Ape project to a remote Anvil node by configuring its host.
- Run Ape commands against a mainnet fork through an upstream provider with mainnet access.
- Configure node behavior such as EVM version, block timing, fees and auto-mining.
- Impersonate accounts for fork-based transaction work, subject to the account having a balance.
Requirements & limits
The repository is public and lists an Apache-2.0 license. The README documents installation with pip or setuptools.
- Foundry and Python 3.9–3.12 are listed dependencies.
- A mainnet fork requires a separate installed Ape provider that can access mainnet archive data.
- Remote Anvil use is configured by setting the Foundry host in
ape-config.yamlor withAPE_FOUNDRY_HOST. - Impersonated accounts need a balance to transact; the README describes using a funded account on a fork or setting node fees to zero.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Connect an Ape project to a local Foundry network
Install the provider and select Foundry as the network for Ape commands.
Before you start
- Python 3.9–3.12
- Foundry installed
- An Ape project
Steps
Install the plugin with the command below.
pip install ape-foundryIn the Ape project, use the
--network ethereum:local:foundrycommand-line flag when running an Ape command if Foundry is not already the default network.If needed, set the Foundry host under
foundryinape-config.yaml.
Expected outcome
Ape commands can use the Foundry local network provider, with the host configurable in the project.
Guide limitations
- The README lists Python 3.9–3.12 and Foundry as dependencies.
- This guidance covers provider setup and network selection, not a particular contract deployment or test procedure.
Select a mainnet fork for an Ape command
Configure the upstream mainnet provider and select the Ape Foundry fork network.
Before you start
- Python 3.9–3.12
- Foundry installed
- Ape Foundry installed
- An installed Ape provider with access to mainnet archive data
Steps
Configure
foundry.fork.ethereum.mainnet.upstream_providerinape-config.yaml, using the name of an installed provider; the README illustratesalchemy.If using Alchemy, install its Ape plugin with
ape plugins install alchemy.Select the fork provider in an Ape command, for example
ape console --network :mainnet-fork:foundry.Optionally set
block_numberorevm_versionin the fork configuration.
Expected outcome
The Ape command selects the Foundry mainnet-fork provider using the configured upstream provider.
Guide limitations
- The fork requires another provider with mainnet access.
- The README notes that when a block number is supplied without an EVM version, the version is set automatically based on block height for known networks.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- ApeWorX/ape-foundry · Official homepage title · retained in its source language

