npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

geth-mcp-server

v1.0.1

Published

A Model Context Protocol (MCP) server for interacting with Geth blockchain nodes via stdio transport

Downloads

4

Readme

Geth MCP Server

A Model Context Protocol (MCP) server for interacting with Geth blockchain nodes. This is a pure MCP server that communicates via stdio transport without requiring any port listeners.

Features

  • 10 MCP Tools: Comprehensive blockchain interaction tools
  • Pure MCP Server: Runs via stdio transport (no HTTP server or ports)
  • Web3 Integration: Direct connection to your local Geth node at http://localhost:8545
  • BigInt Support: Proper handling of blockchain data with BigInt values
  • Comprehensive Error Handling: Robust error handling for all blockchain operations

Available MCP Tools

  1. get_block_info: Get detailed information about a specific block by number or hash
  2. get_account_balance: Check the balance of an Ethereum account
  3. get_transaction_info: Get comprehensive transaction details
  4. get_latest_block: Fetch information about the latest block
  5. get_network_info: Get network status and node information
  6. get_gas_price: Check current gas prices
  7. get_storage_at: Get storage values from specific positions in smart contracts
  8. get_logs: Fetch event logs based on filter criteria
  9. get_code: Get the bytecode of contracts at specific addresses
  10. estimate_gas: Estimate gas required for transactions with cost calculations

Installation

Option 1: Install from npm (Recommended)

# Install globally
npm install -g geth-mcp-server

# Or install locally in your project
npm install geth-mcp-server

Option 2: Build from Source

git clone https://github.com/your-username/geth-mcp-server.git
cd geth-mcp-server
npm install
npm run build

Usage

Using the npm Package

After installing via npm, you can use the server directly:

# If installed globally
geth-mcp-server

# If installed locally
npx geth-mcp-server

Using from Source

# Development mode
npm run dev

# Production mode
npm run build
npm start

MCP Configuration

For npm Installation

Use this configuration in your MCP client (like Claude Desktop):

{
  "mcpServers": {
    "geth-mcp-server": {
      "command": "npx",
      "args": ["geth-mcp-server"],
      "env": {
        "GETH_URL": "http://localhost:8545"
      }
    }
  }
}

For Global npm Installation

{
  "mcpServers": {
    "geth-mcp-server": {
      "command": "geth-mcp-server",
      "args": [],
      "env": {
        "GETH_URL": "http://localhost:8545"
      }
    }
  }
}

For Source Installation

{
  "mcpServers": {
    "geth-mcp-server": {
      "command": "node",
      "args": ["dist/index.js"],
      "cwd": "/path/to/geth-mcp-server",
      "env": {
        "GETH_URL": "http://localhost:8545"
      }
    }
  }
}

Configuration

  • Geth URL: http://localhost:8545 (configured via GETH_URL environment variable)
  • Transport: stdio only (no HTTP server or ports)

MCP Tool Examples

Get Latest Block

{
  "tool": "get_latest_block",
  "arguments": {}
}

Check Account Balance

{
  "tool": "get_account_balance",
  "arguments": {
    "address": "0x742d35cc6Cc6ab4b3569bB50915BF3a3bF6dEc76"
  }
}

Get Block Info

{
  "tool": "get_block_info",
  "arguments": {
    "blockIdentifier": "latest"
  }
}

Get Contract Storage

{
  "tool": "get_storage_at",
  "arguments": {
    "address": "0x742d35cc6Cc6ab4b3569bB50915BF3a3bF6dEc76",
    "position": "0x0"
  }
}

Get Event Logs

{
  "tool": "get_logs",
  "arguments": {
    "fromBlock": "latest",
    "toBlock": "latest",
    "address": "0x742d35cc6Cc6ab4b3569bB50915BF3a3bF6dEc76"
  }
}

Estimate Gas

{
  "tool": "estimate_gas",
  "arguments": {
    "from": "0x742d35cc6Cc6ab4b3569bB50915BF3a3bF6dEc76",
    "to": "0x742d35cc6Cc6ab4b3569bB50915BF3a3bF6dEc76",
    "value": "1000000000000000000"
  }
}

Tool Details

Contract Inspection Tools

  • get_code: Returns contract bytecode and indicates if address is a contract
  • get_storage_at: Reads specific storage slots in smart contracts
  • get_logs: Filters and retrieves event logs with flexible criteria

Transaction Analysis Tools

  • estimate_gas: Provides gas estimates with cost calculations in Wei, Gwei, and ETH
  • get_transaction_info: Comprehensive transaction data including receipt information

Blockchain Data Tools

  • get_latest_block: Current block information
  • get_block_info: Historical block data by number or hash
  • get_account_balance: Account balances in multiple units
  • get_network_info: Network status and node information
  • get_gas_price: Current gas pricing data

Error Handling

The server includes comprehensive error handling for:

  • Network connectivity issues
  • Invalid blockchain data requests
  • Malformed tool parameters
  • Web3 provider errors
  • BigInt serialization issues

Quick Start Guide

  1. Install the package:

    npm install -g geth-mcp-server
  2. Ensure Geth is running:

    # Start your local Geth node
    geth --http --http.addr localhost --http.port 8545 --http.corsdomain "*" --http.api eth,net,web3
  3. Configure your MCP client with the configuration shown above

  4. Start using the tools through your MCP client

NPM Package

  • Package Name: geth-mcp-server
  • Version: 1.0.0
  • Registry: https://www.npmjs.com/package/geth-mcp-server
  • Size: 7.7 kB compressed, 40.2 kB unpacked

Requirements

  • Node.js 18+
  • Access to a running Geth node (default: http://localhost:8545)
  • MCP-compatible client for interaction

License

MIT