- Home
- MCP servers
- Foundry
Foundry
- python
2
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"lhemerly-foundry-mcp": {
"command": "python",
"args": [
"src/eth_wh_mcp/main.py"
]
}
}
}You can run a dedicated MCP server to manage Foundry-based projects, compile contracts, run tests, inspect contract data, and launch local Ethereum tooling. This server exposes practical tools you can call from an MCP client to streamline Foundry workflows without leaving your development environment.
How to use
Start the MCP server from your environment and connect an MCP client to access a suite of tools tailored for Foundry workflows. You can create new Foundry projects, build contracts, run tests, clone contracts from Etherscan, execute Solidity scripts, and interact with local Ethereum nodes such as Anvil or Chisel. Use the available tool names to invoke specific actions, and consult the results returned by the server to guide your next steps.
How to install
Prerequisites you need before starting: Python is required to run the MCP server. You should also have Foundry tools installed (forge, cast, anvil, etc.) and available in your system PATH.
Step 1: Install the MCP server locally using a package manager or by cloning the project. The basic development flow relies on Python to start the server and Foundry tools to perform contract work.
Step 2: Start the MCP server with the runtime command below.
python src/eth_wh_mcp/main.py
Notes on running locally
- Ensure Python is installed and accessible from your command line. - Ensure Foundry tools are installed and available in your PATH. - If you plan to run Anvil or Chisel locally, install and configure them as part of your workflow.
Available tools
create_project
Initialize a new Foundry project in the current workspace, setting up the initial Foundry project structure and configuration.
build_project
Compile Solidity contracts within the current Foundry project, with configurable build options.
test_project
Run the Foundry test suite for the current project and report test results, including failures and gas metrics where applicable.
clone_contract
Clone a contract from Etherscan or another source to inspect ABI, bytecode, and metadata within the MCP context.
run_script
Execute Solidity scripts against your local or configured network, returning results and any emitted events.
run_cast_command
Run a cast command to perform on-chain queries or transactions directly from the MCP environment.
start_anvil_with_options
Launch a local Anvil node with user-specified options for development and testing.
start_chisel_with_options
Start the Chisel Solidity REPL to interact with contracts and test scripts in real time.
inspect_contract
Retrieve contract metadata such as ABI, bytecode, and deployed addresses from your project.
snapshot_project
Create a gas usage snapshot for your project to analyze gas costs across tests and operations.
coverage_project
Display test coverage information for your Foundry project, highlighting covered and missing paths.