LayerZero OFT MCP Server

LayerZero OFT MCP Server

A TypeScript/Node.js server that enables creating, deploying, and bridging Omnichain Fungible Tokens (OFTs) across multiple blockchains using LayerZero protocols.

Category
访问服务器

README

LayerZero OFT MCP Server

LayerZero OFT MCP is a TypeScript/Node.js Model Context Protocol (MCP) server for creating, deploying, and bridging Omnichain Fungible Tokens (OFTs) across multiple blockchains. Interactions are primarily managed via ethers.js, leveraging LayerZero contracts and protocols for cross-chain communication.

This MCP abstracts the complexity of omnichain token creation and cross-chain interactions by providing a structured, context-aware layer for initiating, managing, and bridging OFTs. It is designed for easy integration with LLM agents, bots, or applications that require secure and reliable access to decentralized cross-chain functionality.

Deterministic Cross-Chain Contract Addressing
The MCP uses Solidity's CREATE2 opcode to deploy OFT contracts at the same address on every chain. The address is derived from the bytecode and a fixed salt, which includes currently the <i>token name and symbol</i>. Make sure you use unique identifiers when deploying, because you cannot create two times the same token (same name and symbol) using the same factory.

It’s a working starting point. You can bring your own OFT contract and expand it with custom features or token logic. The system is open and extendable by design.

Features & Tools

This MCP server exposes the following tools for interaction:

1. deploy-and-configure-oft-multichain

  • Description: Deploys an Omnichain Fungible Token (OFT) contract to one or more specified LayerZero-supported chains. After successful deployments, it configures each new OFT contract to be a peer with all other newly deployed OFTs in the set. It also sets standard enforced options (e.g., for gas limits) on each contract to enable cross-chain transfers to its peers.
  • Parameters:
    • tokenName (string): Name of the token (e.g., "MyToken").
    • tokenSymbol (string): Symbol of the token (e.g., "MYT").
    • initialTotalSupply (string): Total supply of the token in human-readable format (e.g., "1000000"). This will be parsed using the decimals value.
    • decimals (number, Optional, default: 18): Number of decimals for the token.
    • targetChains (array of strings): List of chain names (from the configured NETWORKS in utils.ts, e.g., ["Arbitrum sepolia", "baseSepolia"]) to deploy and configure the OFT on. Must select at least one. For peering to occur, at least two chains must be specified and result in successful deployments.
    • owner (string, Optional): The Ethereum address to be the owner of the deployed contracts. If not provided, defaults to the OWNER_ADDRESS set in the .env file.
  • Output: Details the success or failure of deployments on each target chain, peering status between them, and the status of setting enforced options.

2. bridge-oft

  • Description: Bridges OFT tokens from one chain to another using LayerZero.
  • Parameters:
    • tokenAddress (string): The address of the OFT contract on the source chain.
    • amount (string): The amount of tokens to bridge (e.g., "100"). This is parsed assuming 18 decimals; ensure your token uses this or modify the tool if necessary.
    • fromChain (string): The source chain name (e.g., "Arbitrum sepolia").
    • toChain (string): The destination chain name (e.g., "baseSepolia").
    • receiverAddress (string): The address to receive tokens on the destination chain.
    • extraOptions (string, optional, default: "0x"): Extra options for LayerZero message execution.
  • Output: Details of the bridging transaction, including the transaction hash.

IMPORTANT: Configure ABI and Bytecode

Before running the server, you MUST replace theses paths with the absolute path to your contract artifacts

// --- index.ts ---

// Replace these paths with the actual ABI and Bytecode JSON file of your OFT contract (e.g., from MyOFT.sol)  
const oftPath = resolve(  
  "D:\\Dev\\layerzero-mcp\\artifacts\\MyOFT\\MyOFT.json"  
);  
// Same here for the factory contract  
// This should point to the CREATE2Factory ABI and Bytecode JSON file  
const factoryPath = resolve(  
  "D:\\Dev\\layerzero-mcp\\artifacts\\factory\\CREATE2Factory.json"  
);  
// --- --- ---  

Failure to do so will result in errors when attempting to use the deploy-and-configure-oft-multichain tool. The bridge-oft tool also requires the OFT_ABI to be correctly set for interacting with existing contracts.

Setup

Prerequisites

  • Node.js (v16 or higher recommended)
  • npm or yarn
  • Access to an LLM or application that can communicate via the Model Context Protocol (e.g., Claude for Desktop).

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/layerzero-oft-mcp.git
    cd layerzero-oft-mcp
    
  2. Install dependencies:

    npm install
    # or
    yarn install
    
  3. Create a .env file: Copy the .env.example (if provided) or create a new .env file in the root of the project and populate it with your details:

    PRIVATE_KEY="your_hex_encoded_private_key_here"
    OWNER_ADDRESS="your_owner_ethereum_address_here"
    ARBITRUM_SEPOLIA_RPC_URL="your_Arbitrum sepolia_testnet_rpc_url_here"
    BASE_SEPOLIA_RPC_URL="your_base_sepolia_testnet_rpc_url_here"
    ARBITRUM_FACTORY_ADDRESS="0x754a2643Ce68e0e34510B1E246254f93946AE3a1"
    BASE_FACTORY_ADDRESS="0x754a2643Ce68e0e34510B1E246254f93946AE3a1"
    
    # Add other RPC URL env variables if you configure more networks in utils.ts
    

    Security Note: Never commit your .env file containing private keys to a public repository.

  4. Update ABI and Bytecode: As mentioned in the "IMPORTANT" section above, open layerzero-mcp.ts and replace OFT_ABI and OFT_BYTECODE placeholders with your actual contract details.

  5. Build the project (if using TypeScript compilation):

    npm run build
    # or
    yarn run build
    

    (This command assumes you have a build script in your package.json that compiles TypeScript to JavaScript, e.g., tsc)

Configure the MCP for Claude for Desktop (Example)

Add the MCP configuration to your Claude for Desktop configuration file (typically found at C:\Users\{User}\AppData\Roaming\Claude\claude_desktop_config.json on Windows):

{
    "layerzero-oft-mcp": {
        "command": "node",
        "args": [
            "<PROJECT_ABSOLUTE_FILEPATH>/build/index.js"
        ],
        "env": {
            "PRIVATE_KEY": "your_hex_encoded_private_key_here",
            "OWNER_ADDRESS": "your_owner_ethereum_address_here",
            "ARBITRUM_SEPOLIA_RPC_URL": "your_Arbitrum_sepolia_testnet_rpc_url_here",
            "BASE_SEPOLIA_RPC_URL": "your_base_sepolia_testnet_rpc_url_here",
            "ARBITRUM_FACTORY_ADDRESS": "0x754a2643Ce68e0e34510B1E246254f93946AE3a1",
            "BASE_FACTORY_ADDRESS": "0x754a2643Ce68e0e34510B1E246254f93946AE3a1"
        }
    }
}
  • Replace <PROJECT_ABSOLUTE_FILEPATH> with the actual absolute path to your project directory.
  • Ensure the env variables here match those required by your server, or that they are correctly picked up from your .env file if your Node.js setup loads them (the dotenv.config() call in the scripts should handle this). For Claude Desktop, explicitly setting them in claude_desktop_config.json is required.

Follow the official MCP guide for more details on testing with Claude for Desktop.

Running the Application & Example Usage

Once configured (including ABI/Bytecode and environment variables), the MCP server will be launched by the host application (e.g., Claude for Desktop) when needed.

You can then interact with it using natural language prompts if using an LLM. For example:

To deploy and configure a new OFT: "Deploy a new OFT named 'OmniCoin' (OMC) with a total supply of 500,000 tokens across both Arbitrum sepolia and Base Sepolia testnets."

This will use the deploy-and-configure-oft-multichain tool.

To bridge existing OFT tokens: "Bridge 50 MyOFT from Arbitrum sepolia to Base Sepolia to address 0x123...abc. The token is deployed at 0xabc...123 on Arbitrum sepolia."

This will use the bridge-oft tool.

NOTE: Ensure you have sufficient gas tokens (e.g., testnet ETH or MATIC) on the respective chains for the account associated with your PRIVATE_KEY to cover deployment and bridging transaction fees.

Example Screenshots

Deploying an OFT

Example: Deploying an OFT

Bridging an OFT

Example: Bridging an OFT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选