Skip to main content
Glama

MCP Clusters API Server

by ayv8er

MCP 服务器 - 集群 API v1

这是 Clusters API v1 的模型上下文协议 (MCP) 服务器实现。它提供了身份验证、集群管理、名称注册等端点。

依赖项

{ "@modelcontextprotocol/sdk": "^1.7.0", "dotenv": "^16.4.7", "zod": "^3.24.2" }

设置

  1. 安装依赖项:
npm install
  1. 创建一个.env文件,其中包含以下内容:CLUSTERS_API_KEY={CLUSTERS_API_KEY}
  2. 构建并启动服务器:
npm run dev

测试端点

由于此服务器使用StdioServerTransport ,因此您需要通过 stdin 发送 JSON-RPC 消息。以下是用于测试每个端点的示例命令:

身份验证端点

获取消息
echo '{"jsonrpc":"2.0","id":1,"method":"auth_get_message","params":{"address":"0x123...","chainId":1,"nonce":"abc123"}}' | node dist/index.js
获取令牌
echo '{"jsonrpc":"2.0","id":1,"method":"auth_get_token","params":{"signature":"0x123...","signingDate":"2024-03-21","type":"evm","wallet":"0x123..."}}' | node dist/index.js
验证令牌
echo '{"jsonrpc":"2.0","id":1,"method":"auth_validate_token","params":{"authKey":"your-auth-key"}}' | node dist/index.js

集群管理端点

创建集群
echo '{"jsonrpc":"2.0","id":1,"method":"create_cluster","params":{"wallets":[{"address":"0x123...","name":"MyWallet","isPrivate":false}],"authKey":"your-auth-key","testnet":false}}' | node dist/index.js
通过 ID 获取集群
echo '{"jsonrpc":"2.0","id":1,"method":"get_cluster_by_id","params":{"id":"cluster-id","testnet":false}}' | node dist/index.js
通过名称获取集群
echo '{"jsonrpc":"2.0","id":1,"method":"get_cluster_by_name","params":{"name":"cluster-name","testnet":false}}' | node dist/index.js
通过地址获取集群ID
echo '{"jsonrpc":"2.0","id":1,"method":"get_cluster_id_by_address","params":{"address":"0x123...","testnet":false}}' | node dist/index.js
添加钱包
echo '{"jsonrpc":"2.0","id":1,"method":"add_wallets","params":{"wallets":[{"address":"0x123...","name":"NewWallet","isPrivate":false}],"authKey":"your-auth-key","testnet":false}}' | node dist/index.js
生成钱包
echo '{"jsonrpc":"2.0","id":1,"method":"generate_wallet","params":{"type":"evm","name":"NewWallet","isPrivate":false,"authKey":"your-auth-key","testnet":false}}' | node dist/index.js
更新钱包
echo '{"jsonrpc":"2.0","id":1,"method":"update_wallets","params":{"wallets":[{"address":"0x123...","name":"UpdatedName"}],"authKey":"your-auth-key","testnet":false}}' | node dist/index.js
移除钱包
echo '{"jsonrpc":"2.0","id":1,"method":"remove_wallets","params":{"addresses":["0x123..."],"authKey":"your-auth-key","testnet":false}}' | node dist/index.js
验证钱包
echo '{"jsonrpc":"2.0","id":1,"method":"verify_wallet","params":{"clusterId":"cluster-id","authKey":"your-auth-key","testnet":false}}' | node dist/index.js

地址 ↔ 名称解析端点

通过地址获取数据
echo '{"jsonrpc":"2.0","id":1,"method":"get_data_by_address","params":{"address":"0x123...","testnet":false}}' | node dist/index.js
通过地址获取批量数据
echo '{"jsonrpc":"2.0","id":1,"method":"get_bulk_data_by_addresses","params":{"addresses":["0x123...","0x456..."],"testnet":false}}' | node dist/index.js
根据名称获取批量数据
echo '{"jsonrpc":"2.0","id":1,"method":"get_bulk_data_by_names","params":{"names":[{"name":"name1"}],"testnet":false}}' | node dist/index.js

注册端点

检查名称是否可用
echo '{"jsonrpc":"2.0","id":1,"method":"check_name_availability","params":{"names":["name1","name2"]}}' | node dist/index.js
获取注册标志数据
echo '{"jsonrpc":"2.0","id":1,"method":"get_registration_sign_data","params":{"network":"1","sender":"0x123...","names":[{"name":"name1","amountWei":"1000000000000000000"}],"referralClusterId":"optional-id","testnet":false}}' | node dist/index.js
获取交易状态
echo '{"jsonrpc":"2.0","id":1,"method":"get_transaction_status","params":{"txHash":"0x123..."}}' | node dist/index.js

笔记

  1. 用实际值替换占位符值(如0x123...your-auth-key等)
  2. 对于大多数端点来说, testnet参数是可选的
  3. 所有响应都将采用 JSON-RPC 2.0 格式
  4. 对于经过身份验证的端点,请确保获取并包含有效的authKey
  5. 服务器使用环境变量进行配置,请确保您的.env文件已正确设置

替代测试方法

为了方便测试,您可以修改服务器,使用 HTTP 传输协议而非 stdio。这样您就可以使用 curl 命令代替 echo 管道。如果您想切换到 HTTP 传输协议,请告诉我。

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器实现,为基于钱包的身份验证、集群管理和名称注册服务提供端点。

  1. 依赖项
    1. 设置
      1. 测试端点
        1. 身份验证端点
        2. 集群管理端点
        3. 地址 ↔ 名称解析端点
        4. 注册端点
      2. 笔记
        1. 替代测试方法

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server implementation for interacting with Salesforce through its REST API.
            Last updated -
            4
            10
            TypeScript
          • A
            security
            F
            license
            A
            quality
            A Model Context Protocol server that provides tools to manage Keycloak users and realms, allowing you to create and delete users, list available realms, and view users in specific realms.
            Last updated -
            4
            36
            12
            TypeScript
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides tools for managing providers, clients, tenants, and access tokens through the UseGrant platform.
            Last updated -
            26
            116
            JavaScript
            MIT License
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that enables interactions with the Hedera network, providing tools for wallet creation, balance checking, transaction building, and sending signed transactions.
            Last updated -
            JavaScript

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/ayv8er/mcp-clusters-api-v1'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server