Skip to main content
Glama
blockscout-mcp-server

blockscout-mcp-server

by imelon2

blockscout-mcp-server

読み取り専用の stdio MCP サーバー。Blockscout REST API を通じて、AI エージェントにマルチチェーン EVM のオンチェーンデータ(アドレス、トランザクション、ブロック、ログ、トークン、NFT、コントラクトのソースコード)を提供します。

[!IMPORTANT] これは 公式の Blockscout MCP サーバー ではありません。個人開発者が独自に構築・保守しているカスタムサーバーであり、Blockscout チームとは無関係で、その承認も受けていません。

クイックスタート

npx が公開済みパッケージをダウンロードして実行します。手動でのインストールは不要です。任意のプロジェクトから動作し、CHAINS_FILE をそのプロジェクトのチェーン設定ファイルに指定します(相対パス ./chains.json はクライアントの作業ディレクトリ基準で解決されます)。

{
  "mcpServers": {
    "blockscout": {
      "command": "npx",
      "args": ["-y", "blockscout-mcp-server"],
      "env": {
        "CHAINS_FILE": "./chains.json",
        "ONLY_CHAINS_FILE": "true"
      }
    }
  }
}

チェーンレジストリと環境変数は起動時に一度だけ読み込まれます。設定やコードを変更した後は、MCP クライアント内でサーバーを再起動(再接続)してください。編集可能な .mcp.example.json が同梱されています。

Related MCP server: mcp-etherscan

対応チェーン

これらのチェーンは、同梱のスナップショット(src/chains/bundled.json)から追加設定なしで登録されます。任意のツールの chain 引数には、チェーン名(ethereum)または数値のチェーン ID(1)のどちらも指定できます。

get_chains_list ツールを呼び出すと、実行中のサーバーに実際に登録されているチェーンを確認できます。

カスタムチェーン

CHAINS_FILE に、追加のチェーン(または同梱チェーンの上書き)を記述した JSON ファイルを指定します。各エントリには、name、chainId、および Blockscout インスタンスの url が必要です:

[
  { "name": "my-l2", "chainId": 42, "url": "https://scan.my-l2.io" }
]

CHAINS_FILE が設定されているのにファイルが存在しない、または不正な形式の場合、サーバーは即座に終了します(フェイルファスト)。

ONLY_CHAINS_FILE=true を設定すると、CHAINS_FILE のチェーンのみが登録され、同梱スナップショットは完全に除外されます。この場合 CHAINS_FILE の設定が必須です(設定しないとチェーンが存在せず、サーバーはフェイルファストします)。デフォルト(false)では、同梱チェーンと CHAINS_FILE のチェーンがマージされます。

ローカル開発

MCP Inspector が開発依存関係として組み込まれているため、実際のクライアントにサーバーを接続しなくても、MCP ハンドシェイクを確認したり、ツールを手動で呼び出したりできます。

git clone https://github.com/imelon2/blockscout-mcp-server.git
cd blockscout-mcp-server
pnpm install
pnpm run inspect

pnpm run inspect は最初にビルドを実行し、その後 Inspector UI を開きます。stdio トランスポートを選択し、node dist/index.js を指定してください。2つのショートカット:

ライセンス

MIT

Available Tools

16 tools
direct_api_callCall a raw Blockscout API endpointA

Escape hatch: call any Blockscout REST v2 endpoint not covered by a dedicated tool. endpoint_path is relative to /api/v2 (e.g. "/addresses/0x.../counters"). Response is capped in size.

Inputs: chain (required), endpoint_path (required), cursor, query_params. Returns: data, notes, pagination, instructions, +1 more

get_address_infoGet address infoA

Get balance, type (account vs contract), and metadata for an address on a chain. Use this first when asked about a wallet or contract.

Inputs: chain (required), address (required). Returns: data, notes, pagination, instructions, +1 more

get_block_infoGet block infoA

Get details for a block by number or hash: timestamp, miner, gas used, and tx count.

Inputs: block (required), chain (required). Returns: data, notes, pagination, instructions, +1 more

get_block_numberGet latest block numberA

Get the latest (most recent) block height for a chain.

Inputs: chain (required). Returns: data, notes, pagination, instructions, +1 more

get_chains_listList supported chainsA

List all chains this server can query (bundled registry + any custom chains from CHAINS_FILE). Optionally filter by name or chain ID.

Inputs: filter. Returns: data, notes, pagination, instructions, +1 more

get_contract_abiGet contract ABIA

Get the ABI of a verified smart contract. Returns the ABI array only.

Inputs: chain (required), address (required). Returns: data, notes, pagination, instructions, +1 more

get_logsGet event logs by addressA

List event logs emitted by a contract/address. Large data fields are truncated. Paginated.

Inputs: chain (required), address (required), cursor. Returns: data, notes, pagination, instructions, +1 more

get_tokens_by_addressGet token balances by addressA

List ERC-20/721/1155 token balances held by an address. Paginated.

Inputs: chain (required), address (required), cursor. Returns: data, notes, pagination, instructions, +1 more

get_token_transfers_by_addressGet token transfers by addressA

List token transfer events involving an address (in and out). Paginated.

Inputs: chain (required), address (required), cursor. Returns: data, notes, pagination, instructions, +1 more

get_token_transfers_by_transactionGet token transfers by transactionC

List token transfers that occurred within a single transaction.

Inputs: hash (required), chain (required). Returns: data, notes, pagination, instructions, +1 more

get_transaction_infoGet transaction infoB

Get full details for a transaction by hash: status, value, gas, and decoded input.

Inputs: hash (required), chain (required). Returns: data, notes, pagination, instructions, +1 more

get_transactions_by_addressGet transactions by addressA

List native transactions involving an address (sent and received). Paginated.

Inputs: chain (required), address (required), cursor. Returns: data, notes, pagination, instructions, +1 more

inspect_contract_codeInspect contract source codeA

Get verified source code and compiler metadata for a smart contract.

Inputs: chain (required), address (required). Returns: data, notes, pagination, instructions, +1 more

lookup_token_by_symbolLook up token by symbolA

Search for tokens by symbol or name on a chain. Returns candidate tokens with their contract addresses.

Inputs: chain (required), symbol (required). Returns: data, notes, pagination, instructions, +1 more

nft_tokens_by_addressGet NFT tokens by addressA

List NFT (ERC-721/1155) tokens owned by an address. Paginated.

Inputs: chain (required), address (required), cursor. Returns: data, notes, pagination, instructions, +1 more

__unlock_blockchain_analysis__Unlock blockchain analysis (start here)A

MANDATORY FIRST STEP for AI agents. Returns usage rules and conventions for this server. Call this once before invoking any other tool.

Inputs: no named parameters. Returns: data, notes, pagination, instructions, +1 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 16 tools

    Disambiguation5/5

    Each tool targets a distinct blockchain data type or operation—address, block, transaction, token, contract, chain, logs, etc. No two tools have overlapping purposes; even the escape hatch `direct_api_call` is clearly separate from dedicated tools.

    Naming Consistency3/5

    The majority of tools follow a `get_<resource>` pattern, but there are exceptions like `lookup_token_by_symbol`, `inspect_contract_code`, `nft_tokens_by_address`, and the unusual `__unlock_blockchain_analysis__`. While still readable, this mix of conventions introduces inconsistency.

    Tool Count4/5

    With 16 tools covering core blockchain explorer functionality—addresses, blocks, transactions, tokens, contracts, chains—the count is well-scoped. It is slightly above the ideal 3-15 range but still reasonable for the domain.

    Completeness4/5

    The tool set covers the main blockchain query needs: address details, block info, transactions, token balances, transfers, contract ABI/source, logs, and chains list. Minor gaps like pending transactions or general search exist, but the escape hatch `direct_api_call` mitigates them effectively.

    Related MCP Connectors

    Related MCP Servers