ethereum
Ethereum JSON-RPC MCP
claude mcp add --transport stdio john0n1-ethereum-mcp node server.js \ --env PORT="Optional: Server port (default: 3000)" \ --env GETH_URL="URL to your Geth/Nethermind node's JSON-RPC endpoint" \ --env ALLOW_SEND_RAW_TX="Optional: Set to 1/true to enable transaction broadcasting"
How to use
This MCP server exposes an Ethereum JSON-RPC endpoint via an Express-based Node.js proxy. It registers a suite of MCP tools that map common Ethereum RPC methods (such as eth_blockNumber, eth_getBalance, eth_sendRawTransaction, and eth_call) into MCP-accessible tools, with validation and aliases to simplify usage. The server also provides passthrough support (eth_callRaw) for methods not explicitly defined and includes health and discovery endpoints at /, /health, and /mcp. To use it, configure a GETH_URL to point to your Ethereum node and start the server. You can then query the MCP interface to list available tools and call specific tools by name, or interact with the underlying JSON-RPC API through the provided endpoints. Block numbers, balances, and gas prices are normalized to decimal where applicable, and you can enable raw transaction submissions by setting ALLOW_SEND_RAW_TX=1.
How to install
Prerequisites:
- Node.js v18+ installed
- npm or pnpm installed
Step-by-step:
-
Clone the repository git clone https://github.com/John0n1/ethereum-mcp.git cd ethereum-mcp
-
Install dependencies npm install
-
Create and configure environment
-
Copy the example env file and edit GETH_URL
PowerShell
Copy-Item example.env .env
macOS/Linux
cp example.env .env
-
Edit .env to set GETH_URL (and optional PORT and ALLOW_SEND_RAW_TX)
-
-
Start the server npm start
-
Verify the server is running curl http://localhost:3000/health?upstream=1
-
Interact with MCP tools List tools: curl -s http://localhost:3000/mcp -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Call a tool (example: getBlockNumber) curl -s http://localhost:3000/mcp -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"getBlockNumber","arguments":{}}}'
Additional notes
Tips and common considerations:
- Ensure GETH_URL points to a reachable Ethereum node with JSON-RPC enabled (and appropriate http/ws flags if needed).
- If you need to broadcast transactions, set ALLOW_SEND_RAW_TX=1; otherwise, eth_sendRawTransaction calls may be rejected.
- The MCP tools offer aliases for convenience (e.g., eth_blockNumber as getBlockNumber).
- The /health endpoint can optionally verify upstream connectivity with ?upstream=1; use this to monitor upstream availability.
- If you run behind a reverse proxy, remember to configure CORS and any required headers for your environment.
Related MCP Servers
evm
MCP server that provides LLMs with tools for interacting with EVM networks
mcp-nodejs-debugger
🐞 MCP Node.js debugger
midnight
Midnight MCP server giving AI assistants access to Midnight blockchain — search contracts, analyze code, explore docs
mcp -weather-js
Simple Weather MCP Server Example
web3 -hub
The definitive open-source registry of Model Context Protocol (MCP) servers for Web3, blockchain, and decentralized applications. 130+ chains, DeFi, NFTs, analytics, and identity tools
mcp-node-omnibus
A comprehensive Model Context Protocol (MCP) server that provides advanced Node.js development tooling and automation capabilities.