infura-mcp-server

Qbandev/infura-mcp-server

3.2

If you are the rightful owner of infura-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Infura MCP Server provides comprehensive Ethereum blockchain access through Infura's infrastructure, enabling connections to 29 read-only Ethereum JSON-RPC tools across 30+ networks.

Tools
29
Resources
0
Prompts
0

Infura MCP Server

A Model Context Protocol (MCP) server implementation that provides comprehensive Ethereum blockchain access through Infura's infrastructure. Connect Claude Desktop, VS Code, and other MCP clients to 29 read-only Ethereum JSON-RPC tools across 30+ networks.

Features

  • 29 read-only Ethereum JSON-RPC tools - Complete blockchain query suite
  • Multi-network support - 30+ networks including Ethereum, Polygon, Arbitrum, Base, Optimism
  • Real-time data - Direct access to Infura's blockchain infrastructure
  • AI-optimized - Comprehensive LLM context for expert blockchain guidance

Tools

Account & Balance Tools (3)

  • eth_getBalance - Get account balance in wei
  • eth_getCode - Get contract bytecode
  • eth_getTransactionCount - Get account nonce/transaction count

Block Tools (7)

  • eth_getBlockNumber - Get latest block number
  • eth_getBlockByHash - Get block details by hash
  • eth_getBlockByNumber - Get block details by number
  • eth_getUncleByBlockHashAndIndex - Get uncle block by hash and index
  • eth_getUncleByBlockNumberAndIndex - Get uncle block by number and index
  • eth_getUncleCountByBlockHash - Count uncle blocks by hash
  • eth_getUncleCountByBlockNumber - Count uncle blocks by number

Transaction Tools (6)

  • eth_getBlockTransactionCountByHash - Count transactions in block by hash
  • eth_getBlockTransactionCountByNumber - Count transactions in block by number
  • eth_getTransactionByBlockHashAndIndex - Get transaction by block hash and index
  • eth_getTransactionByBlockNumberAndIndex - Get transaction by block number and index
  • eth_getTransactionByHash - Get transaction details by hash
  • eth_getTransactionReceipt - Get transaction receipt and logs

Smart Contract Tools (3)

  • eth_call - Execute read-only contract call
  • eth_estimateGas - Estimate gas cost for transaction
  • eth_getStorageAt - Read contract storage slot

Network Tools (5)

  • eth_chainId - Get network chain ID
  • net_isListening - Check if client is listening for connections
  • net_getPeerCount - Get number of connected peers
  • net_getVersion - Get network ID
  • web3_getClientVersion - Get client version string

Log Query Tools (1)

  • eth_getLogs - Get logs with flexible filtering

Utility Tools (4)

  • eth_getFeeHistory - Get historical gas fee data (EIP-1559)
  • eth_getGasPrice - Get current gas price
  • eth_getProtocolVersion - Get Ethereum protocol version
  • eth_isSyncing - Check node synchronization status

Network Support

The Infura MCP Server supports all networks available through MetaMask/Infura infrastructure - providing access to 30+ network endpoints across 18 blockchain ecosystems.

For complete network details and endpoints, see: MetaMask Developer Documentation

Primary Ethereum Networks

  • mainnet - Ethereum Mainnet
  • sepolia - Ethereum Sepolia Testnet
  • holesky - Ethereum Holesky Testnet

Layer 2 & Scaling Solutions

  • arbitrum-mainnet, arbitrum-sepolia - Arbitrum One & Testnet
  • base-mainnet, base-sepolia - Base (Coinbase) & Testnet
  • blast-mainnet, blast-sepolia - Blast & Testnet
  • linea-mainnet, linea-sepolia - Linea (MetaMask) & Testnet
  • mantle-mainnet, mantle-sepolia - Mantle & Testnet
  • optimism-mainnet, optimism-sepolia - Optimism & Testnet
  • polygon-mainnet, polygon-amoy - Polygon PoS & Testnet
  • scroll-mainnet, scroll-sepolia - Scroll & Testnet
  • zksync-mainnet, zksync-sepolia - ZKsync Era & Testnet

Alternative Layer 1 Networks

  • avalanche-mainnet, avalanche-fuji - Avalanche C-Chain & Testnet
  • bsc-mainnet, bsc-testnet - BNB Smart Chain & Testnet
  • celo-mainnet, celo-alfajores - Celo & Testnet
  • opbnb-mainnet, opbnb-testnet - opBNB (Binance Layer 2) & Testnet
  • palm-mainnet, palm-testnet - Palm (NFT-focused) & Testnet
  • starknet-mainnet, starknet-sepolia - Starknet & Testnet
  • swellchain-mainnet, swellchain-testnet - Swellchain & Testnet
  • unichain-mainnet, unichain-sepolia - Unichain (Uniswap) & Testnet

Configuration

Environment Variables

  • INFURA_API_KEY (required) - Your Infura API key from MetaMask Developer Portal
  • INFURA_NETWORK (optional) - Target network (default: mainnet)

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

npx
{
  "mcpServers": {
    "infura-mcp-server": {
      "command": "npx",
      "args": [
        "infura-mcp-server"
      ],
      "env": {
        "INFURA_API_KEY": "your_infura_api_key_here"
      }
    }
  }
}
docker
{
  "mcpServers": {
    "infura-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "INFURA_API_KEY=your_infura_api_key_here",
        "-e",
        "INFURA_NETWORK=mainnet",
        "ghcr.io/qbandev/infura-mcp-server:latest"
      ]
    }
  }
}

Usage with Cursor

Add this to your Cursor MCP configuration file (.cursor/mcp.json in your workspace or global settings):

npx
{
  "mcpServers": {
    "infura-mcp-server": {
      "command": "npx",
      "args": [
        "infura-mcp-server"
      ],
      "env": {
        "INFURA_API_KEY": "your_infura_api_key_here"
      }
    }
  }
}
docker
{
  "mcpServers": {
    "infura-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "INFURA_API_KEY=your_infura_api_key_here",
        "-e",
        "INFURA_NETWORK=mainnet",
        "ghcr.io/qbandev/infura-mcp-server:latest"
      ]
    }
  }
}

To configure in Cursor:

  1. Open Command Palette (Cmd/Ctrl + Shift + P)
  2. Type "Open MCP Settings"
  3. Add the JSON configuration above
  4. Restart Cursor to activate the MCP server
  5. Start using blockchain tools in your AI conversations!

Usage with VS Code

For quick installation, click one of the installation buttons below...

Install with NPX in VS Code

Install with Docker in VS Code

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open Settings (JSON). Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

Note that the mcp key is not needed in the .vscode/mcp.json file.

For NPX installation:

{
  "mcp": {
    "servers": {
      "infura-mcp-server": {
        "command": "npx",
        "args": [
          "infura-mcp-server"
        ],
        "env": {
          "INFURA_API_KEY": "your_infura_api_key_here"
        }
      }
    }
  }
}

For Docker installation:

{
  "mcp": {
    "servers": {
      "infura-mcp-server": {
        "command": "docker",
        "args": [
          "run",
          "--rm",
          "-i",
          "-e",
          "INFURA_API_KEY=your_infura_api_key_here",
          "ghcr.io/qbandev/infura-mcp-server:latest"
        ]
      }
    }
  }
}

Usage Examples

Getting Started

  1. Get your Infura API key at MetaMask Developer Portal
  2. Configure your MCP client (Claude Desktop, Cursor, or VS Code) using the examples above
  3. Start exploring blockchain data with AI assistance

AI Assistant Conversations

Once configured, you can have natural blockchain conversations with AI assistants in Claude Desktop, Cursor, or VS Code:

Cursor Chat with Infura MCP

Key Benefits:

  • Contextual insights - AI explains what the data means and provides actionable advice
  • Multi-network analysis - Seamlessly compare data across different blockchain networks
  • Educational guidance - Learn blockchain concepts through natural conversation

Troubleshooting

Common Issues

"API key not working"

"Network not supported"

  • Use the INFURA_NETWORK environment variable
  • Refer to the supported networks list above

"Tool not responding"

  • Restart your MCP client (Claude Desktop, VS Code)
  • Verify the configuration JSON syntax

"Rate limit exceeded"

  • Upgrade your Infura plan for higher limits

Getting Help

  1. Visit Infura documentation for API details
  2. Open an issue on GitHub for bugs or feature requests

🔐 Security

🛡️ Built-in Security Features

  • Required parameter validation - validates presence of required parameters
  • No arbitrary code execution - only predefined Ethereum JSON-RPC methods
  • HTTPS/TLS encryption for all Infura connections
  • Local execution by default (stdio mode, no network exposure)
  • Read-only operations - server can never modify blockchain state

Contributing

Contributions are welcome! Please see for guidelines.

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.


Transform your AI into a blockchain expert with comprehensive Ethereum data access! 🚀