The Erigon MCP (Model Context Protocol) server exposes Ethereum blockchain data to AI assistants like Claude Desktop via the MCP standard.
The MCP server runs inside the Erigon process with direct access to APIs.
It is enabled by default on 127.0.0.1:8553 (TCP).
# MCP server starts automatically
./build/bin/erigon --datadir=./data
# Disable it entirely
./build/bin/erigon --datadir=./data --mcp.disable
# Custom address/port (⚠️ 0.0.0.0 exposes the MCP server to all network
# interfaces — use only on trusted networks or behind a firewall)
./build/bin/erigon --datadir=./data --mcp.addr=0.0.0.0 --mcp.port=9000This mode uses SSE transport and provides full access to all tools including in-process Prometheus metrics.
A separate binary that connects to Erigon via JSON-RPC or direct DB access. Supports stdio transport (for Claude Desktop) and SSE.
make mcp
./build/bin/mcp --helpConnect to a running Erigon node via its HTTP JSON-RPC endpoint:
# Explicit URL:
./build/bin/mcp --rpc.url http://127.0.0.1:8545
# Shorthand for localhost:
./build/bin/mcp --port 8545
# With log access:
./build/bin/mcp --port 8545 --log.dir /data/erigon/logsOpen Erigon's MDBX database directly (like an external rpcdaemon). Requires either a running Erigon with gRPC private API, or read-only DB access.
# Connect to Erigon's gRPC API + read DB directly:
./build/bin/mcp --datadir /data/erigon --private.api.addr 127.0.0.1:9090
# Default private API address is 127.0.0.1:9090
./build/bin/mcp --datadir /data/erigonWhen no flags are provided, the server probes localhost ports 8545-8547 for a running JSON-RPC endpoint:
./build/bin/mcpReads MCP protocol messages from stdin and writes to stdout. This is the standard transport for Claude Desktop and similar tools.
./build/bin/mcp --port 8545Serves MCP over HTTP with SSE transport:
./build/bin/mcp --port 8545 --transport sse --sse.addr 127.0.0.1:8553Add to ~/.config/claude-desktop/config.json:
{
"mcpServers": {
"erigon": {
"command": "/path/to/build/bin/mcp",
"args": ["--port", "8545", "--log.dir", "/data/erigon/logs"]
}
}
}or
{
"mcpServers": {
"erigon": {
"command": "/path/to/build/bin/mcp",
"args": ["--datadir", "path/to/erigon/data"]
}
}
}for datadir mode.
eth_blockNumber, eth_getBlockByNumber, eth_getBlockByHash,
eth_getBalance, eth_getTransactionByHash, eth_getTransactionReceipt,
eth_getBlockReceipts, eth_getLogs, eth_getCode, eth_getStorageAt,
eth_getTransactionCount, eth_call, eth_estimateGas, eth_gasPrice,
eth_chainId, eth_syncing, eth_getProof, and more.
erigon_forks, erigon_blockNumber, erigon_getHeaderByNumber,
erigon_getHeaderByHash, erigon_getBlockByTimestamp,
erigon_getBalanceChangesInBlock, erigon_getLogsByHash,
erigon_getLogs, erigon_getBlockReceiptsByBlockHash, erigon_nodeInfo.
ots_getApiLevel, ots_getInternalOperations,
ots_searchTransactionsBefore, ots_searchTransactionsAfter,
ots_getBlockDetails, ots_getBlockTransactions, ots_hasCode,
ots_traceTransaction, ots_getTransactionError,
ots_getTransactionBySenderAndNonce, ots_getContractCreator.
logs_tail, logs_head, logs_grep, logs_stats — requires --log.dir
or --datadir to locate Erigon/torrent log files.
metrics_list, metrics_get — only available in embedded mode (inside Erigon).
In standalone mode, these return an informational message.
| Flag | Default | Description |
|---|---|---|
--rpc.url |
http://127.0.0.1:8545 |
Erigon JSON-RPC endpoint URL |
--port |
0 | JSON-RPC port shorthand |
--datadir |
Erigon data directory (enables direct DB mode) | |
--private.api.addr |
127.0.0.1:9090 |
gRPC private API (with --datadir) |
--transport |
stdio |
Transport: stdio or sse |
--sse.addr |
127.0.0.1:8553 |
SSE listen address |
--log.dir |
Log directory (overrides datadir detection) |