Token导航 LogoToken导航TokenDH.com
Wallet MCP (Hkmdxlftjf) logo
金融服务未说明官方级别未说明来源级核验

Wallet MCP (Hkmdxlftjf)

MCP Server

一个基于Rust的MCP服务器,提供以太坊余额查询、代币价格获取和代币交换功能。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
以太坊RustClaude区块链ClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

hkmdxlftjf

提供方

hkmdxlftjf

最后核验

2026/5/17 20:23

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

使用说明

前提条件

  • rust
  • anvil

MCP 调用示例

  1. get_balance请求
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_balance",
    "arguments": {
      "wallet_address": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
      "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
    }
  }
}

get_balance响应

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "1000.0 USDC"
      }
    ],
    "isError": false
  }
}
  1. get_token_price 请求
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "get_token_price",
    "arguments": {
      "token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "fee": 3000
    }
  }
}

get_token_price 请求

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "4036.350217 USDT"
      }
    ],
    "isError": false
  }
}
  1. swap_tokens 请求
{
  "jsonrpc": "2.0",
  "id": 4,
  "method": "tools/call",
  "params": {
    "name": "swap_tokens",
    "arguments": {
      "from_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
      "to_token": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
      "amount": 1.0,
      "slippage_pct": 50,
      "fee": 3000
    }
  }
}

swap_tokens 响应

{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "estimated_out: 0.03628441 WBTC | gas_price: 3628441 Gwei"
      }
    ],
    "isError": false
  }
}

MCP 配置

{
  "mcpServers": {
    "counter": {
      "command": "PATH-TO/wallet-mcp/target/release/wallet-mcp",
      "args": [],
      "env": {
        "ETH_RPC_URL": "http://localhost:8545",
        "PRIVATE_KEY": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
      }
    }
  }
}
  • ETH_RPC_URL 为以太坊节点地址
  • PRIVATE_KEY 为私钥地址

本地 anvil

启动

make anvil-start

停止

make anvil-stop

Programming Assignment: Ethereum Trading MCP Server

Overview

Build a Model Context Protocol (MCP) server in Rust that enables AI agents to query balances and execute token swaps on Ethereum.

Requirements

Core Functionality

Implement an MCP server with the following tools:

  1. get_balance - Query ETH and ERC20 token balances

- Input: wallet address, optional token contract address - Output: balance information with proper decimals

  1. get_token_price - Get current token price in USD or ETH

- Input: token address or symbol - Output: price data

  1. swap_tokens - Execute a token swap on Uniswap V2 or V3

- Input: from_token, to_token, amount, slippage tolerance - Output: simulation result showing estimated output and gas costs - Important: Construct a real Uniswap transaction and submit it to the blockchain for simulation (using eth_call or similar). The transaction should NOT be executed on-chain.

Technical Stack

Required:

  • Rust with async runtime (tokio)
  • Ethereum RPC client library (ethers-rs or alloy)
  • MCP SDK for Rust (rmcp) or implement JSON-RPC 2.0 manually
  • Structured logging (tracing)

Constraints

  • Must connect to real Ethereum RPC (use public endpoints or Infura/Alchemy)
  • Balance queries must fetch real on-chain data
  • For swaps: construct real Uniswap V2/V3 swap transactions and simulate them using RPC methods
  • Transaction signing: implement basic wallet management (e.g., private key via environment variable or config file)
  • Use rust_decimal or similar for financial precision

Deliverables

  1. Working code - Rust project that compiles and runs
  2. README with:

- Setup instructions (dependencies, env vars, how to run) - Example MCP tool call (show JSON request/response) - Design decisions (3-5 sentences on your approach) - Known limitations or assumptions

  1. Tests - Demonstrate core functionality

Development Approach

You're encouraged to use AI assistants (Cursor, Claude Code, GitHub Copilot, etc.) while working on this assignment. However, the solution should demonstrate your understanding of:

  • Rust and async programming
  • Ethereum fundamentals
  • System design and architecture

The code will be reviewed for comprehension and design decisions.

Submission

Create a GitHub repository and share the link. Ensure:

  • cargo build compiles successfully
  • cargo test passes
  • README has clear setup instructions
  • Code is well-organized and readable

目录标签

目录标签

以太坊RustClaude区块链本地部署代币交换智能合约

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP