{
  "markdown": "# foundry-zksync-mcp\n\nAn MCP (Model Context Protocol) server that exposes [foundry-zksync](https://github.com/matter-labs/foundry-zksync) CLI tools to AI assistants like Claude.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `init` | `forge init` with automatic zkSync config |\n| `compile` | `forge build --zksync` |\n| `test` | `forge test --zksync` with filter/verbosity options |\n| `run_script` | `forge script --zksync` with broadcast, sender, slow mode |\n| `deploy` | `forge create --zksync` with structured output parsing |\n| `verify` | `forge verify-contract --zksync` (Etherscan & zkSync Explorer) |\n| `install` | `forge install` for dependency management |\n| `clean` | `forge clean` to remove build artifacts |\n| `gas_report` | `forge test --gas-report` for gas usage analysis |\n| `snapshot` | `forge snapshot` for gas benchmarking |\n| `read_foundry_toml` | Read and inspect project configuration |\n| `explain` | Match errors/logs against a knowledge base of zkSync gotchas |\n| `cast_abi_encode` | `cast abi-encode` |\n| `cast_abi_decode` | `cast abi-decode` |\n| `cast_calldata_decode` | `cast calldata-decode` |\n| `cast_call` | `cast call` for read-only contract interaction |\n| `cast_send` | `cast send` for state-changing transactions |\n| `cast_balance` | `cast balance` for ETH balance queries |\n| `cast_nonce` | `cast nonce` for transaction nonce queries |\n| `get_zksync_docs` | Look up foundry-zksync documentation by topic |\n| `anvil_zksync` | Start or check a local anvil-zksync dev node |\n\n## Prerequisites\n\n- Node.js >= 18\n- [foundry-zksync](https://github.com/matter-labs/foundry-zksync) installed (`foundryup-zksync`)\n\n## Quick Start (npx)\n\nNo install needed — run directly with npx:\n\n```bash\nclaude mcp add foundry-zksync -- npx -y foundry-zksync-mcp\n```\n\nOr add to `claude_desktop_config.json` / `~/.claude.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"foundry-zksync\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"foundry-zksync-mcp\"]\n    }\n  }\n}\n```\n\n## Install from Source\n\n```bash\ngit clone https://github.com/Jrigada/foundry-zksync-mcp.git\ncd foundry-zksync-mcp\nnpm install\nnpm run build\n```\n\nThen register with Claude Code:\n\n```bash\nclaude mcp add foundry-zksync node /absolute/path/to/foundry-zksync-mcp/dist/index.js\n```\n\n## Key Management\n\nAll signing tools (`deploy`, `cast_send`, `run_script`) support multiple wallet methods. Choose based on your security needs:\n\n### Local Development (anvil-zksync)\n\nFor local dev with well-known test keys, use `privateKey` directly:\n\n```\nprivateKey: \"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\"\n```\n\nThese are the default anvil-zksync test accounts — they hold no real value.\n\n> **Warning:** Never use `privateKey` with keys that hold real funds. MCP tool parameters are visible to the AI assistant and may be logged.\n\n### Recommended for Production: Named Keystores\n\nKeys are encrypted on disk — only the account name travels through MCP.\n\n```bash\n# Import a private key into a named keystore (interactive, key never shown)\ncast wallet import deployer --interactive\n\n# List your keystores\nls ~/.foundry/keystores/\n```\n\nThen 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`.\n\n### Keystore Files\n\nIf you have an existing encrypted keystore JSON file (e.g. from Geth, MetaMask export):\n\n```\nkeystore: \"/path/to/keystore.json\"\npasswordFile: \"/path/to/password.txt\"\n```\n\n### Hardware Wallets\n\n```\nledger: true    # Ledger\ntrezor: true    # Trezor\n```\n\n### Cloud KMS\n\n```\naws: true       # AWS KMS (set AWS_KMS_KEY_ID env var)\ngcp: true       # Google Cloud KMS (set GCP_PROJECT_ID, GCP_LOCATION, etc.)\n```\n\n### Signing Method Summary\n\n| Method | Key Exposure | Best For |\n|--------|-------------|----------|\n| Hardware wallet | None (key never leaves device) | High-value production |\n| Cloud KMS | None (key in HSM) | Automated production |\n| Named keystore (`account`) | None through MCP (encrypted on disk) | General production use |\n| Keystore file | None through MCP (encrypted on disk) | Existing workflows |\n| `privateKey` | Visible to AI assistant | Local dev with test keys only |\n\n## Project Structure\n\n```\nsrc/\n  index.ts              MCP server entry point, registers all 21 tools\n  knowledge.ts          Knowledge base (45+ entries) and system addresses\n  tools/\n    shared.ts           Profile field and env builder shared across forge tools\n    init.ts             forge init with zkSync config\n    compile.ts          forge build --zksync\n    test.ts             forge test --zksync\n    run_script.ts       forge script --zksync\n    deploy.ts           forge create --zksync (structured output)\n    verify.ts           forge verify-contract --zksync\n    install.ts          forge install\n    clean.ts            forge clean\n    gas_report.ts       forge test --gas-report\n    snapshot.ts         forge snapshot\n    read_foundry_toml.ts  Read project config\n    explain.ts          Error/log explanation with knowledge base\n    get_zksync_docs.ts  Documentation lookup with embedded content\n    cast_abi_encode.ts  cast abi-encode\n    cast_abi_decode.ts  cast abi-decode\n    cast_calldata_decode.ts  cast calldata-decode\n    cast_call.ts        cast call\n    cast_send.ts        cast send\n    cast_balance.ts     cast balance\n    cast_nonce.ts       cast nonce\n    anvil_zksync.ts     anvil-zksync node management\n  __tests__/            133 tests (vitest)\n```\n",
  "bytes": 5477,
  "sha": "199c04ef53be83b7255aaea6dbba2544ae7423f159004689c3a34e62a6820993",
  "repo_slug": "jrigada/foundry-zksync-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_jrigada_foundry_zksync_f851acbf/readme"
}