Skip to main content
Glama

MCP 加密钱包 EVM

此代码库包含一个模型上下文协议 (MCP) 服务器,该服务器允许 Claude 通过 ethers.js v5 访问以太坊和兼容 EVM 的区块链操作。该服务器使 Claude 能够执行创建钱包、查询余额、发送交易以及与兼容 EVM 的区块链上的智能合约交互等操作。

概述

MCP 服务器向 Claude 公开了以下工具:

钱包创建和管理

  • wallet_create_random :使用随机私钥创建新钱包

  • wallet_from_private_key :通过私钥创建钱包

  • wallet_from_mnemonic :通过助记词创建钱包

  • wallet_from_encrypted_json :通过解密加密的 JSON 钱包创建钱包

  • wallet_encrypt :使用密码加密钱包

钱包属性

  • wallet_get_address :获取钱包地址

  • wallet_get_public_key :获取钱包公钥

  • wallet_get_private_key :获取钱包私钥(带有适当的安全警告)

  • wallet_get_mnemonic :获取钱包助记词(如果有)

区块链方法

  • wallet_get_balance :获取钱包余额

  • wallet_get_chain_id :获取钱包所连接的链 ID

  • wallet_get_gas_price :获取当前 gas 价格

  • wallet_get_transaction_count :获取从此账户发送的交易数量(nonce)

  • wallet_call :调用合约方法而不发送交易

交易方式

  • wallet_send_transaction :发送交易

  • wallet_sign_transaction :签署交易但不发送

  • wallet_populate_transaction :使用缺失的字段填充交易

签名方法

  • wallet_sign_message :签署消息

  • wallet_sign_typed_data :签名类型数据(EIP-712)

  • wallet_verify_message :验证签名的消息

  • wallet_verify_typed_data :验证已签名的类型化数据

提供程序方法

  • provider_get_block :通过数字或哈希获取区块

  • provider_get_transaction :通过哈希获取交易

  • provider_get_transaction_receipt :获取交易收据

  • provider_get_code :获取地址的代码

  • provider_get_storage_at :获取某个地址的存储位置

  • provider_estimate_gas :估算交易所需的 gas

  • provider_get_logs :获取符合过滤器的日志

  • provider_get_ens_resolver :获取名称的 ENS 解析器

  • provider_lookup_address :查找地址的 ENS 名称

  • provider_resolve_name :将 ENS 名称解析为地址

网络方法

  • network_get_network :获取当前网络信息

  • network_get_block_number :获取当前区块号

  • network_get_fee_data :获取当前费用数据(基本费用、最高优先费用等)

Related MCP server: Base MCP Server

先决条件

  • Node.js(v16 或更高版本)

  • Claude桌面应用程序

安装

选项 1:使用 npx(推荐)

您可以使用 npx 直接运行 MCP 服务器,无需安装:

npx @mcp-dockmaster/mcp-cryptowallet-evm

这将直接从 npm 下载并执行服务器。

选项 2:手动安装

  1. 克隆此存储库:

    git clone https://github.com/dcSpark/mcp-cryptowallet-evm.git
    cd mcp-cryptowallet-evm
  2. 安装依赖项:

    npm ci
  3. 构建项目:

    npm run build

配置

环境变量

MCP 服务器支持以下环境变量:

  • PRIVATE_KEY :当没有明确提供钱包时,用于钱包操作的可选私钥

配置 Claude 桌面

要配置 Claude Desktop 以使用此 MCP 服务器:

  1. 打开 Claude 桌面

  2. 导航到 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • Linux: ~/.config/Claude/claude_desktop_config.json

  3. 添加 MCP 服务器配置:

{
  "mcpServers": {
    "mcp-cryptowallet-evm": {
      "command": "npx",
      "args": [
        "@mcp-dockmaster/mcp-cryptowallet-evm"
      ]
    }
  }
}

或者,如果您在本地安装了该包:

{
  "mcpServers": {
    "mcp-cryptowallet-evm": {
      "command": "node",
      "args": [
        "/path/to/your/mcp-cryptowallet-evm/build/index.js"
      ]
    }
  }
}

本地运行

node build/index.js

用法

配置完成后,重新启动 Claude Desktop。Claude 现在就可以访问以太坊和 EVM 兼容的区块链工具了。您可以让 Claude 执行以下操作:

  1. 创建新钱包:

    Can you create a new Ethereum wallet for me?
  2. 检查钱包余额:

    What's the balance of the Ethereum wallet address 0x742d35Cc6634C0532925a3b844Bc454e4438f44e?
  3. 发送交易:

    Can you help me send 0.1 ETH to 0x742d35Cc6634C0532925a3b844Bc454e4438f44e?

Claude 将使用 MCP 服务器直接与以太坊区块链进行交互。

发展

添加新工具

要向 MCP 服务器添加新工具:

  1. 在src/tools.ts中定义工具

  2. 在适当的处理程序文件中创建处理程序函数

  3. 将处理程序添加到src/tools.ts中的handlers对象

建筑

npm run build

执照

麻省理工学院

Available Tools

35 tools
network_get_block_numberB

Get the current block number

Inputs: no named parameters.

network_get_fee_dataB

Get the current fee data (base fee, max priority fee, etc.)

Inputs: no named parameters.

network_get_networkC

Get the current network information

Inputs: no named parameters.

provider_estimate_gasC

Estimate the gas required for a transaction

Inputs: transaction (required).

provider_get_blockC

Get a block by number or hash

Inputs: blockHashOrBlockTag (required), includeTransactions.

provider_get_codeC

Get the code at an address

Inputs: address (required), blockTag.

provider_get_ens_resolverC

Get the ENS resolver for a name

Inputs: name (required).

provider_get_logsC

Get logs that match a filter

Inputs: filter (required).

provider_get_storage_atC

Get the storage at a position for an address

Inputs: address (required), position (required), blockTag.

provider_get_transactionC

Get a transaction by hash

Inputs: transactionHash (required).

provider_get_transaction_receiptC

Get a transaction receipt

Inputs: transactionHash (required).

provider_lookup_addressC

Lookup the ENS name for an address

Inputs: address (required).

provider_resolve_nameC

Resolve an ENS name to an address

Inputs: name (required).

wallet_callC

Call a contract method without sending a transaction

Inputs: transaction (required), blockTag, wallet.

wallet_create_mnemonic_phraseC

Create a mnemonic phrase

Inputs: length (required), locale.

wallet_create_randomC

Create a new wallet with a random private key

Inputs: locale, password, path.

wallet_encryptC

Encrypt a wallet with a password

Inputs: password (required), wallet (required), options.

wallet_from_encrypted_jsonC

Create a wallet by decrypting an encrypted JSON wallet

Inputs: json (required), password (required).

wallet_from_mnemonicC

Create a wallet from a mnemonic phrase

Inputs: mnemonic (required), locale, path.

wallet_from_private_keyC

Create a wallet from a private key

Inputs: privateKey (required).

wallet_get_addressC

Get the wallet address

Inputs: wallet.

wallet_get_balanceC

Get the balance of the wallet

Inputs: blockTag, wallet.

wallet_get_chain_idB

Get the chain ID the wallet is connected to

Inputs: wallet.

wallet_get_gas_priceC

Get the current gas price

Inputs: wallet.

wallet_get_private_keyC

Get the wallet private key (with appropriate security warnings)

Inputs: password, wallet.

wallet_get_public_keyC

Get the wallet public key

Inputs: wallet.

wallet_get_transaction_countC

Get the number of transactions sent from this account (nonce)

Inputs: blockTag, wallet.

wallet_populate_transactionC

Populate a transaction with missing fields

Inputs: transaction (required), wallet.

wallet_provider_setB

Set the provider URL. By default, the provider URL is set to the ETH mainnet or the URL set in the PROVIDER_URL environment variable.

Inputs: providerURL (required).

wallet_send_transactionC

Send a transaction

Inputs: transaction (required), wallet.

wallet_sign_messageC

Sign a message

Inputs: message (required), wallet.

wallet_sign_transactionB

Sign a transaction without sending it

Inputs: transaction (required), wallet.

wallet_sign_typed_dataC

Sign typed data (EIP-712)

Inputs: domain (required), types (required), value (required), wallet.

wallet_verify_messageC

Verify a signed message

Inputs: address (required), message (required), signature (required).

wallet_verify_typed_dataC

Verify signed typed data

Inputs: address (required), domain (required), signature (required), types (required), +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 35 tools

    Disambiguation4/5

    Most tools have distinct purposes with clear resource-action pairs (e.g., network_get_block_number vs. wallet_get_balance), but some overlap exists in provider and wallet operations that could cause confusion, such as provider_get_transaction and wallet_get_transaction_count both dealing with transaction data. Descriptions help clarify, but the boundaries between network, provider, and wallet categories are not always sharp.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern with clear prefixes (network_, provider_, wallet_) that group related functions. All names use snake_case uniformly, making them predictable and easy to parse. This consistency aids in understanding the tool set's structure and purpose.

    Tool Count3/5

    With 35 tools, the count is borderline high for a crypto wallet server, potentially overwhelming for agents. While the domain (EVM wallet operations) is broad, covering network, provider, and wallet functions, the number feels heavy and could be streamlined. It's not extreme, but it approaches the upper limit of reasonable scope.

    Completeness5/5

    The tool set provides comprehensive coverage for EVM wallet operations, including network interactions, provider queries, wallet creation/management, transaction handling, and signing/verification. All essential CRUD and lifecycle actions are present, with no obvious gaps that would hinder agent workflows in this domain.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers