Web3 MCP Server
by BaltasarAroso
This project implements a Model Context Protocol (MCP) server that interacts with Ethereum networks using the viem library. It supports querying balances, transactions, blocks, ENS, and more.
Last updated: N/A
What is Web3 MCP Server?
The Web3 MCP Server is a Model Context Protocol server designed to interact with Ethereum networks. It leverages the viem library to provide functionalities like querying balances, transaction details, and ENS information.
How to use Web3 MCP Server?
To use the server, first install dependencies with npm install
. Then, configure the network by setting the CHAIN_ENV
environment variable (mainnet, goerli, sepolia, or local). Start the server with npm start
. Integrate it with tools like Claude or Cursor IDE by building the server (npm run build
) and adding it as a custom MCP server in their settings, providing the path to the built index.js
file.
Key features of Web3 MCP Server
Get ETH and ERC-20 token balances
Query transaction and block details
ENS name resolution and reverse lookup
Call read-only contract methods
Supports mainnet, Goerli, Sepolia, and local (Hardhat) networks
Use cases of Web3 MCP Server
Integrating blockchain data into AI tools like Claude.
Providing contextual information about Ethereum transactions within IDEs like Cursor.
Building custom Web3 applications that require access to on-chain data.
Creating development and testing environments for Web3 projects.
FAQ from Web3 MCP Server
How do I switch between different Ethereum networks?
How do I switch between different Ethereum networks?
Set the CHAIN_ENV
environment variable to mainnet
, goerli
, sepolia
, or local
before starting the server.
How do I test the MCP server?
How do I test the MCP server?
Use the mcp-cli
tool with the command npx @wong2/mcp-cli npm start
.
How do I integrate the server with Claude or Cursor IDE?
How do I integrate the server with Claude or Cursor IDE?
Build the server with npm run build
, then add a new global MCP server in the tool's settings, pointing to the server/build/index.js
file.
What do I need to do after making changes to the server code?
What do I need to do after making changes to the server code?
Always run npm run build
after making changes. You may also need to refresh the tool or restart the MCP server for changes to take effect.
What are the next steps for the project?
What are the next steps for the project?
The project aims to add write (transaction) support for testnet/local, ensure comprehensive testing, refactor code for maintainability, and add basic rate limiting.