> ## Documentation Index
> Fetch the complete documentation index at: https://docs.etherscan.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Etherscan MCP

> Connect AI agents to live Etherscan API data through the Model Context Protocol.

The Etherscan MCP server connects AI agents to live onchain data across all 60+ [supported chains](/supported-chains), over [MCP](https://modelcontextprotocol.io). Connect it to a client like Claude Desktop, Claude Code, or Codex, then ask in plain language and get answers grounded in real Etherscan API responses.

<Frame>
  <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/mcp.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=fdb039d30d49a743ca0eae4bd7f5d72b" alt="The Etherscan MCP" width="2400" height="1350" data-path="images/mcp.png" />
</Frame>

<Tip>
  One connection covers every chain, just pass the `chainid`. Ask about Arbitrum and the agent uses `chainid=42161`. See [Supported chains](/supported-chains) for the full list.
</Tip>

## Get started

First, [create a free API key](/set-up-your-api-key) if you do not have one. Then pick your client below and follow it end to end.

<Tabs>
  <Tab title="Claude Desktop">
    [Claude Desktop](https://claude.ai/download) is Anthropic's desktop chat app.

    <Steps>
      <Step title="Add Etherscan to your config">
        In Claude Desktop, open **Settings > Developer > Edit Config** to open the `claude_desktop_config.json` file.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=97b14a68ffd5123bd9077e3070f83268" alt="Claude Desktop Settings > Developer, showing the Edit Config button" data-og-width="1510" width="1510" data-og-height="765" height="765" data-path="images/claude-desktop-config.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=280&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=a379ade714cc837368392706e0813453 280w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=560&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=693ec8e5ea7d4359363a900c388b60c0 560w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=840&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=ff1b4a24d4beb712a57409719e2c9457 840w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=1100&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=8e688593e9752bc98f648bfc6108dd8a 1100w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=1650&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=6130098fc53a2ed4ff7e64c6e6aa1b45 1650w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-config.png?w=2500&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=e1d707ff0216b27a710ead51ca5edac1 2500w" />
        </Frame>

        In the file that opens, add the `etherscan` server (replace `YourApiKey` with your key):

        ```json claude_desktop_config.json theme={null}
        {
          "mcpServers": {
            "etherscan": {
              "command": "npx",
              "args": [
                "-y",
                "mcp-remote",
                "https://mcp.etherscan.io/mcp",
                "--header",
                "Authorization:${AUTH_TOKEN}"
              ],
              "env": {
                "AUTH_TOKEN": "Bearer YourApiKey"
              }
            }
          }
        }
        ```

        Requires [Node.js](https://nodejs.org).
      </Step>

      <Step title="Confirm it's connected">
        Save, then fully quit Claude Desktop and reopen it. Then open **Settings > Developer** and look for `etherscan` under Local MCP servers with a **running** badge.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=b4abd4448a6acd9a42c18e3f01312d82" alt="Claude Desktop Settings > Developer showing the Etherscan MCP server with a running badge" data-og-width="1511" width="1511" data-og-height="701" height="701" data-path="images/claude-desktop-connected.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=280&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=a451f053a5a1bb14c8cc3bd44b67a175 280w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=560&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=e58b0e5867b88a45f3490918c391d1ea 560w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=840&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=075c782b03933afb549dd078dfc27ac2 840w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=1100&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=f7a5d7331e2d3e7bfdca1f67de047576 1100w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=1650&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=a5269e5c8d73a24c3093c7e6774a1f18 1650w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-connected.png?w=2500&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=adb014fab205602a9ba32140dac92731 2500w" />
        </Frame>
      </Step>

      <Step title="Ask your first question">
        Ask in plain language and approve the tool calls when prompted:

        ```text theme={null}
        Give me a one-liner summary for this transaction: 0xa44757750f25d11d8d22434a68c39c6962a55ddf369ce202624950ada3080acf
        ```

        In this example, it calls two tools:

        * `get_transaction_by_hash` for the sender, recipient, amount, and input data
        * `get_transaction_receipt` to confirm the transaction succeeded

        It then answers with a one-line summary. Both tools work on the free API plan.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/claude-desktop-ask.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=b3bb94c6eac251e12952e236eb39fb9a" alt="Claude Desktop giving a one-line summary of a USDT transfer via the Etherscan MCP, then adding Etherscan name tags: Bitstamp 61 sent 269,618.78 USDT to a Bitget deposit address" width="1934" height="1414" data-path="images/claude-desktop-ask.png" />
        </Frame>

        To label the addresses involved with their Etherscan name tags, follow up with:

        ```text theme={null}
        Add the Etherscan name tags and labels for the sender and recipient
        ```

        This uses `get_address_labels`, a Pro tool that requires a [paid plan](https://etherscan.io/api/pricing).
      </Step>
    </Steps>
  </Tab>

  <Tab title="Claude Code CLI">
    [Claude Code](https://code.claude.com/docs/en/quickstart#step-1-install-claude-code) is Anthropic's coding assistant that runs in your terminal.

    <Steps>
      <Step title="Add the server">
        Run this in your terminal, replacing `YourApiKey` with your key:

        ```bash theme={null}
        claude mcp add --transport http etherscan \
          https://mcp.etherscan.io/mcp \
          --header "Authorization: Bearer YourApiKey"
        ```
      </Step>

      <Step title="Confirm it's connected">
        Check the server's status and look for `Status: ✔ Connected`:

        ```bash theme={null}
        claude mcp get etherscan
        ```
      </Step>

      <Step title="Ask your first question">
        Start a Claude Code session by running `claude`, then ask in plain language and let the agent pick the tools:

        ```text theme={null}
        Give me a one-liner summary for this transaction: 0xa44757750f25d11d8d22434a68c39c6962a55ddf369ce202624950ada3080acf
        ```

        In this example, it calls the tool `get_transaction_by_hash` for the sender, recipient, amount, and input data. It then answers with a one-line summary. This tool works on the free API plan.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/mcp-example.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=e3b2693e89d4397ffb3aabd20b5c6709" alt="Claude Code giving a one-line summary of a USDT transfer via the Etherscan MCP" width="1800" height="544" data-path="images/mcp-example.png" />
        </Frame>

        To label the addresses involved with their Etherscan name tags, follow up with:

        ```text theme={null}
        Add the Etherscan name tags and labels for the sender and recipient
        ```

        This uses `get_address_labels`, a Pro tool that requires a [paid plan](https://etherscan.io/api/pricing).
      </Step>
    </Steps>
  </Tab>

  <Tab title="Codex Desktop">
    Codex Desktop is the ChatGPT desktop app running OpenAI's [Codex](https://developers.openai.com/codex) agent, which can connect to MCP servers.

    <Steps>
      <Step title="Add the server">
        In Codex Desktop, open **Settings > Plugins > Add > Add MCP Server**.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=3d13f2a575bafa0649756ab4ef7667ce" alt="Codex Desktop Settings > Plugins showing the MCP servers list and the Add server button" data-og-width="2574" width="2574" data-og-height="1494" height="1494" data-path="images/codex-desktop-mcp.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=280&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=0eb233616f095fa26c16307a9d5f7253 280w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=560&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=df2c55fd2d175ae6b57c7262f4f2019f 560w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=840&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=378526bd605ba709959ddc4970631579 840w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=1100&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=299318b624a278fa0c5711866cb9701d 1100w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=1650&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=d6ab20de56d818148a8c2e3012be1148 1650w, https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-mcp.png?w=2500&fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=04747ee0233a565a7a13cb89e7d2ddc2 2500w" />
        </Frame>

        Enter the following server details (replace `YourApiKey` with your key):

        * **Name:** Etherscan MCP
        * **Type:** Streamable HTTP
        * **URL:** `https://mcp.etherscan.io/mcp`
        * **Headers:** `Key=AUTHORIZATION`, `Value=Bearer YourApiKey`
      </Step>

      <Step title="Confirm it's connected">
        Save, then fully quit Codex Desktop and reopen it. Then run `/mcp` and confirm that `etherscan` is listed as an enabled server.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-connected.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=d5d567ae329636b01e28abc6afdac391" alt="Codex Desktop showing the Etherscan MCP server enabled under Servers" width="1540" height="674" data-path="images/codex-desktop-connected.png" />
        </Frame>
      </Step>

      <Step title="Ask your first question">
        Ask in plain language:

        ```text theme={null}
        Give me a one-liner summary for this transaction: 0xa44757750f25d11d8d22434a68c39c6962a55ddf369ce202624950ada3080acf. use mcp
        ```

        In this example, it calls two tools:

        * `get_transaction_by_hash` for the sender, recipient, amount, and input data
        * `get_transaction_receipt` to confirm the transaction succeeded

        It then answers with a one-line summary. Both tools work on the free API plan.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-desktop-ask.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=028cf5bfd93f2c54167c4b86aee67faa" alt="Codex Desktop giving a one-line summary of a USDT transfer via the Etherscan MCP" width="1574" height="916" data-path="images/codex-desktop-ask.png" />
        </Frame>

        To label the addresses involved with their Etherscan name tags, follow up with:

        ```text theme={null}
        Add the Etherscan name tags and labels for the sender and recipient
        ```

        This uses `get_address_labels`, a Pro tool that requires a [paid plan](https://etherscan.io/api/pricing).
      </Step>
    </Steps>
  </Tab>

  <Tab title="Codex CLI">
    [Codex CLI](https://learn.chatgpt.com/docs/codex/cli#getting-started) is OpenAI's coding agent in your terminal.

    <Steps>
      <Step title="Set your API key as an environment variable">
        Run this in your terminal (replace `YourApiKey` with your key):

        ```bash theme={null}
        export ETHERSCAN_API_KEY=YourApiKey
        ```
      </Step>

      <Step title="Add the server">
        Run this in your terminal:

        ```bash theme={null}
        codex mcp add etherscan \
          --url https://mcp.etherscan.io/mcp \
          --bearer-token-env-var ETHERSCAN_API_KEY
        ```
      </Step>

      <Step title="Confirm it's connected">
        Check the server and look for `enabled: true`:

        ```bash theme={null}
        codex mcp get etherscan
        ```
      </Step>

      <Step title="Ask your first question">
        Start a Codex session by running `codex`, then ask in plain language and let the agent pick the tools:

        ```text theme={null}
        Give me a one-liner summary for this transaction: 0xa44757750f25d11d8d22434a68c39c6962a55ddf369ce202624950ada3080acf. use mcp
        ```

        In this example, it calls two tools:

        * `get_transaction_by_hash` for the sender, recipient, amount, and input data
        * `get_transaction_receipt` to confirm the transaction succeeded

        It then answers with a one-line summary. Both tools work on the free API plan.

        <Frame>
          <img src="https://mintcdn.com/etherscan/PrmCI8xWhLgr8YZ-/images/codex-cli-ask.png?fit=max&auto=format&n=PrmCI8xWhLgr8YZ-&q=85&s=cff3b26e226548a430f5563d9a2b1853" alt="Codex CLI giving a one-line summary of a USDT transfer via the Etherscan MCP" width="2350" height="1380" data-path="images/codex-cli-ask.png" />
        </Frame>

        To label the addresses involved with their Etherscan name tags, follow up with:

        ```text theme={null}
        Add the Etherscan name tags and labels for the sender and recipient
        ```

        This uses `get_address_labels`, a Pro tool that requires a [paid plan](https://etherscan.io/api/pricing).
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Example prompts

Ask in plain language and let the agent pick the tools. Copy one to try it:

```text theme={null}
Build a wallet snapshot for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum and Arbitrum: native balance, top token holdings, and the 10 most recent transactions.
```

```text theme={null}
Is 0xdAC17F958D2ee523a2206206994597C13D831ec7 verified? Summarize what the contract does and who deployed it.
```

```text theme={null}
Who are the top 10 holders of USDT (0xdAC17F958D2ee523a2206206994597C13D831ec7), and what share does each hold?
```

```text theme={null}
Trace transaction 0x<hash>: show its internal transfers and whether it succeeded.
```

```text theme={null}
Resolve vitalik.eth, show its balance, and include any name tags or labels Etherscan has for it.
```

## Tools

The server exposes 20 tools. The agent selects and calls them for you; you rarely name a tool yourself.

| Category             | Tool                             | Returns                                                                     |
| -------------------- | -------------------------------- | --------------------------------------------------------------------------- |
| Balances             | `get_native_balance`             | Native coin balance for an address                                          |
|                      | `get_token_balances`             | ERC-20 token holdings for an address, with USD values                       |
| Transactions         | `get_transactions`               | Normal (external) transactions an address signed                            |
|                      | `get_internal_transactions`      | Contract-triggered internal transfers for an address                        |
|                      | `get_transaction_by_hash`        | Full transaction details for a hash: sender, recipient, value, input, gas   |
|                      | `get_transaction_receipt`        | Receipt for a transaction: status, gas used, logs, and any created contract |
|                      | `get_transaction_status`         | Contract execution status for a transaction                                 |
|                      | `get_transaction_receipt_status` | Receipt status (success or fail) for a transaction                          |
| Transfers            | `get_token_transfers`            | Token transfers for an address or contract: ERC-20, ERC-721, or ERC-1155    |
| Tokens               | `get_token_info`                 | Project and metadata for a token contract                                   |
|                      | `get_token_top_holders`          | Largest holders of a token                                                  |
| Contracts            | `get_contract_source`            | Verified source code for a contract                                         |
|                      | `get_contract_abi`               | ABI for a verified contract                                                 |
|                      | `get_contract_creation`          | Deployer address and creation transaction for a contract                    |
| Logs                 | `get_logs`                       | Event logs filtered by contract address and topics over a block range       |
| Address intelligence | `get_address_labels`             | Etherscan name tag, labels, and attributes for an address                   |
|                      | `get_funded_by`                  | The address and transaction that first funded an address                    |
| Network              | `get_supported_chains`           | Supported chains and their chain IDs                                        |
|                      | `get_gas_oracle`                 | Current gas price recommendations                                           |
|                      | `get_block_by_timestamp`         | The block number at a given timestamp                                       |

## Good to know

* **Read-only.** Every tool reads public onchain data. Nothing signs or sends a transaction.
* **Every tool call uses your API quota.** Each MCP tool call makes one or more Etherscan API requests, and every request counts toward your API plan's rate limits, exactly like calling the API directly. See [Rate limits](/rate-limits).
* **Guard against prompt injection.** Enable your client's human-confirmation prompts, and be cautious when combining Etherscan with other MCP servers in the same session.
