forge_create
Deploys a smart contract with Foundry, returning the contract address, transaction hash, and deployer; supports private key, keystore, hardware wallet, or cloud KMS signing.
Instructions
Deploy a contract (forge create). Returns the deployed contract address, transaction hash, and deployer. Requires a signing method (private key, keystore, hardware wallet, etc.).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectPath": "<projectPath>",
"contractPath": "<contractPath>",
"rpcUrl": "<rpcUrl>"
},
"name": "forge_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| aws | No | Sign with AWS KMS (requires AWS_KMS_KEY_ID env var) | |
| gcp | No | Sign with Google Cloud KMS (requires GCP_PROJECT_ID, GCP_LOCATION, GCP_KEY_RING, GCP_KEY_NAME, GCP_KEY_VERSION env vars) | |
| from | No | Sender address, used with --unlocked or hardware wallets. Maps to --from for cast/deploy, --sender for forge script. | |
| ledger | No | Sign with a Ledger hardware wallet | |
| rpcUrl | Yes | RPC URL of the target network | |
| trezor | No | Sign with a Trezor hardware wallet | |
| verify | No | Verify the contract after deployment | |
| account | No | Named keystore account from ~/.foundry/keystores (recommended for production). Create one with: cast wallet import <name> --interactive | |
| profile | No | Foundry profile to use (maps to FOUNDRY_PROFILE env var) | |
| keystore | No | Path to an encrypted keystore JSON file | |
| unlocked | No | Use eth_sendTransaction with --from address (no local signing). For nodes that manage keys natively. | |
| extraArgs | No | Additional CLI flags | |
| privateKey | No | Raw private key for signing. Only use for local development with well-known test keys (e.g. anvil accounts). For production, use 'account' (named keystore) or hardware wallets instead. | |
| projectPath | Yes | Absolute path to the foundry project directory | |
| verifierUrl | No | Block explorer verification API URL | |
| contractPath | Yes | Contract identifier, e.g. src/MyContract.sol:MyContract | |
| passwordFile | No | Path to a file containing the keystore password | |
| constructorArgs | No | Constructor arguments as strings | |
| etherscanApiKey | No | Etherscan API key for verification | |
| keystorePassword | No | Keystore password (prefer passwordFile to keep it out of process args) |