kosyak-evm-mcp-server

v2.35.0
kosyak-evm-mcp-server Checked 2 days ago Published 11 days ago

MCP server for EVM blockchains — 69 tools, 10 prompts, 86 networks (plus any chain ID)

Model Context Protocol server for interacting with 86 built-in EVM blockchains — and any other chain by its ID — from Claude Code or any MCP client. 66 tools, 10 prompts, 86 networks (170 name aliases). Add to ~/.claude.json (user scope; claude mcp add writes there too) or to a project-level .mcp.json. Leave unused keys as empty strings — they will be ignored. Restart Claude Code after saving.

Summary extracted from the README.

kosyak-evm-mcp-server

Model Context Protocol server for interacting with 86 built-in EVM blockchains — and any other chain by its ID — from Claude Code or any MCP client. 66 tools, 10 prompts, 86 networks (170 name aliases).

Highlights

  • Full EVM coverage — reads, writes, history, event logs, contract analysis, NFT tradability, gas estimation, signing
  • Zero-config contract reads — read_contract auto-fetches ABI, auto-resolves proxies, auto-decodes reverts; multicall batches reads via Multicall3
  • Historical state + overrides — read_contract / get_storage_at / read_storage_batch accept any blockNumber or block tag; simulate_call and read_contract accept stateOverride to test "what if X were Y" without sending
  • Verified source navigation — get_contract_source supports grep (ripgrep-style), files, index modes to avoid 200KB+ dumps of multi-file Solidity sources
  • Proxy-aware — EIP-1967 Transparent/UUPS, Beacon, EIP-1167 / 0age / EIP-7511 / vanity clones, Solady CWIA, Zeppelinos-classic, EIP-1822, implementation()-getter proxies (ERC-897 — stETH, Compound delegators) confirmed by a real DELEGATECALL, Gnosis Safe, EIP-2535 Diamonds — and returns the merged ABI
  • 47+ events auto-decoded — Uniswap V2/V3/V4, Aave V3, Compound V2/V3, Seaport, Lido, ERC20/721/1155, OpenZeppelin admin events
  • Pre-flight simulation + revert cascade — simulate_transaction accepts {functionName, args, abiJson?} for safe encoding; on revert returns firstRevertedCall (DFS-walked trace trees) decoded via cascade: Panic/Error → contract ABI → impl ABI → openchain.xyz → 4byte. Auto-falls back to native eth_call on chains Tenderly doesn't support
  • Unverified contract toolkit — find_recent_calls reverse-engineers ABIs from on-chain calldata (per-slot type heuristics, signature lookup); decompile_local shells out to a local heimdall (opt-in via HEIMDALL_PATH); encode_calldata / compute_selector for hand-crafted bytes
  • Semantic tx summaries — get_transaction_receipt returns assetSummary bucketing transfers/mints/burns/approvals/swaps; get_address_history returns valueSummary with totalIn/totalOut/net; get_gas_price exposes typicalCosts for common operations
  • NFT tradability (ERC721 + ERC1155) — open / likely_soulbound / marketplace_only / frozen via simulation + ground-truth Transfer-log evidence; standard auto-detected, ERC721 cross-checks transferFrom and safeTransferFrom
  • EIP-7702 + ERC-1271 — EOA delegation detection, smart-wallet signature verification (Safe, ZeroDev, Biconomy, Solady)
  • Free-tier friendly — get_logs auto-chunks wide block ranges when Alchemy rejects them, with rate-limit retry
  • Rotating proxy pool — EVM_PROXIES (inline list or a file, ip:port:user:pass or URLs, HTTP(S)/SOCKS5): requests rotate across egress IPs, a throttled IP is parked and the request re-sent through another at once — public RPCs stop rate-limiting sweeps
  • Your own RPC endpoints — EVM_RPC_URLS per chain (inline, CSV or JSON file); without them, 74 of 86 chains still have 1–3 live-probed keyless alternates built in. Any chain ID beyond the built-in 86 works too: from viem's chain registry, or from your own endpoint (a chain_id,url CSV is enough). Requests pinned by hash or block number fail over to another endpoint when the primary is throttled, down, or lacks the data (archive gates); "not found" is confirmed on a second node before it is reported. get_chain_info probe:true measures what each endpoint can do (archive, getLogs window, traces, filters, Multicall3)
  • Forensics — approval_exposure (min(allowance, balance) per owner×token at one block, unread ≠ zero, optional drain simulation), find_approvals (everyone who approved a spender, still live), find_deployments (same address on every chain), scan_blocks (who sits at the top of blocks)
  • Unverified contracts — analyze_bytecode recovers the dispatcher's real selectors (725/725 functions, 0 false positives on a 29-contract corpus incl. Vyper and via-IR), custom errors, events, flags, metadata; lookup_selector lists every colliding signature and picks one only by exact round-trip; decode_transaction_input decodes without ABI or Tenderly, down to a structural decode of offsets/arrays; simulate_deploy returns the runtime a creation would store
  • Time and change — every block parameter takes a time too ("30d", "2026-09-01", "@1727740800") resolved to the last block at or before it; multicall reads the same calls at many blocks (blockNumbers); find_change_block bisects on the server for the block where a balance, a call result, a nonce, storage or code became zero / non-zero / changed (~26 reads over 30M blocks, both sides verified); get_contract_creation finds a deployment from the chain alone when no explorer serves it
  • Honest simulation — simulate_call checks that the node APPLIED your stateOverride (some silently drop it and answer as if none were sent) and moves to an endpoint that does; simulate_calls with sequential runs calls in order in one simulated block (approve → transferFrom, a 7702 batch) and assetDelta measures what actually arrives; estimate_gas names the chain's gas model (data availability folded into gas, L1 fee on top, EraVM pubdata) and gives the execution part where measurable; an Era paymaster's validation can be simulated
  • Many chains, dead chains — any read tool takes networks: [...] (the same question on up to 60 chains, a row each with its own status) and timeoutMs; when no endpoint answers at all the answer says so and lists what each did (rpcFailures names the endpoints that failed, per method), and a chain whose every endpoint just failed is refused in seconds instead of after the whole deadline
  • Census, not a dump — get_logs aggregate returns distinct emitters / events / indexed topics with count and first/last block (token holders = Transfer + topic2) without ever holding the logs; sampleWindows reads a long history by evenly spread windows and says it is a sample; an EMPTY eth_getLogs answer is re-read on a second endpoint before it counts (emptyCheck); window returns the widths the endpoint answered and refused (and the server remembers them per endpoint)
  • Storage by getter — find_storage_slot finds the slot a getter reads (forge stdstore over RPC: one overridden eth_call with a sentinel per candidate, verified; packed fields, Vyper layouts, a trace fallback for ERC-7201); simulate_call's stateOverride[].storageBy sets state by getter and reports resolvedSlots
  • Money in one snapshot — quote_swap returns a V2/V3 quote WITH the pool's reserves and the marginal price at one block (quoteConvergesToReserve: the quote is just what someone put in the pool — the bait shape); cctp_message follows a CCTP transfer from the burn to Circle's attestation to the destination's usedNonces, and assembles the claim when it is attested but not received
  • Untrusted text — token names, revert strings and source come from the contract's author: invisible and bidi characters are shown escaped in every answer, never passed raw
  • Endpoint control — rpcUrls on any read tool (your endpoints for that one call, the only ones it uses), answeredByRpc on every answer, quorum (ask 2-5 endpoints, verdict known / not_known_and_sure / not_known_unsure) for tx lookups, balances, code and nonces
  • Write safety — 3 layers: DRY_RUN default, mainnet block, explicit confirm: "CONFIRMED"
  • Parallel-write safe — per-wallet nonce manager + optional nonce/gas/maxFeePerGas overrides; send_raw_transaction for replace-by-fee and pre-signed flows

Quick Start

Add to ~/.claude.json (user scope; claude mcp add writes there too) or to a project-level .mcp.json.

Windows

{
  "mcpServers": {
    "evm": {
      "type": "stdio",
      "command": "npx.cmd",
      "args": ["-y", "kosyak-evm-mcp-server"],
      "env": {
        "EVM_PRIVATE_KEY": "",
        "ETHERSCAN_API_KEY": "",
        "BLOCKSCOUT_API_KEY": "",
        "ALCHEMY_API_KEY": "",
        "TENDERLY_RPC_URLS": "",
        "EVM_PROXIES": "",
        "EVM_RPC_URLS": "",
        "ALLOW_MAINNET_WRITE": "false",
        "HEIMDALL_PATH": ""
      }
    }
  }
}

macOS / Linux

{
  "mcpServers": {
    "evm": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "kosyak-evm-mcp-server"],
      "env": {
        "EVM_PRIVATE_KEY": "",
        "ETHERSCAN_API_KEY": "",
        "BLOCKSCOUT_API_KEY": "",
        "ALCHEMY_API_KEY": "",
        "TENDERLY_RPC_URLS": "",
        "EVM_PROXIES": "",
        "EVM_RPC_URLS": "",
        "ALLOW_MAINNET_WRITE": "false",
        "HEIMDALL_PATH": ""
      }
    }
  }
}

Leave unused keys as empty strings — they will be ignored. Restart Claude Code after saving.

Environment Variables

Variable Required Description
EVM_PRIVATE_KEY For writes Private key (0x prefix optional)
ETHERSCAN_API_KEY Recommended Contract ABIs, tx history, token/NFT transfers. Accepts one key, several comma-separated, or an absolute path to a file with one key per line. Keys are rotated round-robin, so N keys give N times the rate limit
BLOCKSCOUT_API_KEY Recommended for non-Etherscan chains Same three forms. A PRO key (proapi_…) routes every chain the Blockscout PRO API covers through api.blockscout.com on your key's quota — instance hosts ignore keys and meter by IP (≈10 v1 requests per half hour keyless). Free PRO tier at dev.blockscout.com
EXPLORER_INSTANCES Optional Add or replace an explorer host: 7777777=https://…. Gives a chain one where there is none, and lets explorer: "blockscout" work on Etherscan-served chains (the default route stays Etherscan). Must speak the Etherscan v1 API. BLOCKSCOUT_INSTANCES still works as the former name
ALCHEMY_API_KEY Optional Premium RPC (fallback to public RPCs)
TENDERLY_RPC_URLS Optional Transaction tracing — comma-separated gateway URLs (one per network). Get them at Tenderly Dashboard → Node → Create Gateway
ALLOW_MAINNET_WRITE Optional Enable real mainnet transactions, including send_raw_transaction (default: false)
HEIMDALL_PATH Optional Path to a local heimdall binary used by decompile_local (defaults to heimdall in PATH)
EVM_PROXIES Optional Proxy pool: one proxy, a comma list, or an absolute path to a file (one per line, reloaded on change; # starts a comment only at line start or after a space, and commas never split a file line — passwords may contain both). Formats: ip:port:user:pass, user:pass:host:port, user:pass@host:port, host:port, or URLs with http://, https://, socks5://. The port must be written, 80/443 included. Invalid lines are reported by line number only. EVM_PROXY_FILE is an alias
EVM_PROXY_TYPE Optional Scheme for lines without one: http (default) or socks5
EVM_PROXY_SCOPE Optional What goes through the pool: public-rpc (default — every RPC whose URL carries no key; keyed endpoints go direct because keys are often IP-allowlisted), rpc (all RPC), all (RPC + explorers, signature DBs, CoinGecko, Sourcify), off
EVM_PROXY_DIRECT Optional fallback (default: own IP only when every proxy is parked for that host), rotate (own IP is one more pool member), never (privacy: never send directly — a request fails rather than go out from your IP when no proxy is usable)
EVM_PROXY_PARALLEL Optional Log-scan requests in flight at once when they go through the pool (get_logs, NFT activity/transferability, approval scans): default 8, max 32, 1 turns it off. Without a pool, or on a keyed endpoint (metered per key), log scans stay sequential. scan_blocks and multicall always run 8 and 4 at once and take this value when it is higher (multicall: aggregate3 batches up to 16; single eth_calls where Multicall3 is absent run twice that). requestDelayMs then spaces requests per lane
EVM_RPC_URLS Optional Your own RPC endpoints per chain; the first becomes the primary for reads AND writes (ahead of Alchemy). 4663=https://a|https://b,base=https://c, an absolute path to a file — a CSV with a header row (chain_id,url, extra columns ignored, one row per endpoint), lines (chain url url…), or JSON {"4663":["https://a"]} — reloaded on change. Any chain ID works here, built in or not: a chain this server does not ship becomes usable under its id. Basic-auth URLs (https://user:pass@host) work. Credentials and path keys in these URLs are redacted from all output
EVM_OUTPUT_DIR Optional Directory where a relative outFile is written (default <os temp>/evm-mcp; a relative value is taken from the server's working directory)
EVM_TOOL_TIMEOUT_MS Optional Per-tool-call deadline in ms (default 120000, minimum 10000; block-range scanners get 5×). A call that exceeds it returns an error instead of hanging; wait_for_* and confirmed writes are exempt

Address parameters accept ENS names (vitalik.eth) unless a tool's description says otherwise; on chains without ENS they resolve through mainnet.

Block explorers

Contract ABIs, verified source and address history come from Etherscan V2 where it serves the chain (44 of the 86 networks — including Robinhood Chain via robin.etherscan.io and Sonic — one key covers all of them) and from that chain's Blockscout instance otherwise (29 more networks; Boba's is Routescan's Etherscan-compatible API). A Blockscout PRO key the gateway refuses (402 on a free plan) falls back to the chain's own free Blockscout host. The choice is automatic; every response says which explorer answered and, when it fell back, why. Pass explorer: "etherscan" | "blockscout" to force one.

ABIs and verified source also fall back to Sourcify (no key needed, verified by metadata hash): contracts verified only there, chains with no explorer, and setups without an Etherscan key. The remaining 13 networks have no public explorer API for address history: Cronos, Fantom, Polygon zkEVM, Zora, Zora Sepolia, Scroll Sepolia, Mode Testnet, Metis Sepolia, Celo Alfajores, Anime Chain, Pharos, Zircuit and Karak. Add one yourself with EXPLORER_INSTANCES. Reads, writes, logs and simulation work on all 86 networks regardless.

Rate limits behave differently on the two: Etherscan meters per key, so a pool of keys multiplies throughput, while Blockscout meters per instance, so extra keys there buy reliability rather than speed.

Function args are strings of raw ABI values: numbers in base units as decimal or hex, bool as 'true'/'false', arrays and tuples as JSON strings ('["0xabc…", "1000"]'). Amount parameters (amount, value) are human units ("1.5") and reject more decimals than the token has instead of rounding. Tools that pin one block refuse blockNumber: "pending". API keys are redacted from every tool response.

Tools (66)

Chain & Wallet

Tool Description
get_wallet_address Current wallet address
get_chain_info Chain ID from the node (mismatch flagged), head, RPC endpoints, explorer, Tenderly and proxy-pool status, readLanes; probe: true measures the first endpoint that serves the chain (probeAll: every one) — archive state, getLogs window + topic-only filters, block receipts, debug/trace, filters, Multicall3
get_supported_networks Every chain by chainId with its name and aliases (plus chains that exist only through EVM_RPC_URLS). Any other chain ID also works: from viem's chain registry (~700 chain ids, ~620 beyond the built-in ones; default RPC, checked for the right chain id before use) or with an EVM_RPC_URLS endpoint
get_gas_price Base fee + priority fee + typicalCosts (ETH/ERC20/Uniswap V2/V3 operation costs); usd: true adds the native coin's price and typicalCostsUsd
estimate_gas Preview gas + cost, and gasModel, decided by probing the chain: plain / l1-fee-separate (an L1 fee oracle answers — OP stack incl. Boba/Mantle/Metis, Scroll; l1FeeUpperBoundWei) / da-in-gas-units (Arbitrum via NodeInterface, Etherlink: a bare transfer ~620k) / eravm-pubdata (zks fields for a 0x71 tx) / nonstandard-gas-units / unknown. executionGasEstimate only where measured
get_transaction_count Nonce: latest, pending, inflight (accepted, not mined); quorum asks 2-5 endpoints

ENS

Tool Description
resolve_ens_name ENS name → address
lookup_ens_address Address (or ENS name) → primary ENS name, checked forward; status found / no_primary_name / reverse_record_mismatch, falls back to mainnet on chains without ENS. An RPC failure is an error, never "no name"

Blocks

Tool Description
get_block Block by number, hash, tag or time. Compact by default; includeTransactions, includeBurnedFee, includeReceipts (every receipt in one eth_getBlockReceipts, receiptLogs to add decoded logs); from / to / participant keep only that address's transactions. Always shows timestamp_msk
get_latest_block Head block. Shorthand for get_block with blockIdentifier: "latest"

Balances & NFT

Tool Description
get_balance Native token balance (ETH/MATIC/etc.), optional blockNumber (or a time); quorum
find_change_block The block where a value became zero / non-zero / changed, or code appeared — native or token balance, a contract call, nonce, storage slot, code — by server-side bisection, with the values on both sides and the transactions that moved a balance
wait_for_balance_change Poll a native or token balance until it changes; names the exact block, the delta and the transactions that moved it with sender, position and effective gas price
get_token_holdings The tokens an address holds (ERC20/721/1155) without knowing the contracts — balanceOf needs an address, so only an indexer can answer this. Blockscout-backed, ranked by USD value where a price exists; the index omits some tokens, so counts are a floor
get_token_balance ERC20 balance, optional blockNumber
get_allowance ERC20 allowance with formatted + isInfinite flag, pinned to one block (echoed)
get_erc1155_balance ERC1155 balance, optional blockNumber
get_nft_info ERC721 metadata; resolveMetadata: true fetches the JSON from on-chain data: URIs, ipfs:// (via gateways that still serve scripts), ar://, http(s). A failing tokenURI is classified: nonexistent token vs empty revert (retried with more gas)
approval_exposure Owners × tokens against one spender at a pinned block: ERC20 min(allowance, balance), NFT approvedForAll + balance. Unread = unknown, never zero. simulate: true runs the drain as the spender
find_approvals Every Approval/ApprovalForAll naming a spender (any token), folded to each owner's last grant, then live-checked. Explorer-first (topic-only filters), adaptive RPC otherwise, with a resume cursor
nft_recent_activity Transfer/Mint/Burn summary for ERC721 + ERC1155 collections, auto-chunks under free-tier RPC limits
nft_check_transferability ERC721 + ERC1155 cascade (sim → validator → ground-truth Transfer scan). Returns classification + confidence + proofs. Standard auto-detected via ERC-165; ERC721 cross-checks transferFrom and safeTransferFrom

Transactions

Tool Description
get_transaction Tx details + decoded calldata (built-in selectors, checked against the signature databases for collisions). "Not found" is confirmed on other endpoints first
get_transactions Many transactions by hash at once (up to 1000; past 200 with outFile): from/to/nonce/value/block/selector, receipts: true adds status/gas/logCount; not_found only when every endpoint asked answered so, otherwise unread
get_transaction_receipt Receipt + auto-decoded events (unknown ones by the emitter's verified ABI or an exact signature fit, decoded.source) + assetSummary. summary drops raw logs, netFor nets each address's token flow, resolveTokens adds symbols and formatted amounts. Distinguishes pending from unknown; "not found" confirmed on other endpoints; quorum
wait_for_transaction Wait for confirmation, includes assetSummary. Detects same-nonce replacement/cancellation (reports minedTxHash + replaced status); timeoutSeconds scales with confirmations
get_transaction_trace Call tree of a mined tx. Tenderly when configured for the chain (state changes, asset/balance changes); otherwise — or when it fails — the chain's own debug_traceTransaction (callTracer) or trace_transaction, from the primary or up to 2 alternates that serve it (get_chain_info probeAll shows which): call tree, firstRevertedCall, nativeTransfers, decoded receipt logs. summary=true drops the tree. Unnamed frames get selectorGuess/revertGuess from signature databases
decode_transaction_input Decode calldata with no ABI and no Tenderly required: verified ABI of contractAddress → known selectors → signature DB checked by exact round-trip → Tenderly → structural decode (offsets, arrays, word shapes)
simulate_transaction Tenderly simulate (full trace, asset/balance changes, logs). Accepts {functionName, args, abiJson?} for safe encoding. On revert exposes decodedInput + firstRevertedCall + revertClassification. Auto-falls back to native eth_call when Tenderly does not support the chain
simulate_call Native eth_call with stateOverride (fake balance/nonce/code/storage before the call; balances in wei; storage BY GETTER with storageBy), functionName as a name or full signature. An empty success against an address with no code is flagged (targetHasNoCode). No Tenderly. status: success / reverted (decoded) / execution_failed / rpc_rejected / state_unavailable / rpc_unavailable — only reverted is the contract's answer. stateOverrideApplied says whether the node applied the overrides (requireStateOverride refuses otherwise); eraPaymaster runs a ZK-stack paymaster's validation
simulate_calls Batch of simulate_calls at ONE pinned block: a verdict per call (same statuses, decoded reverts), in input order with your label, plus a status summary. Up to 500 inline or 20,000 from callsFile (with outFile). sequential: true runs them in order in one simulated block (eth_simulateV1), assetDelta measures the native and token balances that change
wait_for_storage_value Poll a slot until it matches expected or change: true. Useful for waiting on flag flips

Event Logs

Tool Description
get_logs Query logs with auto-decoding of 47+ event signatures. Pass eventSignature for auto-topic0 computation. Filtered ranges over 500 blocks on Etherscan-served chains go to the block explorer in one request, with the unindexed head re-read over RPC and merged; rangeCovered/incompleteRange say what the answer actually covers. On the RPC path a refused range becomes an ADAPTIVE scan — window sized from the node's own error text, halved on refusal, grown on sparse chunks — and a spent budget returns resumeFromBlock instead of an error. aggregate (emitter / event / topic1-3 → groups with count and first/last block), sampleWindows, emptyCheck (an empty answer confirmed on a second endpoint), window (widths answered/refused)

History (Etherscan)

Tool Description
get_address_history History by type: native, internal, erc20, erc721, erc1155. Adds valueSummary (totalIn/totalOut/net) for native, internal + erc20; a full page returns nextStartBlock/nextEndBlock (the 10,000-row window)
find_recent_calls Pull recent successful txs to a contract, group by selector, dump per-slot calldata samples + heuristic type hints. Warns when the bytecode has no selector dispatcher (the "selectors" are then just the first bytes of a blob) and names selectors by exact round-trip on real calldata
scan_blocks Census of up to 2000 blocks: who takes position 0/1/2 and at what effective gas price, top senders/recipients, tx counts by type (type 4 seen = the chain accepts EIP-7702), and a focus address's median/min/p90 position and prices. L2 system transactions (OP deposits, ArbOS, zero-gas protocol calls) are excluded from rankings

Contracts & Pricing

Tool Description
get_contract_abi format: 'signatures' + match / mutability: one line per entry (selector, canonical signature, mutability), ~60× smaller. Auto proxy resolution (Diamond: only the functions each facet is routed); returns abi (proxy ∪ impl, impl wins) + proxyAbi/implAbi/proxyInfo. Unverified everywhere: the ABI from the IPFS metadata the bytecode commits to (hash-checked and matched against the dispatcher, abiSource: ipfs-metadata), else the selectors the dispatcher checks (recovered, partial)
get_contract_source Verified Solidity source. definition (a function / modifier / struct / event / error / state variable by name, WHOLE — by its braces, every overload, in every file, with its container contract; events with topic0), fields, index, files, grep (ripgrep-style) — avoids dumping 200KB+ of multi-file source
get_contract_creation Creator + creation tx (explorer, Sourcify fallback, then the chain itself: creation block by bisection over eth_getCode, tx from the block's receipts or trace), direct vs factory creation, constructor arguments with the basis of their boundary (Sourcify / explorer suffix / after the last metadata tail), optional creation code or saveTo. fromBlock hint (a date works); a node without old state gives an honest createdAtOrBefore; not found → steps says what each source answered, earliestActivity an upper bound
get_contract_interfaces ERC-165 detection (ERC-721/1155/2981, AccessControl, Seaport) batched via Multicall3
get_token_metadata Composite: name + symbol + decimals + totalSupply + proxy + verified in one call; tokens (up to 1000) → name/symbol/decimals/totalSupply of many at one block, bytes32 names decoded, unread fields in notRead
get_code Bytecode + classification: EOA / EIP-7702 delegated / contract, EraVM flag, codeHash, compiler metadata; an EOA or delegated account's nonce; an EOA verdict is confirmed on a second endpoint
analyze_bytecode Static analysis without ABI: dispatcher selectors, functions that ALWAYS revert (proven on the code — a transfer like that is a non-transferable token), custom errors, events, ERC-165 ids, compiler + IPFS metadata, opcode flags, storage ops / stateless verdict, minimal proxies; optional recovered ABI. addresses (up to 500): a compact row per contract, each distinct code analyzed once, names matching match
find_storage_slot The slot a getter reads (balanceOf(address), usedNonces(bytes32), or a public variable's name): base slots × Solidity/Vyper mapping layouts tested with one sentinel each in a single overridden eth_call, the hit verified; packed fields (packed.offset/size/bits); a trace fallback for namespaced layouts. "Not found" only after a control proved the endpoint applies storage overrides
lookup_selector Reverse lookup of a selector/topic with ALL colliding candidates; pass the data to pick by exact round-trip
find_deployments Code presence of one address across every configured network, grouped by identical bytecode
simulate_deploy eth_call a contract creation as a real sender (the creation tx's own, or a funded synthetic one): runtime size + hash, or the constructor revert / EVM failure, and a comparison with the code at an address (same code, differing immutables, differing data, different). A node that refuses creation calls is retried on another endpoint and reported as node_refused — never as a constructor revert
decompile_local Run a locally-installed heimdall against the contract's bytecode. Opt-in: requires heimdall in PATH or HEIMDALL_PATH. Cross-checks heimdall's functions against the real dispatcher, flags its Unresolved_ signatures, and lists in ambiguousNames the names it picked for selectors several plausible signatures share. Terminal colour codes are stripped
get_proxy_implementation Detect proxy type and return implementation (slots, clones, getter proxies, Safe, Diamond facets)
get_storage_at Raw storage slot + interpretations (asAddress/asUint256/asBool/isEmpty). Optional blockNumber for historical reads. Several slots at once → read_storage_batch
read_storage_batch Read many storage slots at one block. slots[] or start+count range mode (capped at 256)
read_contract Call view functions (auto-fetches ABI). On revert auto-decodes via cascade; no code at that block → no_code_at_block. Optional from, blockNumber, value, stateOverride
multicall Reads at ONE pinned block — or the same reads at each of blockNumbers — split into parallel Multicall3 batches (eth_call fallback where there is none): up to 2000 inline, or 50,000 from callsFile with outFile. Per-call status: success / reverted / no_data / unread. A call row with any other field (a per-call blockNumber) is refused, never ignored
compute_selector Compute 4-byte selector / 32-byte topic locally (keccak256, no RPC); signatures for up to 500 at once
encode_calldata Build ABI-encoded calldata from a function signature + args (no RPC). Symmetric to decode_transaction_input
get_token_price CoinGecko price by ticker or ID
quote_swap A V2 (any getAmountsOut router) or V3 (QuoterV2, every fee tier) quote WITH the pool's reserves, the marginal price at 1/100 of the size, priceImpact and shareOfReserve, all at one block; the factory and pool are read from the router/quoter itself. quoteConvergesToReserve when the output is most of what the pool holds
cctp_message A Circle CCTP v1/v2 transfer by its source tx: the decoded message and burn, Circle's attestation, usedNonces on the destination transmitter (checked by localDomain() first). verdict: delivered / attested_not_received (with the ready receiveMessage call) / awaiting_attestation / not_attested / unknown

Write (DRY_RUN by default)

Tool Description
transfer_native Send ETH/native tokens. Accepts optional nonce, gas, gasPriceGwei, maxFeePerGasGwei, maxPriorityFeePerGasGwei
transfer_erc20 Send ERC20 tokens. Same override params as transfer_native
approve_token_spending Approve ERC20 spender. infinite: true for max uint256
write_contract Call any contract function. Same override params as transfer_native
send_raw_transaction Broadcast a pre-signed raw tx. Bypasses the per-wallet nonce manager and DRY_RUN simulation — for replace-by-fee / pre-signed flows
sign_message Sign arbitrary messages (SIWE, off-chain)
sign_typed_data Sign EIP-712 typed data (permits, meta-txs)
verify_signature Verify an EIP-191 signature: ECDSA recovery locally, ERC-1271 / ERC-6492 (counterfactual) / ERC-8010 on-chain. method says which decided; an RPC failure is an error, never valid: false

Examples

"What's my ETH balance on mainnet and Polygon?"
"Show my last 10 transactions and total ETH flow"
"What proxy pattern does USDC use and what's the implementation?"
"Find every Solidity file in this contract that mentions onlyOwner"
"Is this address a smart wallet, EOA, or EIP-7702 delegation?"
"Decode this transaction — what did it actually do?"
"Simulate sending 1 ETH to alice.eth — will it succeed?"
"Show all Uniswap V3 swaps in the USDC/WETH pool over the last 10 blocks"
"Give infinite USDC approval to Uniswap router"
"Who approved this exploited router, and how much can it still drain?"
"Is this unverified contract stateless? What functions does it expose?"
"Where else is this address deployed, and is it the same code?"

Bulk work: files in and out

Everything a tool returns lands in the model's context. For mass runs, the bulk tools (get_logs, multicall, simulate_calls, get_address_history, get_token_holdings, nft_recent_activity, find_approvals, approval_exposure, scan_blocks, get_block, get_transactions, get_token_metadata, analyze_bytecode) take outFile: the full answer is written there and the reply is a summary (scalars, counts, savedTo). The name must end in .json, .jsonl, .ndjson or .csv. .json writes the whole answer; .jsonl / .csv write the tool's rows one per line and every other field to a .meta.json beside it (CSV cells that would run as spreadsheet formulas are defused). A file is never overwritten — a taken name becomes name-1.ext. An absolute local path is used as given (network/UNC paths are refused); a relative name goes under EVM_OUTPUT_DIR. With outFile and no explicit limit, get_logs, nft_recent_activity and get_token_holdings keep every row instead of trimming the reply (an explicit limit is honoured); approval_exposure always does. The name is checked before any work starts; if the file still cannot be written, the call is an error with the summary only — rows are never poured into the reply.

multicall and simulate_calls read their calls from callsFile — an absolute path to a JSON array or JSONL of the same call objects:

{"contractAddress": "0xA0b8…eB48", "functionName": "balanceOf", "args": ["0x28C6…1d60"]}
{"to": "0x…", "functionName": "finalizeWithdrawalTransaction", "args": ["[…]"], "from": "0x…", "label": "w-17"}

Time, change and races

Block parameters take a time as well as a number: "@1727740800" (unix seconds), "2026-09-01" / "2026-09-01T12:00Z" (UTC unless a zone is given) or "30d" / "12h" / "90m" ago (M is refused: minutes or months?). The server resolves it to the last block at or before that moment — or, for the fromBlock of a scan (get_logs, scan_blocks, find_approvals…), the first block at or after it — by interpolation search over block headers (no archive needed), and says what it became in blockTimes. A bare number is always a block number.

  • A time series: multicall with blockNumbers: ["2026-01-01", "90d", "30d", "7d", "latest"] — the same calls at each block, rows tagged with their block.
  • When did it change: find_change_block — e.g. { read: "token_balance", token, address, predicate: "became_zero" } — returns the first block where it holds, the values read just before and at it, and the transactions that moved the balance. Bisection assumes the condition keeps holding once met; a value that went back and forth may have an earlier crossing.
  • Deployment block without an explorer: get_contract_creation (falls back to bisection over eth_getCode), or find_change_block with code_appeared.
  • Races: get_transaction_count gives latest / pending / inflight; wait_for_balance_change reports who moved a balance and at what gas price; scan_blocks shows the gas price it takes to win the first slots.

Proxies and RPC endpoints

Point EVM_PROXIES at a file with your pool (the ip:port:user:pass export format works as is):

"EVM_PROXIES": "C:\\keys\\proxy.txt",
"EVM_RPC_URLS": "4663=https://my-robinhood-node.example|https://rpc.mainnet.chain.robinhood.com"

Read requests to public RPCs then rotate across the pool; a throttle (429, 503 with Retry-After, or a rate-limit error inside a 200 reply) parks that proxy for that host and the request goes out through another one immediately, a dead proxy is skipped with a growing cooldown, a proxy that rejects its credentials (407) is parked for 10 minutes, and your own IP is used only when every proxy is parked (EVM_PROXY_DIRECT). Bulk scans also run several requests at once through the pool (EVM_PROXY_PARALLEL, default 8): a 1,500-block nft_recent_activity (151 eth_getLogs chunks) took 5.8 s over 4 proxies against 22 s sequentially, with the same answer. A request re-sent through another proxy is listed in the tool's egressReroutes. Writes and raw-transaction broadcasts never go through the pool and are never re-sent. get_chain_info shows the pool's state (labels only — credentials never appear in any output). HTTP(S) proxies work under node and bun; SOCKS5 under node (the npx install).

With several endpoints for a chain, requests whose answer is fixed by the request — a transaction/receipt/block by hash, state at a concrete block number, a numbered log range after an archive refusal — move to the next endpoint when the primary is throttled, down, or cannot serve the data, and the response names the endpoint that answered (rpcFailover). Head-relative reads (latest, pending, nonces) stay on the primary — two nodes' mempools and heads disagree, and mixing them loses data silently — except when the primary does not offer the method at all. A contract revert never moves, and the primary's credentials are never sent to another endpoint.

RPC endpoints per chain, in order: EVM_RPC_URLS → Alchemy (ALCHEMY_API_KEY) → the chain's built-in public RPC → built-in keyless alternates (74 of 86 chains). get_chain_info lists them and whether each serves the chain.

Per call, every read tool takes rpcUrls: your own endpoints for that one call — the only ones it uses, Tenderly included (the first is the primary, the rest its failover); each must PROVE it serves the chain (eth_chainId) before its first read, and cloud-metadata addresses are refused. It bypasses a lagging, geoblocked or non-archive endpoint, or keeps a call away from a provider, without restarting the server; writes and signatures never take it. Every answer carries answeredByRpc (the endpoints that answered — a reply, not a 429 or a throttle). A caller's endpoint that does not answer eth_chainId is tried a few times and the next of your URLs that proves itself becomes the primary. get_transaction, get_transaction_receipt, get_balance, get_code and get_transaction_count take quorum: 2-5: the same question to that many endpoints, state reads pinned to one block, each endpoint's answer listed, and a three-valued verdict — known, not_known_and_sure (every endpoint asked said "absent"), not_known_unsure (someone did not answer: never read it as absence).

Event Auto-Decoding

get_logs and get_transaction_receipt decode known event signatures into human-readable form:

  • ERC20/721/1155 — Transfer, Approval, ApprovalForAll, TransferSingle, TransferBatch (Mint/Burn detection via zero address)
  • WETH — Deposit, Withdrawal
  • Uniswap V2 — Swap, Sync, Mint/Burn (LP)
  • Uniswap V3 — Swap, Flash
  • Uniswap V4 — Swap, Initialize, ModifyLiquidity
  • ERC-4626 Vaults — Deposit, Withdraw
  • Aave V3 — Supply, Borrow, Repay, Withdraw, LiquidationCall, FlashLoan
  • Balancer V2 — FlashLoan
  • Compound V2 — Mint, Redeem, Borrow, RepayBorrow, LiquidateBorrow
  • Compound V3 (Comet) — Supply, Withdraw, SupplyCollateral, WithdrawCollateral, AbsorbDebt, BuyCollateral
  • Lido (stETH) — Submitted, TransferShares
  • Seaport (OpenSea) — OrderFulfilled, OrderCancelled, OrdersMatched, CounterIncremented
  • Admin (OpenZeppelin) — OwnershipTransferred, Paused, Unpaused, RoleGranted, RoleRevoked, Initialized

Any other event is decoded by evidence (decodeUnknown, default on; up to 10 emitters / 8-10 s per call): the emitter's verified ABI (decoded.source: verified-abi, a proxy's implementation merged in), for a proxy whose current ABI lacks the event the implementation that was set at the log's block (implementation-at-block), else the signature databases when topics and data re-encode exactly under one placement of the indexed parameters (signature-db, unverifiedSignature when no verified contract declares it). Several fits are ambiguous with candidates (or placements with a likelyPlacement hint) — never one picked.

Security

Write operations use a 3-layer protection model:

  1. DRY_RUN default — every write simulates first, returns gas estimate, zero risk
  2. Mainnet block — real mainnet txs disabled unless ALLOW_MAINNET_WRITE=true
  3. Explicit confirm — real execution requires confirm: "CONFIRMED"; on testnets only allowlisted chains accept it

Signatures that act as approvals — EIP-712 with a mainnet or missing chainId (Permit, Permit2, Seaport) and blind signing of a bare 32-byte digest — also require ALLOW_MAINNET_WRITE=true.

send_raw_transaction bypasses the per-wallet nonce manager and DRY_RUN gas simulation — the caller is responsible for the bytes. The ALLOW_MAINNET_WRITE and DRY_RUN-by-default policies still apply.

Networks (86)

Mainnets: Ethereum, Polygon, Arbitrum, Optimism, Base, HyperEVM, BSC, Avalanche, zkSync, Linea, Scroll, Mantle, Blast, Celo, Gnosis, Fantom, Filecoin, Moonbeam, Cronos, Aurora, Flow, Ronin, SEI, Astar, ApeChain, Manta, Fraxtal, Mode, Metis, Zora, opBNB, Ink, Unichain, Abstract, Anime Chain, Monad, MegaETH, Robinhood Chain, Sonic, Soneium, Lisk, Hemi, Boba, Zircuit, Pharos, Swan, Orderly, Cyber, DBK Chain, Funki, Etherlink, Karak K2 (halted 2026-09-17; kept for reading its frozen state)

Any other chain ID works as network too: from viem's chain registry (~700 chain ids; its default RPC — checked to answer as that chain before the first read, otherwise unprobed, no curated fallbacks), or from your own EVM_RPC_URLS endpoint (get_chain_info shows chainConfig: viem-registry | custom-rpc).

Testnets: Sepolia, Hoodi, Robinhood Testnet, Optimism Sepolia, Arbitrum Sepolia, Base Sepolia, Polygon Amoy, Avalanche Fuji, BSC Testnet, zkSync Sepolia, Linea Sepolia, Scroll Sepolia, Celo Sepolia, MegaETH Testnet, and more.

Development

git clone https://github.com/kosyakdev/evm-mcp-server
cd evm-mcp-server
npm install
npx tsc --noEmit   # typecheck
npm test           # unit tests (bun test test/)
bun run build      # build to build/
npm start          # run stdio server

Releases are automated via GitHub Actions — bump the version in package.json and push to main, and CI publishes to npm. See CLAUDE.md for details.

License

MIT