npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

web3-tools-mcp

v1.3.4

Published

Model Context Protocol server for blockchain interactions using viem, Etherscan, and Hypersync

Downloads

127

Readme

Web3 Tools MCP Server

A Model Context Protocol (MCP) server for blockchain interactions using viem, Etherscan, and Hypersync.

Features

  • Multi-chain support (Ethereum, Arbitrum, Avalanche, Base, BNB Chain, Gnosis, Sonic, Optimism, Polygon, zkSync Era, Linea, Unichain)
  • 🔐 Transaction Signing via Browser Wallet (MetaMask, Rabby, Coinbase Wallet)
  • Smart contract interactions (read & write functions, ABI retrieval, source code)
  • Contract simulation & gas estimation (simulate transactions, estimate costs)
  • Real-time gas price tracking (legacy & EIP-1559)
  • ENS resolution (names ↔ addresses, text records, avatars)
  • Token balances & transfers (native & ERC20, batch queries)
  • Event log queries with Hypersync acceleration
  • Transaction tracing and analysis
  • Storage slot reading with type decoding

Quick Start

Claude Code

claude mcp add --scope user --transport stdio web3-tools -- npx -y web3-tools-mcp

Claude Desktop

Add to config.json:

{
  "mcpServers": {
    "web3-tools": {
      "command": "npx",
      "args": ["-y", "web3-tools-mcp"]
    }
  }
}

API Keys (Optional)

All API keys are optional. The server uses public RPCs by default. Add keys to unlock additional features:

Configuration options:

  • --etherscan-api-key or ETHERSCAN_API_KEY - Enables contract ABI/source retrieval
  • --hypersync-api-key or HYPERSYNC_API_KEY - Fast event queries (10-100x faster)
  • --alchemy-api-key or ALCHEMY_API_KEY - Enhanced RPC reliability
  • --infura-api-key or INFURA_API_KEY - Additional RPC provider
  • --custom-rpc - Custom RPC URLs as JSON

Get free API keys:

Example with API keys:

# Claude Code
claude mcp add --scope user --transport stdio web3-tools -- npx -y web3-tools-mcp --etherscan-api-key YOUR_KEY --hypersync-api-key YOUR_KEY

# Environment variables
export ETHERSCAN_API_KEY=your_key
export HYPERSYNC_API_KEY=your_key
npx web3-tools-mcp

Supported Networks

| Network | Chain ID | Hypersync | |---------|----------|-----------| | Ethereum Mainnet | 1 | ✅ | | Arbitrum | 42161 | ✅ | | Avalanche | 43114 | ✅ | | Base | 8453 | ✅ | | BNB Chain | 56 | ✅ | | Gnosis | 100 | ✅ | | Sonic | 146 | ✅ | | Optimism | 10 | ✅ | | Polygon | 137 | ✅ | | zkSync Era | 324 | ✅ | | Linea | 59144 | ✅ | | Unichain | 130 | ✅ | | Localhost | 31337 | ❌ |

🔐 Browser Wallet Integration

The server includes a built-in wallet interface for secure transaction signing without exposing private keys.

How It Works

  1. When you use a transaction tool (e.g., send_native_token), the server automatically:
    • Starts a local web server on http://localhost:3456
    • Opens your browser to connect your wallet (MetaMask, Rabby, Coinbase Wallet, etc.)
  2. You connect your wallet once in the browser
  3. Transaction requests appear in the browser for approval
  4. Sign or reject transactions directly in your wallet

Supported Wallets

  • MetaMask
  • Rabby
  • Coinbase Wallet
  • Any browser wallet supporting EIP-1193

Manual Access

Visit http://localhost:3456 anytime to:

  • Check wallet connection status
  • See pending transactions
  • View transaction history

Note: The wallet server runs automatically when the MCP server starts. No additional setup required!

Available Tools

Signatures

  • get_function_signature - Generate 4-byte function selectors
  • get_event_signature - Generate 32-byte event topic0 hashes
  • get_error_signature - Generate 4-byte error selectors

Contract Info

  • get_contract_abi - Get ABI with proxy detection and verification status
  • get_contract_source_code - Get verified source code with proxy support
  • get_contract_source_file - Retrieve specific source file from cache
  • is_contract - Check if address is contract or EOA

Contract Interaction

  • call_contract_function - Call view/pure functions (supports batch)
  • call_contract_write - Execute state-changing contract functions via browser wallet
  • simulate_contract - Simulate contract calls without broadcasting (includes gas estimate)

Transactions (Browser Wallet Required)

  • send_native_token - Send ETH/native tokens to an address
  • send_erc20_token - Send ERC20 tokens to an address
  • sign_message - Sign messages with your wallet
  • wallet_status - Check wallet connection status

Gas & Simulation

  • estimate_gas - Estimate gas cost for any transaction
  • get_gas_price - Get current gas prices (legacy & EIP-1559)

ENS

  • resolve_ens_name - ENS name → address
  • reverse_resolve_ens - Address → ENS name
  • get_ens_text_record - Get text records (avatar, email, twitter, etc.)
  • get_ens_avatar - Get avatar URI
  • batch_resolve_ens_names - Batch resolve multiple names

Balances

  • get_balance - Get native or ERC20 balances (supports batch)

Events & Logs

  • get_logs - Query and decode events with Hypersync fallback

Advanced

  • get_storage_at - Read storage slots with type decoding
  • get_block_info - Get block data (timestamp, hash, etc.)
  • trace_transaction - Trace execution (call tree, VM, state diff)

Advanced Configuration

Custom RPC

npx web3-tools-mcp --custom-rpc '{"mainnet":"https://my-rpc.com","base":"https://base-rpc.com"}'

RPC Failover

Automatic provider selection: Alchemy → Infura → Public RPCs

Batch Operations

Many tools support batching for improved efficiency (contract calls, balances, ENS resolution).

Requirements

  • Node.js ≥ 20.0.0
  • Internet connection for RPC calls

Testing

npm test              # Run all tests
npm run test:watch   # Watch mode
npm run test:ui      # UI mode

License

MIT