EVM MCP Server

by mcpdotdirect
Verified

write_contract

Write data to a smart contract by calling a state-changing function. This modifies blockchain state and requires gas payment and transaction signing.

Input Schema

NameRequiredDescriptionDefault
abiYesThe ABI (Application Binary Interface) of the smart contract function, as a JSON array
argsYesThe arguments to pass to the function, as an array (e.g., ['0x1234...', '1000000000000000000'])
contractAddressYesThe address of the smart contract to interact with
functionNameYesThe name of the function to call on the contract (e.g., 'transfer')
networkNoNetwork name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Defaults to Ethereum mainnet.
privateKeyYesPrivate key of the sending account in hex format (with or without 0x prefix). SECURITY: This is used only for transaction signing and is not stored.

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "abi": { "description": "The ABI (Application Binary Interface) of the smart contract function, as a JSON array", "type": "array" }, "args": { "description": "The arguments to pass to the function, as an array (e.g., ['0x1234...', '1000000000000000000'])", "type": "array" }, "contractAddress": { "description": "The address of the smart contract to interact with", "type": "string" }, "functionName": { "description": "The name of the function to call on the contract (e.g., 'transfer')", "type": "string" }, "network": { "description": "Network name (e.g., 'ethereum', 'optimism', 'arbitrum', 'base', 'polygon') or chain ID. Defaults to Ethereum mainnet.", "type": "string" }, "privateKey": { "description": "Private key of the sending account in hex format (with or without 0x prefix). SECURITY: This is used only for transaction signing and is not stored.", "type": "string" } }, "required": [ "contractAddress", "abi", "functionName", "args", "privateKey" ], "type": "object" }