MCP Clusters API Server
MCP 服务器 - 集群 API v1
这是 Clusters API v1 的模型上下文协议 (MCP) 服务器实现。它提供了身份验证、集群管理、名称注册等端点。
依赖项
{
"@modelcontextprotocol/sdk": "^1.7.0",
"dotenv": "^16.4.7",
"zod": "^3.24.2"
}Related MCP server: MCP Boilerplate
设置
安装依赖项:
npm install创建一个
.env文件,其中包含以下内容:CLUSTERS_API_KEY={CLUSTERS_API_KEY}构建并启动服务器:
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笔记
用实际值替换占位符值(如
0x123...、your-auth-key等)对于大多数端点来说,
testnet参数是可选的所有响应都将采用 JSON-RPC 2.0 格式
对于经过身份验证的端点,请确保获取并包含有效的
authKey服务器使用环境变量进行配置,请确保您的
.env文件已正确设置
替代测试方法
为了方便测试,您可以修改服务器,使用 HTTP 传输协议而非 stdio。这样您就可以使用 curl 命令代替 echo 管道。如果您想切换到 HTTP 传输协议,请告诉我。
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
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