MCP 以太坊钱包
一个使用 Ethers.js v6 与以太坊钱包和网络交互的模型上下文协议 (LLM) 服务器。该服务器为 LLM 提供了一个标准化接口,用于与以太坊网络、智能合约和钱包进行交互。
概述
MCP Ethers 钱包服务器实现了模型上下文协议规范,为 LLM 提供了以下工具:
跨多个网络查询区块链数据
与智能合约交互
管理钱包操作
解析 ENS 域名
处理交易
估算燃气费用
安装
快速入门
启动服务器
与 Claude Desktop 一起使用
安装 Claude Desktop
添加一个新的 MCP 服务器,配置如下:
这些工具现在将在您的 Claude 对话中可用
使用 MCP Inspector 进行测试
安装 MCP 检查器:
启动服务器:
在另一个终端中,运行检查器:
在浏览器中打开http://localhost:5173以与工具进行交互
可用工具
网络信息
getSupportedNetworks
:获取所有支持的网络及其配置的列表getBlockNumber
:获取网络的当前区块编号getBlockDetails
:获取特定区块的详细信息getGasPrice
:获取当前 gas 价格getFeeData
:获取详细费用数据,包括基本费用和优先费用
钱包操作
checkWalletExists
:检查钱包是否已配置(不暴露私钥)getWalletBalance
:获取钱包的原生代币余额getWalletTransactionCount
:获取从钱包发送的交易数量getERC20Balance
:获取钱包的 ERC20 代币余额
交易管理
getTransactionDetails
:获取有关交易的详细信息sendTransaction
:发送原生代币交易sendTransactionWithOptions
:发送带有自定义选项(gas、nonce 等)的交易getTransactionsByBlock
:获取特定区块中的所有交易
智能合约交互
contractCall
:执行合约写入方法contractCallView
:执行合约读取方法getContractCode
:获取已部署合约的字节码
ENS 操作
lookupAddress
:将 ENS 名称解析为地址resolveName
:将地址解析为 ENS 名称
网络支持
该服务器支持多种网络,包括:
以太坊主网
多边形 PoS
仲裁
乐观
根据
还有更多...
使用getSupportedNetworks
工具获取支持的网络的完整列表。
配置
可以使用环境变量来配置服务器:
ALCHEMY_API_KEY
:用于网络访问的 Alchemy API 密钥PRIVATE_KEY
:交易签名的私钥(可选)DEFAULT_NETWORK
:默认使用的网络(默认为“mainnet”)
错误处理
服务器提供了常见问题的详细错误消息:
无效的网络名称或 RPC URL
链 ID 不匹配
合约交互失败
交易错误
网络连接问题
发展
贡献
欢迎在 GitHub 上提出问题和请求。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
作者
丹尼森·伯特伦 ( dennison@tally.xyz )
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, providing services like token transfers, contract interactions, and ENS resolution through a unified interface.Last updated -282,659320MIT License
- -security-license-qualityComprehensive Model Context Protocol server that enables AI agents to interact with 30+ Ethereum-compatible blockchain networks, supporting token transfers, smart contract interactions, and ENS name resolution through a unified interface.Last updated -1MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables interaction with Foundry tools through natural language, allowing users to create projects, build contracts, run tests, and manage Ethereum development environments.Last updated -1MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that allows LLMs to interact with blockchain through MetaMask, keeping private keys securely in your crypto wallet while enabling transactions and blockchain operations.Last updated -2807MIT License