MCP Clusters API Server

Integrations

  • Used for loading environment variables from a .env file to configure the MCP server with API keys.

  • Provides schema validation for the MCP server's request and response data, ensuring type safety for the Clusters API.

MCP サーバー - クラスター API v1

これは、Clusters API v1 用の Model Context Protocol (MCP) サーバー実装です。認証、クラスター管理、名前登録などのエンドポイントを提供します。

依存関係

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

設定

  1. 依存関係をインストールします:
npm install
  1. CLUSTERS_API_KEY={CLUSTERS_API_KEY} を含む.envファイルを作成します。
  2. サーバーをビルドして起動します。
npm run dev

エンドポイントのテスト

このサーバーはStdioServerTransportを使用しているため、JSON-RPC メッセージを stdin 経由で送信する必要があります。各エンドポイントをテストするためのコマンド例を以下に示します。

認証エンドポイント

メッセージを取得

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ファイルが正しく設定されていることを確認してください。

代替試験方法

テストを容易にするために、stdioではなくHTTPトランスポートを使用するようにサーバーを変更することができます。これにより、echoパイプの代わりにcurlコマンドを使用できるようになります。HTTPトランスポートへの切り替えをご希望の場合はお知らせください。

You must be authenticated.

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

ウォレットベースの認証、クラスター管理、および名前登録サービスのエンドポイントを提供するモデル コンテキスト プロトコル サーバー実装。

  1. Dependencies
    1. Setup
      1. Testing Endpoints
        1. Authentication Endpoints
        2. Cluster Management Endpoints
        3. Address ↔ Name Resolution Endpoints
        4. Registration Endpoints
      2. Notes
        1. Alternative Testing Method
          ID: 5wgvkpscux