Blockscout MCP Server

Blockscout MCP Server

A server that exposes blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol, enabling AI agents and tools to access and analyze blockchain information contextually.

Category
访问服务器

README

Blockscout MCP Server

smithery badge

The Model Context Protocol (MCP) is an open protocol designed to allow AI agents, IDEs, and automation tools to consume, query, and analyze structured data through context-aware APIs.

This server wraps Blockscout APIs and exposes blockchain data—balances, tokens, NFTs, contract metadata—via MCP so that AI agents and tools (like Claude, Cursor, or IDEs) can access and analyze it contextually.

Key Features:

  • Contextual blockchain data access for AI tools
  • Multi-chain support via getting Blockscout instance URLs from Chainscout
  • Custom instructions for MCP host to use the server
  • Supports MCP progress notifications for multi-step tool operations, allowing clients to track execution status
  • Enhanced User Experience: Provides periodic progress updates for long-running API queries (e.g., fetching extensive transaction histories) when requested by the client, improving responsiveness

Technical details

Refer to SPEC.md for the technical details.

Repository Structure

Refer to AGENTS.md for the repository structure.

Testing

Refer to TESTING.md for instructions on how to test the server locally using HTTP mode and curl commands.

Tool Descriptions

  1. __get_instructions__() - Provides custom instructions for the MCP host to use the server. This tool is required since the field instructions of the MCP server initialization response is not used by the MCP host so far (tested on Claude Desktop).
  2. get_chains_list() - Returns a list of all known chains.
  3. get_address_by_ens_name(name) - Converts an ENS domain name to its corresponding Ethereum address.
  4. lookup_token_by_symbol(chain_id, symbol) - Searches for token addresses by symbol or name, returning multiple potential matches.
  5. get_contract_abi(chain_id, address) - Retrieves the ABI (Application Binary Interface) for a smart contract.
  6. get_address_info(chain_id, address) - Gets comprehensive information about an address including balance, ENS association, contract status, and token details.
  7. get_tokens_by_address(chain_id, address, ...) - Returns detailed ERC20 token holdings for an address with enriched metadata and market data.
  8. get_latest_block(chain_id) - Returns the latest indexed block number and timestamp.
  9. get_transactions_by_address(chain_id, address, age_from, age_to, methods) - Gets transactions for an address within a specific time range with optional method filtering.
  10. get_token_transfers_by_address(chain_id, address, age_from, age_to, token) - Returns ERC-20 token transfers for an address within a specific time range.
  11. transaction_summary(chain_id, hash) - Provides human-readable transaction summaries using Blockscout Transaction Interpreter.
  12. nft_tokens_by_address(chain_id, address) - Retrieves NFT tokens owned by an address, grouped by collection.
  13. get_block_info(chain_id, number_or_hash) - Returns block information including timestamp, gas used, burnt fees, and transaction count.
  14. get_transaction_info(chain_id, hash) - Gets comprehensive transaction information with decoded input parameters and detailed token transfers.
  15. get_transaction_logs(chain_id, hash) - Returns transaction logs with decoded event data.
  16. get_address_logs(chain_id, address, ...) - Gets logs emitted by a specific address with decoded event data.

Example Prompts for AI Agents (to be added)

Placeholder: Practical examples of prompts for chats or IDEs to retrieve and analyze blockchain data via the MCP server will be added in this section.

Installation & Usage

Local Installation

Clone the repository and install dependencies:

git clone https://github.com/blockscout/mcp-server.git
cd mcp-server
uv pip install -e . # or `pip install -e .`

Running the Server

The server runs in stdio mode by default:

python -m blockscout_mcp_server

HTTP Streamable Mode:

To run the server in HTTP Streamable mode (stateless, JSON responses):

python -m blockscout_mcp_server --http

You can also specify the host and port for the HTTP server:

python -m blockscout_mcp_server --http --http-host 0.0.0.0 --http-port 8080

CLI Options:

  • --http: Enables HTTP Streamable mode.
  • --http-host TEXT: Host to bind the HTTP server to (default: 127.0.0.1).
  • --http-port INTEGER: Port for the HTTP server (default: 8000).

Building Docker Image Locally

Build the Docker image with the official tag:

docker build -t ghcr.io/blockscout/mcp-server:latest .

Pulling from GitHub Container Registry

Pull the pre-built image:

docker pull ghcr.io/blockscout/mcp-server:latest

Running with Docker

HTTP Streamable Mode:

To run the Docker container in HTTP mode with port mapping:

docker run --rm -p 8000:8000 ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --http-host 0.0.0.0

With custom port:

docker run --rm -p 8080:8080 ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --http-host 0.0.0.0 --http-port 8080

Note: When running in HTTP mode with Docker, use --http-host 0.0.0.0 to bind to all interfaces so the server is accessible from outside the container.

Stdio Mode: The default stdio mode is designed for use with MCP hosts/clients (like Claude Desktop, Cursor) and doesn't make sense to run directly with Docker without an MCP client managing the communication.

Configuring Claude Desktop

To use this MCP server with Claude Desktop:

  1. Open Claude Desktop and click on Settings

  2. Navigate to the "Developer" section

  3. Click "Edit Config"

  4. Open the file claude_desktop_config.json and configure the server:

    {
      "mcpServers": {
        "blockscout": {
          "command": "docker",
          "args": [
            "run", "--rm", "-i",
            "ghcr.io/blockscout/mcp-server:latest"
          ]
        }
      }
    }
    
  5. Save the file and restart Claude Desktop

  6. When chatting with Claude, you can now enable the Blockscout MCP Server to allow Claude to access blockchain data

License

This project is primarily distributed under the terms of the MIT license. See LICENSE for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选