Get the FREE Ultimate OpenClaw Setup Guide →

Ethereum-Trading

MCP server from a67793581/Ethereum-Trading-MCP-Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio a67793581-ethereum-trading-mcp-server cargo run --release \
  --env PRIVATE_KEY="your_wallet_private_key" \
  --env INFURA_PROJECT_ID="your_infura_project_id"

How to use

This MCP server is a Rust-based Ethereum trading assistant that exposes tools for querying balances, fetching token prices, and simulating token swaps on Ethereum. It uses ethers-rs for on-chain interactions and rmcp to define the MCP server. The available tools are get_balance, get_token_price, and swap_tokens. You can interact with the server via JSON-RPC calls over HTTP, for example by posting to http://127.0.0.1:8080 with a JSON-RPC payload. The server authenticates and executes simulations using a provided Ethereum RPC endpoint (configured via environment variables) and a wallet private key for signing simulated transactions.

How to install

Prerequisites:

  • Rust toolchain (rustup)
  • Git
  • A Ethereum RPC endpoint (Infura/Alchemy) and a wallet private key for simulations

Install and run:

  1. Install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Clone the repository: git clone <repository-url> cd <repository-name>
  3. Create a .env file at the project root and set: INFURA_PROJECT_ID=your_infura_project_id PRIVATE_KEY=your_wallet_private_key
  4. Build in release mode: cargo build --release
  5. Run the server: cargo run --release The MCP server will start and listen on 127.0.0.1:8080.

Additional notes

Environment variables are used to manage secrets. Ensure INFURA_PROJECT_ID and PRIVATE_KEY are kept secure and not committed to version control. Supported features include:

  • get_balance: query ETH and ERC20 balances for a wallet
  • get_token_price: fetch current token prices in USD via Chainlink price feeds
  • swap_tokens: simulate a Uniswap V2 token swap Limitations to be aware of:
  • Token support is currently hardcoded (ETH, DAI, USDC) for price and swap operations
  • Swaps are simulated and do not execute on-chain without proper signing configuration and network access
  • Error handling is basic in this prototype If you run into port issues, ensure no other service is bound to 127.0.0.1:8080 and verify that your .env values are loaded by the application.

Related MCP Servers

Sponsor this space

Reach thousands of developers