# Infura Ethereum MCP

> Infura (Ethereum Node RPC Provider). Query Ethereum blockchain data directly from your agent. Check account balances, estimate transaction gas costs, fetch current block information, or read smart contract code using natural language prompts.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** ethereum, web3, rpc-node, blockchain-data, smart-contracts

## Description

Need to know what's happening on the Ethereum network? Instead of opening a terminal and running complex JSON-RPC commands, you just ask your AI client. This MCP connects you straight to high-performance RPC nodes, letting you treat the entire blockchain like a searchable database. You can ask for the current block number, check an address balance, or even see the gas cost needed for a transaction before you commit. If you're working with Web3 and need reliable access to live chain data—whether debugging contracts or analyzing network trends—this MCP is your bridge. Just connect it through Vinkius, and any compatible agent can start querying Ethereum instantly.

## Tools

### eth_blockNumber
Retrieves the number of the most recent block on the chain.

### eth_call
Executes a message call immediately to check contract logic without sending a transaction.

### eth_chainId
Retrieves the unique ID for the current blockchain network.

### eth_estimateGas
Calculates the amount of gas required to execute a specific transaction.

### eth_feeHistory
Provides historical records and details about past transaction fees paid on the network.

### eth_gasPrice
Gets the current recommended gas price for standard transactions.

### eth_getBalance
Checks and returns the current balance of a specified Ethereum account address.

### eth_getBlockByHash
Fetches all information about a specific block using its unique hash identifier.

### eth_getBlockByNumber
Retrieves detailed information for a block when provided with its numerical sequence.

### eth_getBlockTransactionCountByHash
Determines how many transactions were included in a block, given the block's hash.

### eth_getBlockTransactionCountByNumber
Gets the transaction count for a specific block number.

### eth_getCode
Retrieves the compiled bytecode or source code associated with a given address.

### eth_getFilterChanges
Checks for changes in state based on a pre-existing data filter.

### eth_getLogs
Gathers all event logs that match specific filtering criteria across the blockchain.

### eth_getTransactionByHash
Retrieves all raw details about a transaction using its unique hash identifier.

### eth_getTransactionCount
Counts the number of transactions sent from an address (the nonce).

### eth_getTransactionReceipt
Gets the final result and receipt for a transaction that has already been confirmed.

### eth_newFilter
Creates a new filter object to monitor specific events or data changes over time.

### eth_sendRawTransaction
Sends a pre-signed, raw transaction directly to the network for execution.

### get_suggested_gas_fees
Calculates and returns modern gas fees (EIP-1559) based on current market demand.

## Prompt Examples

**Prompt:** 
```
What is the current block number on Ethereum?
```

**Response:** 
```
The most recent block number is 0x11B560F (decimal: 18568719).
```

**Prompt:** 
```
Check the balance of 0x742d35Cc6634C0532925a3b844Bc454e4438f44e at the latest block.
```

**Response:** 
```
The balance for that address is 0xde0b6b3a7640000 wei, which is equivalent to 1.0 ETH.
```

**Prompt:** 
```
What are the suggested gas fees right now?
```

**Response:** 
```
Based on current network conditions, the suggested base fee is 15 Gwei with a priority fee of 1.5 Gwei for a standard transaction.
```

## Capabilities

### Monitor current block status
Get the latest block number and details for instant chain tracking.

### Check account balances and contract code
Determine how much ETH an address holds or retrieve the underlying smart contract source code.

### Analyze transaction history
Inspect specific transactions using a hash to track execution details, receipts, and nonces.

### Calculate network costs
Determine the current gas price or estimate the exact fees needed for any proposed action (EIP-1559).

### Execute smart contract reads
Run read-only calls against a smart contract to check its state without spending funds.

## Use Cases

### Auditing an old deployment
A compliance officer needs to verify if a specific wallet interacted with a vulnerable contract last month. They ask their agent: 'Show me all transactions involving address X between date Y and Z.' The agent then uses `eth_getLogs` and filters by time/address to build the required audit trail.

### Checking for immediate funds
A user needs to know if their wallet has enough ETH to cover a fee. They simply ask: 'What's my balance?' The agent uses `eth_getBalance` and immediately provides the current available amount, preventing failed transactions.

### Recreating historical state
A data scientist needs to build a model based on block activity from last week. They ask: 'What was the transaction count for block number 18560719?' The agent uses `eth_getBlockTransactionCountByNumber` to pull that specific metric.

### Confirming contract eligibility
A developer needs to know if a particular smart contract is even deployed. They ask: 'What code is at address 0x...?' The agent uses `eth_getCode` and returns the bytecode, confirming its existence.

## Benefits

- Stop guessing gas costs. By using the `get_suggested_gas_fees` tool, your agent calculates modern fees (EIP-1559) so you know exactly how much a transaction will cost before running it.
- Debug contracts instantly. Instead of writing code to test contract logic, ask your agent to run read-only calls using `eth_call`, checking the outcome without spending gas.
- Track transactions end-to-end. When a transaction is submitted, use `eth_getTransactionByHash` and then follow up with `eth_getTransactionReceipt` to confirm success or failure details.
- Analyze network activity at scale. The agent can gather all necessary logs using `eth_getLogs`, letting you monitor specific events that happened across the entire chain history.
- Understand contract structure. Use `eth_getCode` to pull the bytecode from any address, giving you insight into what a smart contract actually does.

## How It Works

The bottom line is that your agent handles all the complex API calls, letting you focus on what you want to know about the chain state.

1. Subscribe to this MCP and provide your Infura API key (Project ID).
2. Optionally, specify the target network you need data from (like mainnet or sepolia).
3. Your AI client sends a natural language query; the agent then executes the necessary blockchain calls using the exposed tools.

## Frequently Asked Questions

**How do I find out how much gas an action will cost using eth_estimateGas?**
You pass your proposed transaction parameters to the `eth_estimateGas` tool. It runs a simulation and returns the required amount of gas, so you know your cost before committing.

**Can I use eth_getBlockByHash to verify a specific block?**
Yes. You give the MCP the block hash, and it uses `eth_getBlockByHash` to retrieve all associated data for that exact block in one go.

**What is the best way to check if a transaction succeeded using eth_getTransactionReceipt?**
The `eth_getTransactionReceipt` tool provides the final status. You look at the receipt's status field; it tells you definitively whether the execution finished successfully or failed.

**Does Infura Ethereum MCP help me track events with eth_getLogs?**
Absolutely. `eth_getLogs` allows your agent to filter and collect all event logs that match specific criteria, letting you monitor exactly what happened on the chain.

**How do I check which Ethereum network my agent is connected to using eth_chainId?**
It returns a unique numerical identifier for the current blockchain. This confirms compatibility, letting you know immediately if your AI client is talking to mainnet or a test environment like Sepolia.

**Before interacting with a smart contract, how can I use eth_getCode to retrieve its bytecode?**
It fetches the compiled code assigned to a specific address. This step confirms the contract actually exists and gives you the raw data needed to understand its structure before attempting any read or write calls.

**What is the proper way to determine the next transaction sequence number using eth_getTransactionCount?**
It returns the total count of transactions sent from an address. You must use this nonce value when sending a new transaction; otherwise, the network will reject it because the order is wrong.

**When should I use eth_call instead of running a full transaction to test contract logic?**
You execute `eth_call` for read-only simulations. It lets you run arbitrary code and check results without spending gas or changing the actual state on the blockchain, which is perfect for testing.

**Can I check the balance of any Ethereum wallet address?**
Yes. Use the `eth_getBalance` tool with the target address. You can also specify the block parameter (e.g., 'latest') to get the most up-to-date balance in wei.

**How do I find out the current gas price for a transaction?**
You can use the `eth_gasPrice` tool to get the current price in wei, or use `getSuggestedGasFees` for a more detailed recommendation on priority and base fees.

**Can I inspect the details of a specific block using its number?**
Absolutely. Use the `eth_getBlockByNumber` tool. Provide the hex-encoded block number or a tag like 'latest', and set `full_tx` to true if you want to see all transaction objects within that block.