Infura MCP Server
Provides tools to query blockchain data on BNB Chain via Infura's API, including blocks, transactions, smart contracts, accounts, and network information.
Provides tools to query blockchain data on Ethereum (mainnet, sepolia, holesky) via Infura's API, including blocks, transactions, smart contracts, accounts, and network information.
Provides tools to query blockchain data on Optimism via Infura's API, including blocks, transactions, smart contracts, accounts, and network information.
Provides tools to query blockchain data on Polygon via Infura's API, including blocks, transactions, smart contracts, accounts, and network information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Infura MCP Servershow me the latest block on Ethereum mainnet"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Infura MCP Server
A Model Context Protocol (MCP) server that connects AI assistants to 30+ blockchain networks through Infura's infrastructure. Query blocks, transactions, smart contracts, and accounts across Ethereum, Polygon, Arbitrum, Base, Avalanche, BNB Chain, and more using natural language.
What is This?
This server implements the Model Context Protocol (MCP), an open standard for connecting AI assistants to external data sources. MCP enables AI models to execute tools and access real-time data in a secure, structured way.
Why use this server?
Query live blockchain data directly from AI assistants (Claude, Cursor, VS Code Copilot)
No Web3 library setup required - just configure and start asking questions
All 29 tools are read-only and never modify blockchain state
Built-in security features protect against common vulnerabilities
Related MCP server: infura-mcp
Features
29 JSON-RPC Tools - Complete blockchain query suite for accounts, blocks, transactions, smart contracts, logs, and network data. All tools include MCP annotations (readOnlyHint, idempotentHint, etc.) for AI-optimized behavior. Optional response_format: "markdown" parameter for human-readable output.
30+ Networks - EVM-compatible chains including Ethereum mainnet/testnets, Layer 2 solutions (Arbitrum, Base, Optimism, Polygon, Linea, Scroll, ZKsync), and alternative L1s (Avalanche, BNB Chain, Celo, Starknet).
Enterprise-Grade Security - Configurable CORS, DNS rebinding protection, rate limiting, session management, input validation, and request/response size limits.
Flexible Deployment - Stdio mode for desktop integration or Streamable HTTP for web applications.
Quick Start
Get your Infura API key from the MetaMask Developer Portal
Choose your integration method below
Restart your AI client and start querying blockchain data
Claude Desktop
Config file location:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
How to access: Claude menu → Settings → Developer → Edit Config
{
"mcpServers": {
"infura": {
"command": "npx",
"args": ["-y", "infura-mcp-server"],
"env": {
"INFURA_API_KEY": "<YOUR_API_KEY>",
"INFURA_NETWORK": "mainnet"
}
}
}
}After saving, quit and restart Claude Desktop completely. Look for the MCP server indicator (hammer icon) in the bottom-right of the chat input.
Cursor
Config file location:
Global:
~/.cursor/mcp.jsonProject:
.cursor/mcp.jsonin project root
How to access: Settings → Cursor Settings → MCP → Add new MCP server
{
"mcpServers": {
"infura": {
"command": "npx",
"args": ["-y", "infura-mcp-server"],
"env": {
"INFURA_API_KEY": "<YOUR_API_KEY>",
"INFURA_NETWORK": "mainnet"
}
}
}
}Using environment variables (recommended for security):
{
"mcpServers": {
"infura": {
"command": "npx",
"args": ["-y", "infura-mcp-server"],
"env": {
"INFURA_API_KEY": "${env:INFURA_API_KEY}",
"INFURA_NETWORK": "mainnet"
}
}
}
}Claude Code (CLI)
One-line install:
claude mcp add infura --transport stdio --env INFURA_API_KEY=<YOUR_API_KEY> -- npx -y infura-mcp-serverWith network selection:
claude mcp add infura --transport stdio \
--env INFURA_API_KEY=<YOUR_API_KEY> \
--env INFURA_NETWORK=polygon-mainnet \
-- npx -y infura-mcp-serverScope options:
--scope local(default): Available only in current project--scope user: Available across all your projects--scope project: Shared with team via.mcp.json
Verify installation:
claude mcp list # List configured servers
claude mcp get infura # Check server detailsInside Claude Code, use /mcp to check server status.
VS Code
Quick install:
Or manually add to User Settings (JSON) or .vscode/mcp.json:
{
"mcp": {
"servers": {
"infura": {
"command": "npx",
"args": ["-y", "infura-mcp-server"],
"env": {
"INFURA_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
}Docker
Add to your MCP client config:
{
"mcpServers": {
"infura": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "INFURA_API_KEY=<YOUR_API_KEY>",
"-e", "INFURA_NETWORK=mainnet",
"ghcr.io/qbandev/infura-mcp-server:latest"
]
}
}
}HTTP Mode (Web Deployments)
npm run start:http
# Endpoints: http://localhost:3001/mcp (main) | http://localhost:3001/healthFor HTTP/SSE clients (Cursor remote servers):
{
"mcpServers": {
"infura": {
"url": "http://localhost:3001/mcp"
}
}
}Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your Infura API key from MetaMask Developer Portal |
| No |
| Target blockchain network (see Supported Networks) |
| No |
| Enable debug logging |
| No |
| HTTP server port (HTTP mode only) |
Security Configuration (HTTP Mode)
Variable | Default | Description |
|
| Comma-separated list of allowed CORS origins |
|
| Comma-separated list of allowed Host headers (DNS rebinding protection) |
|
| Session timeout in milliseconds |
|
| Maximum concurrent sessions |
Available Tools
Account and Balance (3 tools)
eth_getBalance- Get ETH balance of an addresseth_getCode- Get contract bytecode at an addresseth_getTransactionCount- Get transaction count (nonce) for an address
Blocks (7 tools)
eth_blockNumber- Get the latest block numbereth_getBlockByHash- Get block by its hasheth_getBlockByNumber- Get block by numbereth_getBlockTransactionCountByHash- Get transaction count in a block by hasheth_getBlockTransactionCountByNumber- Get transaction count in a block by numbereth_getUncleCountByBlockHash- Get uncle count by block hasheth_getUncleCountByBlockNumber- Get uncle count by block number
Transactions (6 tools)
eth_getTransactionByHash- Get transaction details by hasheth_getTransactionByBlockHashAndIndex- Get transaction by block hash and indexeth_getTransactionByBlockNumberAndIndex- Get transaction by block number and indexeth_getTransactionReceipt- Get transaction receipt (logs, status, gas used)eth_getUncleByBlockHashAndIndex- Get uncle block by hash and indexeth_getUncleByBlockNumberAndIndex- Get uncle block by number and index
Smart Contracts (3 tools)
eth_call- Execute a read-only contract calleth_estimateGas- Estimate gas for a transactioneth_getStorageAt- Read storage slot from a contract
Logs (1 tool)
eth_getLogs- Query contract event logs with filtering (supports pagination for large result sets)
Network Info (5 tools)
eth_chainId- Get the chain IDnet_version- Get the network versionnet_listening- Check if node is listening for connectionsnet_peerCount- Get number of connected peersweb3_clientVersion- Get the client version string
Gas and Fees (4 tools)
eth_gasPrice- Get current gas priceeth_feeHistory- Get historical fee data (EIP-1559)eth_protocolVersion- Get the Ethereum protocol versioneth_syncing- Get sync status of the node
All tools include enhanced descriptions with Args, Returns, Examples, and Errors sections for better AI understanding.
Supported Networks
Access 30+ networks across 18 blockchain ecosystems. Set your target using INFURA_NETWORK.
Category | Networks |
Ethereum |
|
Arbitrum |
|
Base |
|
Optimism |
|
Polygon |
|
Linea |
|
ZKsync |
|
Scroll |
|
Blast |
|
Mantle |
|
Avalanche |
|
BNB Chain |
|
opBNB |
|
Celo |
|
Palm |
|
Starknet |
|
Swellchain |
|
Unichain |
|
See complete network documentation.
Usage Examples
Once configured, ask your AI assistant natural language questions:

Common queries:
"What is the ETH balance of vitalik.eth?"
"Show me the latest block on Ethereum mainnet"
"Get the transaction receipt for 0x..."
"What is the current gas price on Polygon?"
"Read the storage at slot 0 of this contract"
"Compare gas prices across Ethereum, Arbitrum, and Base"
The AI automatically selects the appropriate tools and provides contextual insights.
Tool parameters:
Use
response_format: "markdown"for formatted, human-readable outputUse
pageandpageSizewitheth_getLogsto paginate large result sets
Architecture
+------------------+ +-------------------+ +------------------+
| AI Assistant | <-> | Infura MCP | <-> | Infura API |
| (Claude, Cursor) | | Server | | (30+ networks) |
+------------------+ +-------------------+ +------------------+
|
+-----+-----+
| |
Stdio Mode HTTP Mode
(Desktop) (Web/API)Transport Modes:
Stdio (default): For desktop integrations (Claude Desktop, Cursor, VS Code). The AI client spawns the server as a subprocess and communicates via stdin/stdout.
Streamable HTTP: For web deployments and multi-client scenarios. Exposes
/mcpendpoint with session management.
Security
Warning: Never commit API keys to version control. Use environment variables or secrets management.
Built-in Security Features
Input Validation
Required parameter validation: All tool inputs validated against strict patterns before execution
Ethereum addresses: 0x + 40 hex characters
Transaction/block hashes: 0x + 64 hex characters
Networks: Validated against allowlist to prevent URL injection
Local execution: Server runs locally with no external code execution
Request Protection (HTTP Mode)
Rate limiting: 100 requests per minute per IP address
CORS: Configurable origin allowlist via
CORS_ALLOWED_ORIGINSDNS rebinding protection: Host header validation via
ALLOWED_HOSTSRequest body limit: 100KB maximum payload size
Response size limit: 100KB maximum response (CHARACTER_LIMIT)
Session management: Configurable timeout and maximum concurrent sessions
Network Security
All Infura API calls use HTTPS/TLS encryption
Read-only operations only - tools never modify blockchain state
No arbitrary code execution - only predefined JSON-RPC methods
Request identification via User-Agent header:
infura-mcp-server/{version}
Security Headers (HTTP Mode)
X-Content-Type-Options: nosniffX-Frame-Options: DENYContent-Security-Policy: default-src 'none'Referrer-Policy: no-referrerCache-Control: no-store
API Key Security
Store keys in environment variables, never in code or committed config files
Use separate API keys for development and production
Monitor usage via the MetaMask Developer Dashboard
Rotate keys periodically and revoke unused keys
Use Infura's allowlist feature to restrict key usage by domain or IP
Supply Chain Security
This package uses npm Trusted Publishing with OIDC and provenance attestations for supply chain integrity.
Error Handling
The server provides actionable error messages to help diagnose issues:
Error | Cause | Solution |
| Missing environment variable | Set |
| Invalid or restricted API key | Verify key at MetaMask Dashboard |
| Too many requests | Wait 60 seconds, or upgrade your Infura plan |
| Malformed address input | Use 0x followed by 40 hex characters |
| Unsupported network name | Check Supported Networks |
| Infura outage | Transient error - automatic retry with exponential backoff |
| Network congestion | Retry, or simplify the query |
Retry Logic: Transient failures (HTTP 429, 5xx, network errors) are automatically retried up to 3 times with exponential backoff (1s, 2s, 4s). Rate limit responses respect the Retry-After header.
Common Pitfalls
Forgetting to set INFURA_API_KEY - The most common issue. Verify the variable is exported in your shell or set in your MCP client config.
Using wrong network name - Network names are case-sensitive and hyphenated (e.g.,
arbitrum-mainnet, notarbitrumorArbitrum).Querying testnet data on mainnet - Transactions and addresses are network-specific. Set
INFURA_NETWORKto match your data.Expecting real-time updates - MCP tools query on-demand. For continuous monitoring, make repeated queries.
Large log queries timing out - Use specific block ranges and topic filters with
eth_getLogsto limit result size.Committing API keys - Use
.envfiles (add to.gitignore) or your IDE's secrets management.
Development
npm install # Install dependencies
npm start # Run in stdio mode
npm run start:http # Run in HTTP mode
npm test # Run basic tests
npm run test:full # Run all tests including HTTP transport
npm run list-tools # List available toolsRun without installation:
npx infura-mcp-server --help # Show available commandsDocker
npm run docker:build # Build image
npm run docker:run # Run in stdio mode
npm run docker:run:http # Run in HTTP mode
npm run docker:compose:up # Start with docker-compose (HTTP)
npm run docker:compose:down # Stop containersTroubleshooting
API key not working - Verify your key at the MetaMask Developer Dashboard
Network not supported - Check the Supported Networks list and verify spelling
Tool not responding - Restart your MCP client and verify configuration JSON syntax
Rate limit exceeded - Upgrade your Infura plan for higher limits, or wait 60 seconds
Connection refused (HTTP mode) - Check that ALLOWED_HOSTS includes your hostname
CORS errors (HTTP mode) - Add your origin to CORS_ALLOWED_ORIGINS
For detailed API documentation, see Infura docs. For bugs or feature requests, open a GitHub issue.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE file for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Qbandev/infura-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server