get_contract_source

Pack: etherscan · Endpoint: https://gateway.pipeworx.io/etherscan/mcp

Verified contract source code, compiler version, optimization settings, and license.

Parameters

NameTypeRequiredDescription
addressstringyesContract address
chainstringnoChain slug or chain ID (default ethereum)

Example call

curl -X POST https://gateway.pipeworx.io/etherscan/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_contract_source","arguments":{}}}'

Response shape

Always returns: chain_id, chain_name, address, verified

FieldTypeDescription
chain_idnumberNumeric chain ID
chain_namestring | nullHuman-readable chain name or null if unknown
addressstringContract address
verifiedbooleanWhether contract is verified on Etherscan
contract_namestringContract name from source
compiler_versionstringSolidity compiler version used
optimization_usedbooleanWhether optimization was enabled
runsnumber | nullOptimizer run count or null if not set
license_typestring | nullSPDX license identifier or null
constructor_argumentsstring | nullConstructor arguments in hex or null
proxybooleanWhether contract is a proxy
implementationstring | nullImplementation contract address if proxy, null otherwise
source_codestring | nullFull source code or null
abistring | nullABI as JSON string or null
Full JSON Schema
{
  "type": "object",
  "properties": {
    "chain_id": {
      "type": "number",
      "description": "Numeric chain ID"
    },
    "chain_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable chain name or null if unknown"
    },
    "address": {
      "type": "string",
      "description": "Contract address"
    },
    "verified": {
      "type": "boolean",
      "description": "Whether contract is verified on Etherscan"
    },
    "contract_name": {
      "type": "string",
      "description": "Contract name from source"
    },
    "compiler_version": {
      "type": "string",
      "description": "Solidity compiler version used"
    },
    "optimization_used": {
      "type": "boolean",
      "description": "Whether optimization was enabled"
    },
    "runs": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optimizer run count or null if not set"
    },
    "license_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "SPDX license identifier or null"
    },
    "constructor_arguments": {
      "type": [
        "string",
        "null"
      ],
      "description": "Constructor arguments in hex or null"
    },
    "proxy": {
      "type": "boolean",
      "description": "Whether contract is a proxy"
    },
    "implementation": {
      "type": [
        "string",
        "null"
      ],
      "description": "Implementation contract address if proxy, null otherwise"
    },
    "source_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Full source code or null"
    },
    "abi": {
      "type": [
        "string",
        "null"
      ],
      "description": "ABI as JSON string or null"
    }
  },
  "required": [
    "chain_id",
    "chain_name",
    "address",
    "verified"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "etherscan": {
      "url": "https://gateway.pipeworx.io/etherscan/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 21, 2026