Skip to main content
Glama

MCP Ethers Wallet

MCP 以太坊钱包NPM 版本

一个使用 Ethers.js v6 与以太坊钱包和网络交互的模型上下文协议 (LLM) 服务器。该服务器为 LLM 提供了一个标准化接口,用于与以太坊网络、智能合约和钱包进行交互。

概述

MCP Ethers 钱包服务器实现了模型上下文协议规范,为 LLM 提供了以下工具:

  • 跨多个网络查询区块链数据
  • 与智能合约交互
  • 管理钱包操作
  • 解析 ENS 域名
  • 处理交易
  • 估算燃气费用

安装

npm install mcp-ethers-wallet

快速入门

启动服务器

import { startServer } from 'mcp-ethers-wallet'; startServer().catch((error) => { console.error('Failed to start server:', error); process.exit(1); });

与 Claude Desktop 一起使用

  1. 安装 Claude Desktop
  2. 添加一个新的 MCP 服务器,配置如下:
    "ethers": { "command": "node", "args": [ "/path-to-mcp-ethers-wallet/build/src/index.js" ], "env": { "ALCHEMY_API_KEY": "<<your alchemy api key>>" } }
  3. 这些工具现在将在您的 Claude 对话中可用

使用 MCP Inspector 进行测试

  1. 安装 MCP 检查器:
    npm install -g @modelcontextprotocol/inspector
  2. 启动服务器:
    npm start
  3. 在另一个终端中,运行检查器:
    mcp-inspector
  4. 在浏览器中打开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 不匹配
  • 合约交互失败
  • 交易错误
  • 网络连接问题

发展

# Install dependencies npm install # Run tests npm test # Start in development mode npm run dev # Build npm run build

贡献

欢迎在 GitHub 上提出问题和请求。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

作者

丹尼森·伯特伦 ( dennison@tally.xyz )

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器使 LLM 能够通过标准化接口与以太坊网络交互、管理钱包、查询区块链数据和执行智能合约操作。

  1. 概述
    1. 安装
      1. 快速入门
        1. 启动服务器
        2. 与 Claude Desktop 一起使用
        3. 使用 MCP Inspector 进行测试
      2. 可用工具
        1. 网络信息
        2. 钱包操作
        3. 交易管理
        4. 智能合约交互
        5. ENS 操作
      3. 网络支持
        1. 配置
          1. 错误处理
            1. 发展
              1. 贡献
                1. 执照
                  1. 作者

                    Related MCP Servers

                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.
                      Last updated -
                      10
                      77
                      Python
                      MIT License
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A Model Context Protocol server that enables Claude and other LLMs to interact with Notion workspaces, providing capabilities like searching, retrieving, creating and updating pages, as well as managing databases.
                      Last updated -
                      275
                      2
                      TypeScript
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.
                      Last updated -
                      TypeScript
                      MIT License
                      • Apple
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server that enables LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.
                      Last updated -
                      29
                      10
                      1
                      TypeScript
                      MIT License

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/crazyrabbitLTC/mcp-ethers-server'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server