Skip to main content
Glama

MCP 以太坊钱包NPM 版本

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

概述

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

  • 跨多个网络查询区块链数据

  • 与智能合约交互

  • 管理钱包操作

  • 解析 ENS 域名

  • 处理交易

  • 估算燃气费用

Related MCP server: EVM MCP Server

安装

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 )

Install Server
A
license - permissive license
D
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    A 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.
    28
    134
    381
    MIT
  • -
    license
    -
    quality
    -
    maintenance
    Comprehensive 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.
    1
  • F
    license
    A
    quality
    B
    maintenance
    A server that exposes blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol, enabling AI agents and tools to access and analyze blockchain information contextually.
    18
    43

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A Model Context Protocol server for Wix AI tools

  • MCP server for AI dialogue using various LLM models via AceDataCloud

View all MCP Connectors

Latest Blog Posts

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