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

Arguments

{
  "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}

curl

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":{"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_contract_source', {
  "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
});

More examples

{
  "address": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
  "chain": "optimism"
}

Response shape

Always returns: chain_id, chain_name, address, verified

FieldTypeDescription
chain_idnumberNumeric chain ID
chain_namestring | nullHuman-readable chain name or null
addressstringThe queried contract address
verifiedbooleanWhether contract is verified on Etherscan
contract_namestringName of the contract
compiler_versionstringSolidity compiler version used
optimization_usedbooleanWhether compiler optimization was enabled
runsnumber | nullNumber of optimization runs or null
license_typestring | nullSPDX license type or null
constructor_argumentsstring | nullConstructor arguments or null
proxybooleanWhether contract is a proxy
implementationstring | nullImplementation address if proxy, else null
source_codestring | nullSource code or null
abistring | nullABI 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"
    },
    "address": {
      "type": "string",
      "description": "The queried contract address"
    },
    "verified": {
      "type": "boolean",
      "description": "Whether contract is verified on Etherscan"
    },
    "contract_name": {
      "type": "string",
      "description": "Name of the contract"
    },
    "compiler_version": {
      "type": "string",
      "description": "Solidity compiler version used"
    },
    "optimization_used": {
      "type": "boolean",
      "description": "Whether compiler optimization was enabled"
    },
    "runs": {
      "type": [
        "number",
        "null"
      ],
      "description": "Number of optimization runs or null"
    },
    "license_type": {
      "type": [
        "string",
        "null"
      ],
      "description": "SPDX license type or null"
    },
    "constructor_arguments": {
      "type": [
        "string",
        "null"
      ],
      "description": "Constructor arguments or null"
    },
    "proxy": {
      "type": "boolean",
      "description": "Whether contract is a proxy"
    },
    "implementation": {
      "type": [
        "string",
        "null"
      ],
      "description": "Implementation address if proxy, else null"
    },
    "source_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Source code or null"
    },
    "abi": {
      "type": [
        "string",
        "null"
      ],
      "description": "ABI 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 June 27, 2026