Skip to main content
Glama

ENS MCP 服务器

用于以太坊名称服务 (ENS) 的 MCP 服务器,使 Claude 能够与 ENS 系统交互以解析名称、检查可用性、检索记录等。

npm 包: https://www.npmjs.com/package/mcp-server-ens

工具

解析名称

将 ENS 名称解析为以太坊地址

  • 必需输入:

    • name (字符串):要解析的 ENS 名称(例如“vitalik.eth”)

  • **返回:**对应的以太坊地址或错误信息

反向查找

获取以太坊地址的 ENS 名称

  • 必需输入:

    • address (字符串):要查找的以太坊地址

  • **返回:**相应的 ENS 名称或未找到名称的指示

获取文本记录

获取 ENS 名称的文本记录

  • 必需输入:

    • name (字符串):要查询的 ENS 名称

    • key (字符串):要查找的记录键(例如,“email”、“url”、“avatar”、“description”、“twitter”等)

  • **返回:**指定文本记录的值或未找到记录的指示

检查可用性

检查 ENS 名称是否可注册

  • 必需输入:

    • name (字符串):要检查的 ENS 名称

  • **返回:**可用性状态和所有者信息(如果已注册)

获取所有记录

获取 ENS 域名的所有可用信息

  • 必需输入:

    • name (字符串):要查询的 ENS 名称

  • **返回:**综合信息,包括解析器地址、文本记录、地址、内容哈希、所有权和到期详细信息

获取子域名

获取 ENS 名称的子域名

  • 必需输入:

    • name (字符串):用于查询子域名的 ENS 名称

  • **返回:**子域名及其所有者信息的列表

获取名称历史记录

获取 ENS 域名的历史记录

  • 必需输入:

    • name (字符串):要检查历史记录的 ENS 名称

  • **返回:**与名称相关的历史事件,包括转移、解析器更改和注册事件

获取注册价格

获取注册 ENS 域名的价格

  • 必需输入:

    • name (字符串):要检查价格的 ENS 名称

  • 可选输入:

    • duration (数字,默认值:1):注册持续时间(以年为单位)

  • **回报:**注册价格明细,包括基本价格、保费和总价格

Related MCP server: MCP Crypto Wallet EVM

设置

先决条件

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

  • npm 或 yarn

  • 访问以太坊 RPC 提供商(公共或私有)

安装

  1. 克隆存储库或创建新项目:

git clone https://github.com/JustaName-id/ens-mcp-server
  1. 安装依赖项:

npm i
  1. 配置以太坊提供商:在项目根目录中创建一个.env文件,其中包含以下内容(可选):

PROVIDER_URL=https://your-provider-url.com,https://your-backup-provider.com

如果没有指定提供程序,服务器将使用以下默认值:

与 Claude Desktop 一起使用

将以下内容添加到您的claude_desktop_config.json中:

使用 npx

{
  "mcpServers": {
    "ens": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-ens"
      ],
      "env": {
        "PROVIDER_URL": "https://your-provider-url.com,https://your-backup-provider.com"
      }
    }
  }
}

使用本地脚本

{
  "mcpServers": {
    "ens": {
      "command": "node",
      "args": [
        "/path/to/your/server.js"
      ],
      "env": {
        "PROVIDER_URL": "https://your-provider-url.com,https://your-backup-provider.com"
      }
    }
  }
}

错误处理

服务器针对各种场景实现了强大的错误处理:

  • 连接到以太坊提供商的网络错误

  • 无效的 ENS 名称或以太坊地址

  • ENS 特有的错误

  • 一般操作错误

所有错误都被规范化为用户友好的消息,同时保留了调试的技术细节。

出版

要发布为 npm 包:

npm publish --access public

故障排除

如果遇到错误:

  • 验证您的以太坊提供商是否正常运行且可访问

  • 检查您查询的 ENS 名称格式是否正确

  • 确保您拥有最新版本的 ENS 库

  • 尝试在 PROVIDER_URL 环境变量中使用逗号分隔的多个提供程序

执照

此 MCP 服务器采用 MIT 许可证。这意味着您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目仓库中的 LICENSE 文件。

Available Tools

8 tools
check-availabilityA

Check if an ENS name is available for registration

Inputs: name (required).

get-all-recordsB

Get all available information for an ENS name

Inputs: name (required).

get-name-historyC

Get the history of an ENS name

Inputs: name (required).

get-registration-priceC

Get the price to register an ENS name

Inputs: name (required), duration.

get-subdomainsC

Get subdomains for an ENS name

Inputs: name (required).

get-text-recordC

Get a text record for an ENS name

Inputs: key (required), name (required).

resolve-nameB

Resolve an ENS name to an Ethereum address

Inputs: name (required).

reverse-lookupB

Get the ENS name for an Ethereum address

Inputs: address (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: availability checks, retrieving records/history/price/subdomains/text, resolving names, and reverse lookups. The descriptions make it easy to differentiate between tools like 'get-all-records' (comprehensive info) and 'get-text-record' (specific record type).

    Naming Consistency4/5

    The naming follows a consistent verb-object pattern with hyphens (e.g., 'check-availability', 'get-all-records'), except for 'reverse-lookup' which uses a different verb style. This minor deviation slightly reduces consistency, but the overall pattern remains highly readable and predictable.

    Tool Count5/5

    With 8 tools, the count is well-scoped for an ENS server, covering key operations like checking availability, retrieving various data types, resolving addresses, and reverse lookups. Each tool earns its place without feeling excessive or insufficient for the domain.

    Completeness4/5

    The toolset provides strong coverage for querying and resolving ENS names, including availability, records, history, price, subdomains, text records, and bidirectional resolution. A minor gap is the lack of write operations (e.g., registering or updating names), but the read-focused surface is nearly complete for its apparent purpose.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers