get_contract_source
Pack: etherscan · Endpoint: https://gateway.pipeworx.io/etherscan/mcp
Verified contract source code, compiler version, optimization settings, and license.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
address | string | yes | Contract address |
chain | string | no | Chain 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
| Field | Type | Description |
|---|---|---|
chain_id | number | Numeric chain ID |
chain_name | string | null | Human-readable chain name or null if unknown |
address | string | Contract address |
verified | boolean | Whether contract is verified on Etherscan |
contract_name | string | Contract name from source |
compiler_version | string | Solidity compiler version used |
optimization_used | boolean | Whether optimization was enabled |
runs | number | null | Optimizer run count or null if not set |
license_type | string | null | SPDX license identifier or null |
constructor_arguments | string | null | Constructor arguments in hex or null |
proxy | boolean | Whether contract is a proxy |
implementation | string | null | Implementation contract address if proxy, null otherwise |
source_code | string | null | Full source code or null |
abi | string | null | ABI 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.