foundry-zksync-mcp
Integrates with Google Cloud KMS for secure transaction signing during deployments and contract interactions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@foundry-zksync-mcpcompile the contract in src/Counter.sol"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
foundry-zksync-mcp
An MCP (Model Context Protocol) server that exposes foundry-zksync CLI tools to AI assistants like Claude.
Tools
Tool | Description |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Read and inspect project configuration |
| Match errors/logs against a knowledge base of zkSync gotchas |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Look up foundry-zksync documentation by topic |
| Start or check a local anvil-zksync dev node |
Related MCP server: Prover MCP
Prerequisites
Node.js >= 18
foundry-zksync installed (
foundryup-zksync)
Quick Start (npx)
No install needed — run directly with npx:
claude mcp add foundry-zksync -- npx -y foundry-zksync-mcpOr add to claude_desktop_config.json / ~/.claude.json:
{
"mcpServers": {
"foundry-zksync": {
"command": "npx",
"args": ["-y", "foundry-zksync-mcp"]
}
}
}Install from Source
git clone https://github.com/Jrigada/foundry-zksync-mcp.git
cd foundry-zksync-mcp
npm install
npm run buildThen register with Claude Code:
claude mcp add foundry-zksync node /absolute/path/to/foundry-zksync-mcp/dist/index.jsKey Management
All signing tools (deploy, cast_send, run_script) support multiple wallet methods. Choose based on your security needs:
Local Development (anvil-zksync)
For local dev with well-known test keys, use privateKey directly:
privateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"These are the default anvil-zksync test accounts — they hold no real value.
Warning: Never use
privateKeywith keys that hold real funds. MCP tool parameters are visible to the AI assistant and may be logged.
Recommended for Production: Named Keystores
Keys are encrypted on disk — only the account name travels through MCP.
# Import a private key into a named keystore (interactive, key never shown)
cast wallet import deployer --interactive
# List your keystores
ls ~/.foundry/keystores/Then use account: "deployer" in any signing tool. Forge will prompt for the password at runtime, or you can point to a password file with passwordFile.
Keystore Files
If you have an existing encrypted keystore JSON file (e.g. from Geth, MetaMask export):
keystore: "/path/to/keystore.json"
passwordFile: "/path/to/password.txt"Hardware Wallets
ledger: true # Ledger
trezor: true # TrezorCloud KMS
aws: true # AWS KMS (set AWS_KMS_KEY_ID env var)
gcp: true # Google Cloud KMS (set GCP_PROJECT_ID, GCP_LOCATION, etc.)Signing Method Summary
Method | Key Exposure | Best For |
Hardware wallet | None (key never leaves device) | High-value production |
Cloud KMS | None (key in HSM) | Automated production |
Named keystore ( | None through MCP (encrypted on disk) | General production use |
Keystore file | None through MCP (encrypted on disk) | Existing workflows |
| Visible to AI assistant | Local dev with test keys only |
Project Structure
src/
index.ts MCP server entry point, registers all 21 tools
knowledge.ts Knowledge base (45+ entries) and system addresses
tools/
shared.ts Profile field and env builder shared across forge tools
init.ts forge init with zkSync config
compile.ts forge build --zksync
test.ts forge test --zksync
run_script.ts forge script --zksync
deploy.ts forge create --zksync (structured output)
verify.ts forge verify-contract --zksync
install.ts forge install
clean.ts forge clean
gas_report.ts forge test --gas-report
snapshot.ts forge snapshot
read_foundry_toml.ts Read project config
explain.ts Error/log explanation with knowledge base
get_zksync_docs.ts Documentation lookup with embedded content
cast_abi_encode.ts cast abi-encode
cast_abi_decode.ts cast abi-decode
cast_calldata_decode.ts cast calldata-decode
cast_call.ts cast call
cast_send.ts cast send
cast_balance.ts cast balance
cast_nonce.ts cast nonce
anvil_zksync.ts anvil-zksync node management
__tests__/ 133 tests (vitest)Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jrigada/foundry-zksync-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server