区块链数据访问服务

通过Helius API为Claude提供Solana区块链数据访问的服务,支持查询钱包余额、获取区块链信息及与代币和NFT交互等功能。

  • by dcSpark
  • TypeScript
  • 本地部署
  • 14 星标
  • 更新于
在 GitHub 查看 dcSpark/mcp-server-helius

使用说明

MCP Helius

该存储库包含一个模型上下文协议(MCP)服务器,该服务器通过Helius API为Claude提供对Solana区块链数据的访问。该服务器使Claude能够执行检查钱包余额、获取区块链信息以及与Solana区块链上的代币和NFT交互等操作。

概述

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

基本区块链操作

  • helius_get_balance:获取Solana钱包地址的余额
  • helius_get_block_height:获取Solana区块链的当前区块高度
  • helius_get_slot:获取Solana区块链的当前插槽
  • helius_get_latest_blockhash:从Solana区块链获取最新的blockhash
  • helius_get_transaction:通过签名获取交易
  • helius_get_account_info:获取Solana地址的帐户信息
  • helius_get_signatures_for_address:获取Solana地址的交易签名
  • helius_get_multiple_accounts:获取有关多个Solana帐户的信息
  • helius_get_program_accounts:获取程序拥有的所有帐户

令牌操作

  • helius_get_token_accounts_by_owner:获取Solana地址拥有的令牌帐户
  • helius_get_token_supply:获取代币供应
  • helius_get_token_account_balance:获取代币账户的余额
  • helius_get_token_accounts:按造币厂或所有者获取代币账户

NFT和数字资产

  • helius_get_asset:通过ID获取数字资产的详细信息
  • helius_get_rwa_asset:通过ID获取真实资产的详细信息
  • helius_get_asset_batch:通过ID获取多个资产的详细信息
  • helius_get_asset_proof:获取数字资产的证明
  • helius_get_assets_by_group:按组键和值获取资产
  • helius_get_assets_by_owner:获取特定地址拥有的资产
  • helius_get_assets_by_creator:获取由特定地址创建的资产
  • helius_get_assets_by_authority:按授权地址获取资产
  • helius_search_assets:使用各种过滤器(ownerAddress、creatorAddress、压缩等)搜索资产
  • helius_get_signatures_for_asset:获取与资产关联的签名
  • helius_get_nft_editions:获取NFT主版

区块链系统信息

  • helius_get_minimum_balance_for_rent_exemption:获得免租所需的最低余额
  • helius_get_inflation_reward:获得地址列表的通货膨胀奖励
  • helius_get_epoch_info:获取当前纪元的信息
  • helius_get_epoch_schedule:获取纪元时间表
  • helius_get_leader_schedule:获取一个时代的领导者时间表
  • helius_get_recent_performance_samples:获取最近的性能示例
  • helius_get_version:获取Solana节点的版本

交易和收费方式

  • helius_get_priority_fee_estimate:获取交易的优先费用估算
  • helius_poll_transaction_confirmation:查询交易确认状态
  • helius_send_jito_bundle:向Jito发送一组交易
  • helius_get_bundle_statuses:获取Jito捆绑包的状态
  • helius_get_fee_for_message:获取序列化消息的费用
  • helius_execute_jupiter_swap:使用Jupiter执行代币交换

先决条件

安装

  1. 克隆此存储库:

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

    npm ci
    
  3. 构建项目:

    npm run build
    

配置

配置Claude桌面

要配置Claude Desktop以使用此MCP服务器,请执行以下操作:

  1. 打开克劳德桌面

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

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 窗户: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  3. 添加MCP服务器配置:

{
  "mcpServers": {
    "mcp-server-helius": {
      "command": "npx",
      "args": [
        "-y",
        "@mcp-dockmaster/mcp-server-helius"
      ],
      "env": {
        "HELIUS_API_KEY": "your-helius-api-key"
      }
    }
  }
}

本地运行

HELIUS_API_KEY=your-helius-api-key node build/index.js

您也可以直接使用npx运行:

HELIUS_API_KEY=your-helius-api-key npx @dcspark/mcp-server-helius

用法

配置后,重新启动Claude Desktop。Claude现在可以访问Solana区块链工具。你可以要求克劳德:

  1. 检查钱包余额:

    What's the balance of the Solana wallet address 5YNmS1R9nNSCDzb5a7mMJ1dwK9uHeAAF4CmPEwKgVWr8?
    
  2. 获取当前块高度:

    What's the current block height on Solana?
    
  3. 获取NFT的信息:

    What NFTs does the wallet address 5YNmS1R9nNSCDzb5a7mMJ1dwK9uHeAAF4CmPEwKgVWr8 own?
    

Claude将使用MCP服务器通过Helius直接从Solana区块链获取此信息。

发展

添加新工具

要向MCP服务器添加新工具,请执行以下操作:

  1. 在中定义工具 src/tools.ts
  2. 在相应的处理程序文件中创建处理程序函数
  3. 将处理程序添加到 handlers 对象在 src/tools.ts

建筑

npm run build

许可证

麻省理工学院