Foundry MCP Server

Expose foundry-zksync (forge, cast, anvil-zksync) tools for zkSync Era development

Local serverstdio

What is the Foundry MCP Server?

Expose foundry-zksync (forge, cast, anvil-zksync) tools for zkSync Era development

The short version

An MCP (Model Context Protocol) server that exposes foundry-zksync CLI tools to AI assistants like Claude.

What it needs from you

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
initforge init with automatic zkSync config
compileforge build --zksync
testforge test --zksync with filter/verbosity options
run_scriptforge script --zksync with broadcast, sender, slow mode
deployforge create --zksync with structured output parsing
verifyforge verify-contract --zksync (Etherscan & zkSync Explorer)
cleanforge clean to remove build artifacts
gas_reportforge test --gas-report for gas usage analysis
snapshotforge snapshot for gas benchmarking
read_foundry_tomlRead and inspect project configuration
explainMatch errors/logs against a knowledge base of zkSync gotchas
cast_abi_encodecast abi-encode
cast_abi_decodecast abi-decode
cast_calldata_decodecast calldata-decode

How to install the Foundry MCP Server

{
  "mcpServers": {
    "foundry-zksync": {
      "command": "npx",
      "args": ["-y", "foundry-zksync-mcp"],
      "env": {
        "AWS_KMS_KEY_ID": "your-value",
        "GCP_PROJECT_ID": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
AWS_KMS_KEY_IDCredential the server authenticates with.Yes
GCP_PROJECT_IDConfiguration value read at startup.Optional

Example prompts to try

  • “Use Foundry to init.”
  • “Use Foundry to compile.”
  • “Use Foundry to test.”

Frequently asked questions

Expose foundry-zksync (forge, cast, anvil-zksync) tools for zkSync Era development Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.