home / mcp / layer2 mcp server
Provides tools to deploy ERC20 tokens, transfer ETH and tokens, and perform batch transfers on Layer 2 networks.
Configuration
View docs{
"mcpServers": {
"anylots-layer2-mcp": {
"command": "node",
"args": [
"/path-to-layer2-mcp/build/src/index.js"
],
"env": {
"ETH_L2_RPC": "https://your-layer2-rpc-url",
"PRIVATE_KEY": "YOUR_ETH_WALLET_PRIVATE_KEY"
}
}
}
}You will run an MCP server that lets AI models interact with an Ethereum layer 2 network using a standard, extensible interface. This server enables token deployment, token transfers, ETH transfers, and batch operations, making it easier to integrate blockchain actions into AI workflows.
Set up the MCP server locally and connect your MCP client to start issuing token and transfer operations. The server is designed to be run as a local process and can be driven by common MCP clients or tooling that supports HTTP or stdio MCP endpoints. You will deploy tokens, transfer ETH, transfer ERC20 tokens, and perform batch transfers on demand, then observe the results through the client.
Prerequisites you need on your machine before you begin:
- Node.js and npm (for command line execution and building the project)
- Git (to clone the repository)
Follow these concrete steps to install and prepare the MCP server:
# Clone the repository
git clone https://github.com/anylots/layer2-mcp.git
cd layer2-mcp
# Install dependencies
npm install
# Build the project
npm run buildConfiguration and runtime notes are provided to help you run the server securely and effectively. You will set environment variables for your Ethereum private key and the Layer 2 RPC endpoint, and you will run the server in a local environment during development. You can test the available tools and verify transfers using the included MCP Inspector tooling.
Deploy a new ERC20 token contract and return its contract address and transaction hash.
Transfer a specified amount of ETH to a target address and return the transaction hash.
Transfer ERC20 tokens from the deployed contract to a target address and return the transaction hash.
Execute multiple token transfers to random addresses over a defined duration to simulate activity and load.