contract-scraper-mcp

kukapay/contract-scraper-mcp

3.2

If you are the rightful owner of contract-scraper-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Contract Scraper MCP is a server that scrapes verified smart-contract source code and ABIs across multiple blockchains, providing structured data for AI agents and on-chain analysis.

Contract Scraper MCP

An MCP server that scrapes verified smart-contract source code and ABIs across multiple blockchains, delivering clean, structured data for AI agents and on-chain analysis.

GitHub License Python Version Status

Features

  • Contract codes, ABIs and metadata download from any supported chain
  • Full multi-file contracts support
  • Human-readable folder layout:
    repo/
    └── USDT_0xdac17f95_chain1/
        ├── TetherToken.sol
        ├── abi.json
        └── metadata.json
    
  • Supported chains: Ethereum, BNB Smart Chain, Polygon, Base, Arbitrum One/Nova, Optimism, Avalanche, Fantom, zkSync Era, Scroll, Linea, Gnosis Chain, Moonbeam/Moonriver, Blast, Zora, Aurora, Harmony, Kaia, Mantle, Polygon zkEVM, Celo, Berachain Artio, Mode, BOB, Neon EVM, Sepolia, Holesky...

Requirements

  • Python 3.10+
  • uv for dependency management (recommended)
  • A free api key from Etherscan

Installation

  1. Clone:

    git clone https://github.com/kukapay/contract-scraper-mcp.git
    cd contract-scraper-mcp
    
  2. Install Dependencies:

    uv sync 
    
  3. Install to Claude Desktop:

    Install the server as a Claude Desktop application:

    uv run mcp install main.py --name "Contract Scraper"
    

    Configuration file as a reference:

    {
       "mcpServers": {
           "Contract Scraper": {
               "command": "uv",
               "args": [ "--directory", "/path/to/contract-scraper-mcp", "run", "main.py" ],
               "env": { "ETHERSCAN_API_KEY": "your-api-key" }
           }
       }
    }
    

    Update /path/to/contract-scraper-mcp and your-api-key with your value.

Usage

Tool Example

Prompt:

Download this contract:
Address: 0x1F98431c8aD98523631AE4a59f267346ea31F984
Chain: Ethereum

Structured Output:

{
  "success": true,
  "message": "Contract scraped successfully",
  "metadata": {
    "contract_name": "UniswapV3Factory",
    "contract_address": "0x1F98431c8aD98523631AE4a59f267346ea31F984",
    "chain_id": 1,
    "chain_name": "Ethereum Mainnet",
    "compiler_version": "v0.7.6+commit.733a56d9",
    "optimization_used": true,
    "verified_date": "2021-05-05T00:00:00.Concurrent",
    "proxy": false,
    "implementation": null,
    "source_files": 57
  },
  "saved_path": "/you/repo/UniswapV3Factory_0x1f98431c8_chain1",
  "abi_saved": true,
  "source_saved": true
}

Folder Structure After Scraping:

repo/
└── UniswapV3Factory_0x1f98431c8_chain1/
    ├── UniswapV3Factory.sol
    ├── interfaces/IUniswapV3Factory.sol
    ├── libraries/TickBitmap.sol
    ├── openzeppelin/contracts/token/ERC20/IERC20.sol
    ├── abi.json
    └── metadata.json

Prompt Example

Download & Analyze Contract
→ address: 0xdAC17F958D2ee523a2206206994597C13D831ec7
→ chainid: 1

The LLM will automatically call scrape_contract, receive full source + ABI and saved in repo.

License

This project is licensed under the MIT License - see the file for details.