aelf-node-skill

aelf-node-skill

Enables interaction with AElf blockchain nodes, allowing users to read chain status, execute contract transactions, and manage custom nodes through MCP, CLI, or SDK.

Category
访问服务器

README

AElf Node Skill

English | 中文

Unit Tests Coverage

AElf Node Skill provides MCP, CLI, and SDK interfaces for AElf public nodes with REST for reads, SDK for contract execution, and selective fallback for fee estimate, plus OpenClaw and IronClaw integration.

Features

  • Read: chain status, block height, block detail, transaction result
  • Contract metadata: view methods and system contract address (REST adapter)
  • Contract execution: view call and send transaction (SDK)
  • Fee estimate: REST first, SDK fallback
  • Node registry: import and list custom nodes

Default Nodes

  • AELF: https://aelf-public-node.aelf.io
  • tDVV: https://tdvv-public-node.aelf.io

Install

bun install

Usage

MCP

bun run mcp

CLI

bun run cli get-chain-status --chain-id AELF

OpenClaw

bun run build:openclaw
bun run build:openclaw:check

Quick Start

# MCP server
bun run mcp

# CLI
bun run cli get-chain-status --chain-id AELF

# Unit tests
bun run test:unit

Setup CLI

This repository includes a one-command setup CLI for Claude, Cursor, OpenClaw, and IronClaw.

bun run setup claude
bun run setup cursor
bun run setup cursor --global
bun run setup ironclaw
bun run setup openclaw
bun run setup openclaw --config-path /path/to/openclaw-config.json
bun run setup list
bun run setup uninstall claude
bun run setup uninstall cursor --global
bun run setup uninstall ironclaw
bun run setup uninstall openclaw --config-path /path/to/openclaw-config.json

IronClaw

bun run setup ironclaw
bun run setup uninstall ironclaw

The IronClaw setup writes a stdio MCP entry to ~/.ironclaw/mcp-servers.json and installs this repo's SKILL.md to ~/.ironclaw/skills/aelf-node-skill/SKILL.md.

Important trust model note:

  • Use the trusted skill path above for write-capable flows such as aelf_send_contract_transaction.
  • Do not rely on ~/.ironclaw/installed_skills/ for the primary install path when you need write approval behavior.
  • This MCP server emits both standard MCP camelCase annotations and IronClaw-compatible snake_case annotations so the current IronClaw source can honor read/write hints.

Remote activation contract:

  • GitHub repo/tree URLs are discovery sources only, not the final IronClaw install payload.
  • Preferred IronClaw activation from npm: bunx -p @blockchain-forever/aelf-node-skill aelf-node-setup ironclaw
  • Prefer ClawHub / managed install for OpenClaw when available; otherwise use bunx -p @blockchain-forever/aelf-node-skill aelf-node-setup openclaw
  • Local repo checkout remains a development smoke-test path only.

Minimal smoke test:

  1. bun run setup ironclaw
  2. Ask IronClaw for latest block height on AELF
  3. Ask it to send a contract transaction and confirm approval appears before execution

Installed package users can also run:

aelf-node-setup claude

MCP Config Example

Reference file: mcp-config.example.json

{
  "mcpServers": {
    "aelf-node-skill": {
      "command": "bun",
      "args": ["run", "/ABSOLUTE/PATH/TO/src/mcp/server.ts"],
      "env": {
        "AELF_PRIVATE_KEY": "optional_env_fallback_private_key",
        "PORTKEY_WALLET_PASSWORD": "optional_wallet_password",
        "PORTKEY_CA_KEYSTORE_PASSWORD": "optional_keystore_password"
      }
    }
  }
}

Environment

Copy and edit:

cp .env.example .env
  • AELF_PRIVATE_KEY: optional env fallback for write operations (highest env priority)
  • PORTKEY_PRIVATE_KEY: optional secondary env fallback for shared-skill compatibility
  • Write tools (aelf_send_contract_transaction, aelf_estimate_transaction_fee) resolve signer as explicit -> context -> env
  • PORTKEY_WALLET_PASSWORD: optional password cache for EOA wallet context
  • PORTKEY_CA_KEYSTORE_PASSWORD: optional password cache for CA keystore context
  • PORTKEY_SKILL_WALLET_CONTEXT_PATH: optional override for active context path (~/.portkey/skill-wallet/context.v1.json)
  • signerMode=daemon is reserved and currently returns SIGNER_DAEMON_NOT_IMPLEMENTED
  • AELF_NODE_AELF_RPC_URL: optional override for AELF node
  • AELF_NODE_TDVV_RPC_URL: optional override for tDVV node
  • AELF_NODE_REGISTRY_PATH: optional custom registry path
  • AELF_SDK_INSTANCE_CACHE_MAX: optional max SDK instance cache size (default 32)
  • AELF_SDK_CONTRACT_CACHE_MAX: optional max SDK contract cache size (default 256)
  • AELF_REST_CLIENT_CACHE_MAX: optional max REST client cache size (default 64)

Tool List

MCP tool names:

  • aelf_get_chain_status
  • aelf_get_block_height
  • aelf_get_block
  • aelf_get_transaction_result
  • aelf_get_contract_view_methods
  • aelf_get_system_contract_address
  • aelf_call_contract_view
  • aelf_send_contract_transaction
  • aelf_estimate_transaction_fee
  • aelf_import_node
  • aelf_list_nodes

Architecture

  • src/core/: business orchestration
  • lib/sdk-client.ts: aelf-sdk wrapper
  • lib/rest-client.ts: REST adapter with normalized errors
  • lib/node-router.ts: node resolution and fallback
  • src/mcp/server.ts: MCP adapter
  • aelf_node_skill.ts: CLI adapter
  • index.ts: SDK exports

Testing

bun run test
bun run test:coverage:ci

Security

  • Never put AELF_PRIVATE_KEY in prompts or channel outputs.
  • Active wallet context must not contain plaintext private keys.
  • Use environment variables for all secrets.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选