Hyperlane MCP Server 标志

Hyperlane MCP Server

社区
Suryansh-23

An MCP server to interact with the open & permissionless Hyperlane Protocol. This MCP allows cross-chain messaging, asset transfers, integrating new warp routes & EVM chains into Hyperlane and run hyperlane validator & relayer nodes.

发布者Suryansh-23
代码仓库hyperlane-mcp
语言TypeScript
复刻数
4
星标数
7
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    Hyperlane MCP Server 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 7 个星标和 4 个复刻。

Hyperlane MCP Server

A powerful Model Context Protocol (MCP) server that provides seamless integration with the Hyperlane protocol, enabling LLM assistants to interact with cross-chain messaging and smart contracts across multiple blockchains.

Table of Contents

Overview

The Hyperlane MCP Server bridges the gap between LLM assistants and the Hyperlane cross-chain infrastructure. It provides a standardized interface for deploying chains, managing validators and relayers, sending cross-chain messages, and deploying warp routes for asset transfers.

How It Works

Architecture

The server operates as an MCP (Model Context Protocol) server that:

  1. Connects to Multiple Blockchains: Uses Hyperlane's MultiProvider to manage connections to various blockchain networks
  2. Manages Local Registry: Maintains a local cache of chain metadata, deployed contracts, and warp route configurations
  3. Deploys Infrastructure: Handles deployment of Hyperlane core contracts, validators, and relayers
  4. Facilitates Cross-Chain Operations: Enables message passing and asset transfers between chains
  5. Provides Docker Integration: Runs validators and relayers in Docker containers for isolation

Core Components

  • LocalRegistry: Extends Hyperlane's registry system with local storage capabilities
  • HyperlaneDeployer: Handles deployment of core Hyperlane contracts
  • ValidatorRunner: Manages validator Docker containers
  • RelayerRunner: Manages relayer Docker containers
  • WarpRoute: Handles deployment and management of cross-chain asset routes

Features

Cross-Chain Messaging

  • Send messages between different blockchain networks
  • Monitor message delivery status
  • Handle message verification and execution

Contract Deployment & Management

  • Deploy Hyperlane core contracts to new chains
  • Deploy and configure warp routes for asset transfers
  • Manage contract configurations and upgrades

Infrastructure Management

  • Run validators for message verification
  • Run relayers for message delivery
  • Monitor validator and relayer health
  • Handle Docker container lifecycle

Asset Transfers

  • Deploy warp routes for cross-chain asset transfers
  • Execute multi-hop asset transfers
  • Support various token types (native, synthetic, collateral, etc.)

Requirements

System Requirements

  • Node.js: v18 or higher
  • Package Manager: pnpm (recommended)
  • Docker: For running validators and relayers
  • Operating System: Linux, macOS, or Windows with WSL2

Network Requirements

  • Access to RPC endpoints for target blockchain networks
  • Stable internet connection for cross-chain operations
  • Sufficient bandwidth for Docker image downloads

Blockchain Requirements

  • Private key with sufficient native tokens for gas fees
  • Access to blockchain RPC endpoints
  • Understanding of target chain configurations

Installation & Setup

1. Clone the Repository

bash
git clone https://github.com/yourusername/hyperlane-mcp.git
cd hyperlane-mcp

2. Install Dependencies

bash
# Install pnpm if not already installed
npm install -g pnpm

# Install project dependencies
pnpm install

3. Build the Project

bash
pnpm build

4. Set Up Environment Variables

Create a .env file in the project root:

bash
cp .env.example .env

Edit the .env file with your configuration:

env
# Required: Private key for signing transactions (without 0x prefix)
PRIVATE_KEY=your_private_key_here

# Required: GitHub Personal Access Token for registry access
GITHUB_TOKEN=your_github_personal_access_token

# Optional: Custom cache directory (defaults to ~/.hyperlane-mcp)
CACHE_DIR=/path/to/custom/cache/directory

5. Verify Docker Installation

bash
# Ensure Docker is running
docker --version
docker ps

Configuration

Environment Variables

VariableRequiredDescriptionDefault
PRIVATE_KEYYesPrivate key for transaction signing (without 0x prefix)None
GITHUB_TOKENYesGitHub PAT for accessing Hyperlane registryNone
CACHE_DIRNoDirectory for storing local data~/.hyperlane-mcp
HOMENoHome directory (fallback for CACHE_DIR)System default

MCP Client Configuration

For Claude Desktop or other MCP clients, add this configuration:

json
{
  "mcpServers": {
    "hyperlane": {
      "command": "node",
      "args": [
        "/path/to/hyperlane-mcp/build/index.js"
      ],
      "env": {
        "PRIVATE_KEY": "your_private_key",
        "GITHUB_TOKEN": "your_github_token"
        "CACHE_DIR": "your_cache_dir"
      }
    }
  }
}

Usage

Starting the Server

bash
# Development mode
pnpm start

# Production mode
node build/index.js

# With MCP Inspector (for debugging)
pnpm inspect

Basic Workflow

  1. Deploy a New Chain: Use deploy-chain tool to add a new blockchain
  2. Run Validator: Use run-validator to start message validation
  3. Run Relayer: Use run-relayer to enable message delivery
  4. Deploy Warp Route: Use deploy-warp-route for asset transfers
  5. Send Messages/Assets: Use transfer tools for cross-chain operations

Available Tools

Chain Management

  • deploy-chain: Deploy Hyperlane core contracts to a new chain
  • run-validator: Start a validator for a specific chain
  • run-relayer: Start a relayer for cross-chain message delivery

Cross-Chain Operations

  • cross-chain-message-transfer: Send messages between chains
  • cross-chain-asset-transfer: Transfer assets using warp routes

Warp Route Management

  • deploy-warp-route: Deploy new warp routes for asset transfers

Resources

  • Warp Route Configs: Access via hyperlane-warp:///{symbol}/{/chain*} URI

Project Structure

hyperlane-mcp/
├── src/                          # Source code
│   ├── index.ts                  # Main MCP server entry point
│   ├── localRegistry.ts          # Local registry implementation
│   ├── hyperlaneDeployer.ts      # Core contract deployment
│   ├── RunValidator.ts           # Validator Docker management
│   ├── RunRelayer.ts             # Relayer Docker management
│   ├── warpRoute.ts              # Warp route deployment
│   ├── msgTransfer.ts            # Message transfer logic
│   ├── assetTransfer.ts          # Asset transfer logic
│   ├── config.ts                 # Configuration utilities
│   ├── utils.ts                  # Utility functions
│   ├── types.ts                  # Type definitions
│   ├── logger.ts                 # Logging configuration
│   ├── gcr.ts                    # Google Container Registry utilities
│   ├── file.ts                   # File system utilities
│   ├── configOpts.ts             # Configuration options
│   └── consts.ts                 # Constants
├── build/                        # Compiled JavaScript output
├── node_modules/                 # Dependencies
├── package.json                  # Project configuration
├── tsconfig.json                 # TypeScript configuration
├── .env                          # Environment variables (create this)
└── README.md                     # This file

Files & Folders Created

The server creates and manages several directories and files during operation:

Cache Directory Structure

~/.hyperlane-mcp/                 # Main cache directory
├── chains/                       # Chain configurations
│   ├── {chainName}.yaml          # Chain metadata
│   ├── {chainName}.deploy.yaml   # Deployed contract addresses
│   └── {chainName}-core-config.yaml # Core deployment config
├── routes/                       # Warp route configurations
│   └── {symbol}-{hash}.yaml      # Warp route configs
├── agents/                       # Agent configurations
│   └── {chainName}-agent-config.json # Validator/relayer configs
└── logs/                         # Runtime data and logs
    ├── hyperlane_db_validator_{chain}/ # Validator database
    ├── hyperlane_db_relayer/     # Relayer database
    └── hyperlane-validator-signatures-{chain}/ # Validator signatures

File Types Created

Chain Configuration Files

  • {chainName}.yaml: Contains chain metadata (RPC URLs, chain ID, native token info)
  • {chainName}.deploy.yaml: Deployed contract addresses (mailbox, ISM, hooks, etc.)
  • {chainName}-core-config.yaml: Core deployment configuration

Warp Route Files

  • {symbol}-{hash}.yaml: Warp route configuration for cross-chain asset transfers

Agent Configuration Files

  • {chainName}-agent-config.json: Configuration for validators and relayers

Docker Volumes

  • Validator databases: Persistent storage for validator state
  • Relayer databases: Persistent storage for relayer state
  • Signature storage: Validator checkpoint signatures

Temporary Files

  • Docker containers: Validator and relayer containers (managed automatically)
  • Log files: Runtime logs from validators and relayers

Examples

1. Deploy a New Chain

Deploy Hyperlane core contracts to a new blockchain called "mytestnet" with chain ID 12345, RPC URL "https://rpc.mytestnet.com", native token symbol "MTN", and token name "MyTestNet Token". This should be marked as a testnet.

2. Send Cross-Chain Message

Send a cross-chain message from Ethereum to Polygon. The recipient address should be 0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8b6 and the message body should be "Hello from Ethereum!"

3. Deploy Warp Route

Deploy a warp route for asset transfers between Ethereum and Arbitrum chains. Use collateral token type for Ethereum and synthetic token type for Arbitrum.

4. Transfer Assets

Transfer assets using the USDC warp route from Ethereum to Arbitrum. Transfer 100 USDC to recipient address 0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8b6. First, fetch the warp route configuration for USDC on these chains using the resources.

5. Run Infrastructure

Start a validator for the "mytestnet" chain that we deployed earlier.
Start a relayer to handle message delivery between Ethereum and mytestnet chains. Use "mytestnet" as the validator chain name.

6. Multi-Chain Asset Transfer

Transfer 50 USDC from Ethereum to Polygon, then from Polygon to Arbitrum, using the existing USDC warp routes. The final recipient should be 0x742d35Cc6634C0532925a3b8D4C9db96c4b4d8b6.

7. Check Warp Route Resources

Show me the available warp route configurations for USDC token across Ethereum and Polygon chains.

8. Deploy Custom Token Route

Deploy a new warp route for a custom token called "MyToken" (symbol: MTK) between three chains: Ethereum (collateral type), Polygon (synthetic type), and Arbitrum (synthetic type).

Troubleshooting

Common Issues

1. Docker Permission Errors

bash
# Add user to docker group (Linux)
sudo usermod -aG docker $USER
# Restart shell or logout/login

2. Insufficient Gas Fees

  • Ensure your wallet has sufficient native tokens for gas
  • Check current gas prices on target networks

3. RPC Connection Issues

  • Verify RPC URLs are accessible
  • Check for rate limiting on RPC providers
  • Consider using multiple RPC endpoints

4. Container Startup Failures

bash
# Check Docker logs
docker logs <container_id>

# Verify Docker image availability
docker pull gcr.io/abacus-labs-dev/hyperlane-agent:agents-v1.4.0

Debug Mode

Run with MCP Inspector for detailed debugging:

bash
pnpm inspect

Log Files

Check logs in the cache directory:

bash
# Validator logs
tail -f ~/.hyperlane-mcp/logs/validator-{chain}.log

# Relayer logs  
tail -f ~/.hyperlane-mcp/logs/relayer.log

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Code Style

  • Use TypeScript for all new code
  • Follow existing code formatting (Prettier)
  • Add JSDoc comments for public APIs
  • Include error handling

Authors

License

This project is licensed under the MIT License.

Disclaimer

The software is provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the software. It has not been audited and as such there can be no assurance it will work as intended. Users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk.

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "yourusername-hyperlane-mcp": {
      "command": "",
      "args": []
    }
  }
}

将 Hyperlane MCP Server MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Hyperlane MCP Server 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 Hyperlane MCP Server 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Hyperlane MCP Server MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "yourusername-hyperlane-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "hyperlane-mcp"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Hyperlane MCP Server MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Hyperlane MCP Server MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Hyperlane MCP Server 帮我完成这项任务吗?
Hyperlane MCP Server
当然,我看过了。
以下是我使用 Hyperlane MCP Server 得到的结果。

常见问题

Hyperlane MCP Server MCP 服务器有什么用途?

Hyperlane MCP Server 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Hyperlane MCP Server MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 Hyperlane MCP Server。

为什么在 TypingMind 中使用 Hyperlane MCP Server MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 Hyperlane MCP Server 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Hyperlane MCP Server MCP 连接到 TypingMind?

Hyperlane MCP Server 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Hyperlane MCP Server MCP 在 TypingMind 中提供哪些工具?

Hyperlane MCP Server 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Hyperlane MCP Server MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 Hyperlane MCP Server 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇