Ethereum-Trading
MCP server from a67793581/Ethereum-Trading-MCP-Server
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:
- Install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Clone the repository: git clone <repository-url> cd <repository-name>
- Create a .env file at the project root and set: INFURA_PROJECT_ID=your_infura_project_id PRIVATE_KEY=your_wallet_private_key
- Build in release mode: cargo build --release
- 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
goose
an open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
cunzhi
告别AI提前终止烦恼,助力AI更加持久
probe
AI-friendly semantic code search engine for large codebases. Combines ripgrep speed with tree-sitter AST parsing. Powers AI coding assistants with precise, context-aware code understanding.
mcp-center
A centralized platform for managing and connecting MCP servers. MCP Center provides a high-performance proxy service that enables seamless communication between MCP clients and multiple MCP servers.
backlog -rust
MCP server for Backlog, project management service.
perplexity-web-api
🔍 Perplexity AI MCP without API key