This Model Context Protocol (MCP) server wraps Blockscout APIs and exposes blockchain data to AI agents, IDEs, and automation tools via context-aware APIs. It is intended to let clients consume, query, and analyze structured data through the MCP protocol.
🛠️ Key Features
MCP server for Blockscout
Wraps Blockscout APIs
Exposes blockchain data for context-aware API access
Tooling footprint: 16 tools
🚀 Use Cases
Querying and analyzing structured blockchain data
Integrating blockchain context into AI agents and IDE workflows
Using automation tools to consume Blockscout-derived information
⚡ Developer Benefits
Standardized MCP interface for consuming Blockscout-backed context
Enables context-aware queries and analysis via structured APIs
⚠️ Limitations
Public details provided are limited to the server identity, purpose, and tooling count; no tool-specific capabilities are listed in the available data.
Captured live from the server via tools/list.
__unlock_blockchain_analysis__
Initializes a Blockscout MCP session: returns server reference data, the
`blockscout-analysis` skill pointer, and the URI resolution rule. Call this tool
exactly once per session, before any other tool, and reuse its payload for the
rest of the session; do not call it again.
Get block information like timestamp, gas used, burnt fees, transaction count etc.
Can optionally include the list of transaction hashes contained in the block. Transaction hashes are omitted by default; request them only when you truly need them, because on high-traffic chains the list may exhaust the context.
Parameters4
chain_id
string
required
The ID of the blockchain
number_or_hash
string
required
Block number or hash
include_transactions
any
optional
If true, includes a list of transaction hashes from the block.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"number_or_hash": {
"description": "Block number or hash",
"title": "Number Or Hash",
"type": "string"
},
"include_transactions": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": false,
"description": "If true, includes a list of transaction hashes from the block.",
"title": "Include Transactions"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"number_or_hash"
],
"title": "get_block_infoArguments"
}
get_block_number
Retrieves the block number and timestamp for a specific date/time or the latest block.
Use when you need a block height for a specific point in time (e.g., "block at 2024-01-01")
or the current chain tip. If `datetime` is provided, finds the block immediately
preceding that time. If omitted, returns the latest indexed block.
Parameters3
chain_id
string
required
The ID of the blockchain
datetime
any
optional
The date and time (ISO 8601 format, e.g. 2025-05-22T23:00:00.00Z) to find the block for. If omitted, returns the latest block.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"datetime": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The date and time (ISO 8601 format, e.g. 2025-05-22T23:00:00.00Z) to find the block for. If omitted, returns the latest block.",
"title": "Datetime"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id"
],
"title": "get_block_numberArguments"
}
get_address_by_ens_name
Useful for when you need to convert an ENS domain name (e.g. "blockscout.eth")
to its corresponding Ethereum address.
Retrieves native currency transfers and smart contract interactions (calls, internal txs) for an address.
**EXCLUDES TOKEN TRANSFERS**: Filters out direct token balance changes (ERC-20, etc.). You'll see calls *to* token contracts, but not the `Transfer` events. For token history, use `get_token_transfers_by_address`.
A single tx can have multiple records from internal calls.
Requires an `age_from` date to scope results for performance and relevance.
**SUPPORTS PAGINATION**: If response includes 'pagination' field, use the provided next_call to get additional pages.
Parameters7
chain_id
string
required
The ID of the blockchain
address
string
required
Address which either sender or receiver of the transaction
age_from
string
required
Start date and time (e.g 2025-05-22T23:00:00.00Z). Alone, returns all transactions to/from the address since this date.
age_to
any
optional
End date and time (e.g 2025-05-22T22:30:00.00Z). Adding this bounds the upper end of the date range started by `age_from`.
methods
any
optional
A method signature to filter transactions by (e.g 0x304e6ade). Filters the (optionally date-bounded) results to a specific method signature.
cursor
any
optional
The pagination cursor from a previous response to get the next page of results.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "Address which either sender or receiver of the transaction",
"title": "Address",
"type": "string"
},
"age_from": {
"description": "Start date and time (e.g 2025-05-22T23:00:00.00Z). Alone, returns all transactions to/from the address since this date.",
"title": "Age From",
"type": "string"
},
"age_to": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "End date and time (e.g 2025-05-22T22:30:00.00Z). Adding this bounds the upper end of the date range started by `age_from`.",
"title": "Age To"
},
"methods": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "A method signature to filter transactions by (e.g 0x304e6ade). Filters the (optionally date-bounded) results to a specific method signature.",
"title": "Methods"
},
"cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pagination cursor from a previous response to get the next page of results.",
"title": "Cursor"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address",
"age_from"
],
"title": "get_transactions_by_addressArguments"
}
get_token_transfers_by_address
Get ERC-20 token transfers for an address within a specific time range.
**SUPPORTS PAGINATION**: If response includes 'pagination' field, use the provided next_call to get additional pages.
Parameters7
chain_id
string
required
The ID of the blockchain
address
string
required
Address which either transfer initiator or transfer receiver
age_from
string
required
Start date and time (e.g 2025-05-22T23:00:00.00Z). Alone, returns all ERC-20 transfers to/from the address since this date.
age_to
any
optional
End date and time (e.g 2025-05-22T22:30:00.00Z). Adding this bounds the upper end of the date range started by `age_from`; if omitted, transfers up to the current time are returned.
token
any
optional
An ERC-20 token contract address to restrict results to a single token. If omitted, returns transfers of all tokens.
cursor
any
optional
The pagination cursor from a previous response to get the next page of results.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "Address which either transfer initiator or transfer receiver",
"title": "Address",
"type": "string"
},
"age_from": {
"description": "Start date and time (e.g 2025-05-22T23:00:00.00Z). Alone, returns all ERC-20 transfers to/from the address since this date.",
"title": "Age From",
"type": "string"
},
"age_to": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "End date and time (e.g 2025-05-22T22:30:00.00Z). Adding this bounds the upper end of the date range started by `age_from`; if omitted, transfers up to the current time are returned.",
"title": "Age To"
},
"token": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "An ERC-20 token contract address to restrict results to a single token. If omitted, returns transfers of all tokens.",
"title": "Token"
},
"cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pagination cursor from a previous response to get the next page of results.",
"title": "Cursor"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address",
"age_from"
],
"title": "get_token_transfers_by_addressArguments"
}
lookup_token_by_symbol
Search for token addresses by symbol or name. Returns multiple potential
matches based on symbol or token name similarity. Only the first
7 matches from the Blockscout API are returned.
Parameters3
chain_id
string
required
The ID of the blockchain
symbol
string
required
Token symbol or name to search for
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"symbol": {
"description": "Token symbol or name to search for",
"title": "Symbol",
"type": "string"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"symbol"
],
"title": "lookup_token_by_symbolArguments"
}
get_contract_abi
Get smart contract ABI (Application Binary Interface).
An ABI defines all functions, events, their parameters, and return types. The ABI is required to format function calls or interpret contract data.
Inspects a verified contract's source code or metadata.
Parameters4
chain_id
string
required
The ID of the blockchain.
address
string
required
The address of the smart contract.
file_name
any
optional
The name of the source file to inspect. If omitted, returns contract metadata and the list of source files.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain.",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "The address of the smart contract.",
"title": "Address",
"type": "string"
},
"file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The name of the source file to inspect. If omitted, returns contract metadata and the list of source files.",
"title": "File Name"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address"
],
"title": "inspect_contract_codeArguments"
}
read_contract
Calls a smart contract function (view/pure, or non-view/pure simulated via eth_call) and returns the
decoded result.
This tool provides a direct way to query the state of a smart contract.
Example:
To check the USDT balance of an address on Ethereum Mainnet, you would use the following arguments:
{
"tool_name": "read_contract",
"params": {
"chain_id": "1",
"address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"abi": {
"constant": true,
"inputs": [{"name": "_owner", "type": "address"}],
"name": "balanceOf",
"outputs": [{"name": "balance", "type": "uint256"}],
"payable": false,
"stateMutability": "view",
"type": "function"
},
"function_name": "balanceOf",
"args": "["0xF977814e90dA44bFA03b6295A0616a897441aceC"]"
}
}
Parameters7
chain_id
string
required
The ID of the blockchain
address
string
required
Smart contract address
abi
object
required
The JSON ABI for the specific function being called. This should be a dictionary that defines the function's name, inputs, and outputs. The function ABI can be obtained using the `get_contract_abi` tool.
function_name
string
required
The symbolic name of the function to be called. This must match the `name` field in the provided ABI.
args
string
optional
A JSON string containing an array of arguments. Example: "["0xabc..."]" for a single address argument, or "[]" for no arguments. Order and types must match ABI inputs. Addresses: use 0x-prefixed strings; Numbers: prefer integers (not quoted); numeric strings like "1" are also accepted and coerced to integers. Bytes: keep as 0x-hex strings.
block
any
optional
The block identifier to read the contract state from. Can be a block number (e.g., 19000000) or a string tag (e.g., 'latest'). Defaults to 'latest'.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "Smart contract address",
"title": "Address",
"type": "string"
},
"abi": {
"additionalProperties": true,
"description": "The JSON ABI for the specific function being called. This should be a dictionary that defines the function's name, inputs, and outputs. The function ABI can be obtained using the `get_contract_abi` tool.",
"title": "Abi",
"type": "object"
},
"function_name": {
"description": "The symbolic name of the function to be called. This must match the `name` field in the provided ABI.",
"title": "Function Name",
"type": "string"
},
"args": {
"default": "[]",
"description": "A JSON string containing an array of arguments. Example: \"[\"0xabc...\"]\" for a single address argument, or \"[]\" for no arguments. Order and types must match ABI inputs. Addresses: use 0x-prefixed strings; Numbers: prefer integers (not quoted); numeric strings like \"1\" are also accepted and coerced to integers. Bytes: keep as 0x-hex strings.",
"title": "Args",
"type": "string"
},
"block": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
],
"default": "latest",
"description": "The block identifier to read the contract state from. Can be a block number (e.g., 19000000) or a string tag (e.g., 'latest'). Defaults to 'latest'.",
"title": "Block"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address",
"abi",
"function_name"
],
"title": "read_contractArguments"
}
get_address_info
Get comprehensive information about an address, including:
- Address existence check
- Native token (ETH) balance (provided as is, without adjusting by decimals)
- First transaction details (block number and timestamp) for age calculation
- ENS name association (if any)
- Contract status (whether the address is a contract, whether it is verified)
- Proxy contract information (if applicable): determines if a smart contract is a proxy contract (which forwards calls to implementation contracts), including proxy type and implementation addresses
- Token details (if the contract is a token): name, symbol, decimals, total supply, etc.
Essential for address analysis, contract investigation, token research, and DeFi protocol analysis.
Parameters3
chain_id
string
required
The ID of the blockchain
address
string
required
Address to get information about
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "Address to get information about",
"title": "Address",
"type": "string"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address"
],
"title": "get_address_infoArguments"
}
get_tokens_by_address
Get comprehensive ERC20 token holdings for an address with enriched metadata and market data.
Returns detailed token information including contract details (name, symbol, decimals), market metrics (exchange rate, market cap, volume), holders count, and actual balance (provided as is, without adjusting by decimals).
Essential for portfolio analysis, wallet auditing, and DeFi position tracking.
**SUPPORTS PAGINATION**: If response includes 'pagination' field, use the provided next_call to get additional pages.
Parameters4
chain_id
string
required
The ID of the blockchain
address
string
required
Wallet address
cursor
any
optional
The pagination cursor from a previous response to get the next page of results.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "Wallet address",
"title": "Address",
"type": "string"
},
"cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pagination cursor from a previous response to get the next page of results.",
"title": "Cursor"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address"
],
"title": "get_tokens_by_addressArguments"
}
nft_tokens_by_address
Retrieve NFT tokens (ERC-721, ERC-404, ERC-1155) owned by an address, grouped by collection.
Provides collection details (type, address, name, symbol, total supply, holder count) and individual token instance data (ID, name, description, external URL, metadata attributes).
Essential for a detailed overview of an address's digital collectibles and their associated collection data.
**SUPPORTS PAGINATION**: If response includes 'pagination' field, use the provided next_call to get additional pages.
Parameters4
chain_id
string
required
The ID of the blockchain
address
string
required
NFT owner address
cursor
any
optional
The pagination cursor from a previous response to get the next page of results.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"address": {
"description": "NFT owner address",
"title": "Address",
"type": "string"
},
"cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pagination cursor from a previous response to get the next page of results.",
"title": "Cursor"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"address"
],
"title": "nft_tokens_by_addressArguments"
}
get_transaction_info
Get comprehensive transaction information.
Unlike standard eth_getTransactionByHash, this tool returns enriched data including decoded input parameters, detailed token transfers with token metadata, transaction fee breakdown (priority fees, burnt fees) and categorized transaction types.
By default, the raw transaction input is omitted if a decoded version is available to save context; request it with `include_raw_input=True` only when you truly need the raw hex data.
Essential for transaction analysis, debugging smart contract interactions, tracking DeFi operations.
Get supported blockchain chains with their chain IDs.
Ethereum Mainnet is `chain_id` `1`; use this tool to resolve any other chain.
Use this when another tool needs a supported `chain_id` and only the chain name,
ecosystem, or native currency is known. Prefer a narrow `query` to avoid returning
the full registry to the agent. Do not rely on partial numeric chain ID queries such
as `1`, because matching is substring-based and may return many chains.
Parameters2
query
any
optional
Optional case-insensitive substring filter applied to chain name, chain ID, native currency, and ecosystem. Prefer narrow text terms over partial numeric chain IDs because matching is substring-based.
Call a raw Blockscout API endpoint for advanced or chain-specific data.
Before the first call to this tool in a session, read
`blockscout-mcp://skill/SKILL.md` (the operating rules), then
`blockscout-mcp://skill/references/blockscout-api-index.md` (the authoritative
index of callable endpoints); skip both reads only if this skill content is
already in context. Recalled Blockscout API knowledge is not a substitute:
endpoint paths, parameters, and response shapes vary across Blockscout
versions and per-chain deployments.
Supports POST requests with a JSON body for endpoints like JSON RPC.
**SUPPORTS PAGINATION**: If response includes 'pagination' field,
use the provided next_call to get additional pages (GET only).
Parameters7
chain_id
string
required
The ID of the blockchain
endpoint_path
string
required
The Blockscout API path to call (e.g., '/api/v2/stats'); do not include query strings — pass all query parameters via query_params to avoid double-encoding.
query_params
any
optional
Optional query parameters forwarded to the Blockscout API.
cursor
any
optional
The pagination cursor from a previous response to get the next page of results.
method
string
optional
HTTP method used for the upstream call. Use POST with json_body.
json_body
any
optional
JSON request body for POST requests.
session_id
any
optional
Opaque session identifier.
Raw schema
{
"type": "object",
"properties": {
"chain_id": {
"description": "The ID of the blockchain",
"title": "Chain Id",
"type": "string"
},
"endpoint_path": {
"description": "The Blockscout API path to call (e.g., '/api/v2/stats'); do not include query strings — pass all query parameters via query_params to avoid double-encoding.",
"title": "Endpoint Path",
"type": "string"
},
"query_params": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "Optional query parameters forwarded to the Blockscout API.",
"title": "Query Params"
},
"cursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The pagination cursor from a previous response to get the next page of results.",
"title": "Cursor"
},
"method": {
"default": "GET",
"description": "HTTP method used for the upstream call. Use POST with json_body.",
"enum": [
"GET",
"POST"
],
"title": "Method",
"type": "string"
},
"json_body": {
"anyOf": [
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "JSON request body for POST requests.",
"title": "Json Body"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque session identifier.",
"title": "Session Id"
}
},
"required": [
"chain_id",
"endpoint_path"
],
"title": "direct_api_callArguments"
}
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 Blockscout PRO API configuration with Chainscout metadata enrichment
Versioned REST API: Provides a standard, web-friendly interface to all MCP tools. See API.md for full documentation.
Custom instructions for MCP host to use the server
Intelligent context optimization to conserve LLM tokens while preserving data accessibility
Smart response slicing with configurable page sizes to prevent context overflow
Opaque cursor pagination using Base64URL-encoded strings instead of complex parameters
Automatic truncation of large data fields with clear indicators and access guidance
Standardized ToolResponse model with structured JSON responses and follow-up instructions
Enhanced observability with MCP progress notifications and periodic updates for long-running operations
Enhanced Analysis with Agent Skills
For more powerful and efficient blockchain analysis, install the Blockscout Analysis skill from the agent-skills repository. This skill provides AI agents with structured guidance for execution strategies, response handling, security best practices, and workflow orchestration.
Learn more: See the agent-skills README for full capabilities and installation instructions.
Configuring MCP Clients
Blockscout PRO API Key
Configuring the Blockscout MCP server with an AI agent requires a Blockscout PRO API key. Most of the data tools route their requests through the authenticated Blockscout PRO API gateway, so without a valid key those tools fail fast before making any upstream request.
To obtain a key, register on the Blockscout Developer Portal (the free tier does not require a credit card) and generate an API key; keys are prefixed proapi_. Then supply it when configuring your client, as shown in the sections below.
Claude Setup (Web, Desktop, Cowork) - Recommended
The easiest way to use the Blockscout MCP server with Claude is the official hosted server: a native, managed installation experience with automatic updates and nothing to run yourself. Add it as a Custom Connector with your own PRO API key. Claude sends the key on every request in an x-api-key header, which the server accepts as an alias for its Blockscout-MCP-Pro-Api-Key header.
Open Claude and go to Customize > Connectors. On Team and Enterprise plans an organization Owner does this under Organization settings > Connectors.
Click Add custom connector. Set the name to Blockscout and the URL to https://mcp.blockscout.com/mcp, then continue.
Leave Authentication as None (Claude detects it). A warning that the connector has no credentials is expected: the key is supplied in the next step.
Open Request headers, select x-api-key from the list, and paste your PRO API key as the value. Pick exactly this name; the server does not read the other similar-looking names in the list.
Click Add.
Note: The Request headers section is in beta and is not yet available to every organization. If your dialog does not show it, use the Connectors Directory below.
Note: On Team and Enterprise plans the key is entered once by the Owner and shared by the whole organization. Authentication settings cannot be edited after a connector is added: to change the key, remove the connector and add it again.
Using Claude Connectors Directory
If the Custom Connector dialog has no Request headers section, install the Blockscout connector from the official Anthropic Connectors Directory. It connects to the same hosted server but uses a shared access key.
After running this command, Blockscout will be available as an MCP server in Claude Code, allowing you to access and analyze blockchain data directly from your coding environment.
Edit ~/.codex/config.toml to add the PRO API key header and enable the streamable-HTTP MCP client (required for remote MCP servers to connect). The resulting configuration should look like this:
Add the server to your Cursor MCP configuration — either the project-level .cursor/mcp.json or the global ~/.cursor/mcp.json — supplying your PRO API key via the Blockscout-MCP-Pro-Api-Key header:
Refer to TESTING.md for comprehensive instructions on running both unit and integration tests.
Tool Descriptions
__unlock_blockchain_analysis__() - Initializes a Blockscout MCP session: returns server reference data, the blockscout-analysis skill pointer, and the URI resolution rule. Call it once per session, before any other tool.
get_chains_list(query=None) - Returns a list of supported chains, with optional filtering by name, chain ID, native currency, or ecosystem.
get_address_by_ens_name(name) - Converts an ENS domain name to its corresponding Ethereum address.
lookup_token_by_symbol(chain_id, symbol) - Searches for token addresses by symbol or name, returning multiple potential matches.
get_contract_abi(chain_id, address) - Retrieves the ABI (Application Binary Interface) for a smart contract.
inspect_contract_code(chain_id, address, file_name=None) - Allows getting the source files of verified contracts.
get_address_info(chain_id, address) - Gets comprehensive information about an address including balance, ENS association, contract status, token details, and public tags.
get_tokens_by_address(chain_id, address, cursor=None) - Returns detailed ERC20 token holdings for an address with enriched metadata and market data.
get_block_number(chain_id, [datetime]) - Retrieves the block number and timestamp for a specific date/time or the latest block.
get_transactions_by_address(chain_id, address, age_from, age_to, methods, cursor=None) - Gets transactions for an address within a specific time range with optional method filtering.
get_token_transfers_by_address(chain_id, address, age_from, age_to, token, cursor=None) - Returns ERC-20 token transfers for an address within a specific time range.
nft_tokens_by_address(chain_id, address, cursor=None) - Retrieves NFT tokens owned by an address, grouped by collection.
get_block_info(chain_id, number_or_hash, include_transactions=False) - Returns block information including timestamp, gas used, burnt fees, and transaction count. Can optionally include a list of transaction hashes.
get_transaction_info(chain_id, hash, include_raw_input=False) - Gets comprehensive transaction information with decoded input parameters and detailed token transfers.
read_contract(chain_id, address, abi, function_name, args='[]', block='latest') - Executes a read-only smart contract function and returns its result. The abi argument is a JSON object describing the specific function's signature.
direct_api_call(chain_id, endpoint_path, query_params=None, cursor=None, method='GET', json_body=None) - Calls a raw Blockscout API endpoint for advanced or chain-specific data. Supports GET (default) and POST requests with JSON body.
Example Prompts for AI Agents
plaintext
Is any approval set for OP token on Optimism chain by `zeaver.eth`?
plaintext
Calculate the total gas fees paid on Ethereum by address `0xcafe...cafe` in May 2025.
plaintext
Which 10 most recent logs were emitted by `0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7`
before `Nov 08 2024 04:21:35 AM (-06:00 UTC)`?
plaintext
Tell me more about the transaction `0xf8a55721f7e2dcf85690aaf81519f7bc820bc58a878fa5f81b12aef5ccda0efb`
on Redstone rollup.
plaintext
Is there any blacklisting functionality of USDT token on Arbitrum One?
plaintext
What is the latest block on Gnosis Chain and who is the block minter?
Were any funds moved from this minter recently?
plaintext
When the most recent reward distribution of Kinto token was made to the wallet
`0x7D467D99028199D99B1c91850C4dea0c82aDDF52` in Kinto chain?
plaintext
Which methods of `0x1c479675ad559DC151F6Ec7ed3FbF8ceE79582B6` on the Ethereum
mainnet could emit `SequencerBatchDelivered`?
plaintext
What is the most recent executed cross-chain message sent from the Arbitrum Sepolia
rollup to the base layer?
Development & Deployment
Local Installation
Clone the repository and install dependencies:
bash
git clone https://github.com/blockscout/mcp-server.git
cd mcp-server
uv pip install -e . # or `pip install -e .`
To customize the leading part of the User-Agent header used for RPC requests,
set the BLOCKSCOUT_MCP_USER_AGENT environment variable (defaults to
"Blockscout MCP"). The server version is appended automatically.
Providing the PRO API Key to the Server
When you run the server yourself, provide the Blockscout PRO API key through the BLOCKSCOUT_PRO_API_KEY environment variable — exported in your shell or placed in a gitignored .env file in the project root. This enables all data access, public-tag enrichment, and contract reads. Never commit the key or embed it in a client-shipped binary; when running via Docker, pass it at runtime (e.g. -e BLOCKSCOUT_PRO_API_KEY=...) rather than baking it into the image.
Client-supplied keys (HTTP transports). When the server runs in HTTP mode, a client can supply its own PRO API key in a request header — by default Blockscout-MCP-Pro-Api-Key, configurable via BLOCKSCOUT_PRO_API_KEY_HEADER (set it to an empty string to disable client-supplied keys entirely). The server also reads the key from an x-api-key header, for clients whose header names are restricted to a fixed list (for example Claude Custom Connectors). The configured header wins when both are present; x-api-key is consulted only when the configured header is missing or blank, and disabling client-supplied keys disables it too. This works the same way for both HTTP transports — MCP-over-HTTP tool calls and the REST API. A client-supplied key takes precedence over BLOCKSCOUT_PRO_API_KEY for that request; if the client sends no key, the server falls back to its own configured key; if neither is present, the request fails with the not-configured error. A client key that is present but malformed fails any request that needs the PRO API with no fallback (the server never silently uses its own key in place of a bad client key); tools that don't use the PRO API are unaffected. This makes it possible to run a shared HTTP server where each client authenticates with its own key.
Low-credit warning. Access to the PRO API is metered in credits. When the remaining balance reported by the API drops below a configurable threshold, every data tool appends an advisory note to its response, prompting operators to top up so PRO API access stays ready for continued high-volume usage. The threshold is set via BLOCKSCOUT_PRO_API_LOW_CREDITS_THRESHOLD (default 5000 credits; set to 0 to disable the note). The note fires for any balance below the threshold, including zero and negative balances.
PRO API key requirement notice.BLOCKSCOUT_PRO_API_KEY_REQUIRED_NOTICE holds an operator-configured notice that the server appends as the last entry of the notes field of tool responses whose requests did not carry the client's own (well-formed) PRO API key. It exists to announce the official public server's migration to mandatory client-supplied keys, so only the official deployment is expected to set it. When the variable is unset or empty (the default), the feature is completely off. Community and self-hosted operators should leave it empty — in particular in stdio mode, where you configure BLOCKSCOUT_PRO_API_KEY yourself and no request header can carry a client key, the notice would only repeat a migration message that does not apply to your deployment.
Running the Server
The server runs in stdio mode by default:
bash
python -m blockscout_mcp_server
HTTP Mode (MCP only):
To run the server in HTTP Streamable mode (stateless, SSE responses by default):
bash
python -m blockscout_mcp_server --http
You can also specify the host and port for the HTTP server:
Note: This disables Server-Sent Events (SSE) and progress notifications. Only use this for local testing and debugging.
Tunneling with Ngrok (Development Mode):
The Python MCP SDK enforces DNS rebinding protection, which blocks requests from ngrok tunnels by default. To enable
tunneling for development and testing:
Start an ngrok tunnel to your local server:
bash
ngrok http 8000
Configure the allowed host and origin using your ngrok URL:
Note: These settings are primarily for development use. When these variables are not set, DNS rebinding protection
is automatically determined by the server's bind host: enabled for localhost, disabled for non-localhost (e.g.,
0.0.0.0). If your Host header includes a non-standard port, use the :* wildcard suffix (e.g.,
"example.com:*") or specify the exact host:port value.
Session metering limits how many tool calls a caller without a client-supplied PRO API key may make per session identifier issued by __unlock_blockchain_analysis__. It is off by default. Enabling it means setting a signing secret (at least 32 bytes — generate it, don't invent it), and it requires HTTP mode and a server-side PRO API key (metered calls are served upstream on it), plus a persistent volume for the session database. Generate the secret once and store it durably (a secret manager, or persistent environment configuration); every restart and redeploy must pass the same stored value:
bash
# Once, not per start: generate the secret and keep it.
BLOCKSCOUT_SESSION_SECRET="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
docker run --rm -p 8000:8000 \
-v blockscout-mcp-sessions:/data \
-e BLOCKSCOUT_SESSION_SECRET="$BLOCKSCOUT_SESSION_SECRET" \
-e BLOCKSCOUT_SESSION_DB_PATH=/data/sessions.db \
-e BLOCKSCOUT_PRO_API_KEY=proapi_your_key_here \
ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --http-host 0.0.0.0
Most deployments do not need any of this: leave BLOCKSCOUT_SESSION_SECRET unset (the default) and no volume is required. Losing the volume or rotating the secret invalidates live session identifiers by design; the exposure is bounded by the configured TTL. Re-generating the secret inline on every docker run is the accidental form of that rotation — it wipes all live identifiers on each restart even though the database volume survived, so never embed the generation command in the start command. Restoring an older copy of the database revives the budgets it recorded — after a historical restore, rotate the secret unless that is intended. Optional knobs: BLOCKSCOUT_SESSION_MCP_MAX_CALLS and BLOCKSCOUT_SESSION_REST_MAX_CALLS (per-surface call ceilings over one shared per-identifier counter; both default 5; 0 closes metered access on that surface while leaving identifier issuance and get_chains_list navigation open), BLOCKSCOUT_SESSION_TTL_SECONDS (default 900), and BLOCKSCOUT_SESSION_SWEEP_INTERVAL_SECONDS (how often expired session rows are cleaned up; default: once per TTL).
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.
Testing with Claude Desktop
Use MCP bundle to test the server with Claude Desktop.
Double-click to open the blockscout-mcp-dev.mcpb file to automatically install the bundle.
Configure the Blockscout MCP Server URL when prompted (default: http://127.0.0.1:8000/mcp)
Privacy and Anonymous Telemetry
To help us improve the Blockscout MCP Server, community-run instances of the server collect anonymous usage data by default. This helps us understand which tools are most popular and guides our development efforts.
What we collect:
The name of the tool being called (e.g., get_block_number).
The parameters provided to the tool (the session_id parameter is masked to a placeholder before transmission).
The version of the Blockscout MCP Server being used.
A one-way, non-reversible hash (SHA-256) of the PRO API key available to authorize the request, when one is present. This is a derived fingerprint only — the key itself is never transmitted and cannot be recovered from the hash.
What we DO NOT collect:
We do not collect any personal data, IP addresses (the central server uses the sender's IP for geolocation via Mixpanel and then discards it), or secrets and private keys themselves. The PRO API key in particular is never transmitted — only its one-way, non-reversible fingerprint described above, from which the key cannot be recovered.
How to Opt-Out
You can disable this feature at any time by setting the following environment variable: