Zetrix MCP Server
OfficialZetrix MCP 服务器
一个用于与 Zetrix 区块链交互的综合模型上下文协议 (MCP) 服务器。提供跨 7 个类别的 55 个工具 — HTTP RPC、WebSocket (protobuf)、SDK 交易、密码学和智能合约开发。支持 stdio 和 HTTP 传输模式。
Zetrix 货币信息
原生代币: ZETRIX
主单位: ZETRIX
基础单位: ZETA
换算: 1 ZETRIX = 1,000,000 ZETA
Gas 价格: 通过
testTransaction动态评估
Related MCP server: MCP Crypto Wallet EVM
快速入门
npx zetrix-mcp-server或全局安装:
npm install -g zetrix-mcp-server指南:
QUICKSTART.md — 5 分钟内完成设置
EXAMPLES.md — 通过 20 多个示例学习
功能 (56 个工具)
常规 (1 个工具)
工具 | 描述 |
| 获取 MCP 服务器版本和网络信息 |
HTTP RPC (16 个工具)
工具 | 描述 |
| 检查节点健康状态 |
| 获取账户信息,包括余额和元数据 |
| 按高度获取区块 |
| 获取最新区块 |
| 按哈希获取交易 |
| 获取 ZETA 和 ZETRIX 余额 |
| 生成新密钥对(仅限测试) |
| 获取基本账户信息 |
| 获取资产持有情况 |
| 获取账户元数据 |
| 获取已完成的交易 |
| 获取待处理交易 |
| 获取账本/区块信息 |
| 执行多个查询 |
| 将交易序列化为十六进制 |
| 提交已签名的交易 |
合约查询 (2 个工具)
工具 | 描述 |
| 在沙盒中调用合约(只读) |
| 评估费用而不提交 |
WebSocket — 实时 (5 个工具)
使用 protobuf 二进制编码 与 Zetrix 节点通信。
工具 | 描述 |
| 通过 protobuf CHAIN_HELLO 连接并注册 |
| 提交带有实时状态的交易 |
| 订阅交易通知 |
| 断开 WebSocket 连接 |
| 检查连接状态 |
SDK 查询 (5 个工具)
工具 | 描述 |
| 创建新账户 |
| 通过 SDK 获取余额 |
| 检查账户是否已激活 |
| 获取账户 nonce |
| 通过 SDK 调用合约(只读) |
SDK 交易 (11 个工具)
所有交易工具都使用 evaluateFee (testTransaction) 进行动态 Gas 定价。所有操作均支持可选的 gasPrice/feeLimit 覆盖。
工具 | 描述 |
| 向另一个地址发送原生 ZETRIX |
| 使用初始余额激活新账户 |
| 在账户上设置键值元数据 |
| 设置账户权重、阈值和签名者 |
| 发行新的自定义代币 |
| 转移自定义代币 |
| 部署智能合约(可选所有者) |
| 使用 Gas 支付调用合约 |
| 通过资产转移调用合约 |
| 升级合约代码和/或转移所有权 |
| 创建链上事件日志 |
密码学 (8 个工具)
工具 | 描述 |
| 生成新密钥对(地址、私钥、公钥) |
| 从私钥导出公钥 |
| 从公钥获取地址 |
| 验证私钥、公钥或地址格式 |
| 使用私钥对消息(十六进制)进行签名 |
| 验证签名 |
| 使用密码加密私钥 |
| 解密已加密的私钥 |
智能合约开发 (7 个工具)
工具 | 描述 |
| Chain 对象函数文档 |
| Utils 对象函数文档 |
| 合约结构和 ES5 模式指南 |
| 代币标准规范 (ZTP20, ZTP721, ZTP1155) |
| 通过 |
| 生成多类合约架构 |
| 测试指南 (TEST_INVOKE, TEST_QUERY) |
支持的网络
网络 | HTTP RPC | WebSocket |
主网 |
|
|
测试网 |
|
|
配置
环境变量
变量 | 描述 | 默认值 |
| 网络选择 ( |
|
| 自定义 HTTP RPC 端点(覆盖网络默认值) | — |
| 自定义 WebSocket 端点(覆盖网络默认值) | — |
| 传输模式 ( |
|
| HTTP 服务器端口(仅在 |
|
| 用于签署交易的默认私钥(可选,防止密钥泄露到对话中) | — |
| 交易的默认源地址(可选) | — |
安全交易(推荐)
通过将 ZETRIX_PRIVATE_KEY 和 ZETRIX_SOURCE_ADDRESS 设置为环境变量,您的私钥永远不会暴露在对话中。LLM 可以执行诸如“发送 0.01 ZETRIX 到 ZTX3...”之类的交易,而无需查看您的密钥。
{
"mcpServers": {
"zetrix": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "testnet",
"ZETRIX_PRIVATE_KEY": "your-private-key-here",
"ZETRIX_SOURCE_ADDRESS": "your-zetrix-address-here"
}
}
}
}注意: 这些是可选的。如果未设置,LLM 将需要在对话中询问或被告知私钥和源地址。如果已设置,它们将用作默认值 — 您仍然可以在需要时在每次工具调用中覆盖它们。
Claude Code (CLI)
直接从命令行添加 MCP 服务器:
主网:
claude mcp add zetrix-mainnet -s user -- npx -y zetrix-mcp-server -e ZETRIX_NETWORK=mainnet测试网:
claude mcp add zetrix-testnet -s user -- npx -y zetrix-mcp-server -e ZETRIX_NETWORK=testnet使用自定义 RPC 和 WebSocket URL:
claude mcp add zetrix-testnet -s user -- npx -y zetrix-mcp-server \
-e ZETRIX_NETWORK=testnet \
-e ZETRIX_RPC_URL=https://your-node.example.com \
-e ZETRIX_WS_URL=wss://your-ws-node.example.comClaude Desktop
编辑您的 Claude Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonWindows (Microsoft Store):
%LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json
测试网:
{
"mcpServers": {
"zetrix": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "testnet"
}
}
}
}主网:
{
"mcpServers": {
"zetrix": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "mainnet"
}
}
}
}两个网络(主网 + 测试网):
{
"mcpServers": {
"zetrix-mainnet": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "mainnet"
}
},
"zetrix-testnet": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "testnet"
}
}
}
}使用自定义 RPC 和 WebSocket URL:
{
"mcpServers": {
"zetrix": {
"command": "npx",
"args": ["-y", "zetrix-mcp-server"],
"env": {
"ZETRIX_NETWORK": "testnet",
"ZETRIX_RPC_URL": "https://your-node.example.com",
"ZETRIX_WS_URL": "wss://your-ws-node.example.com"
}
}
}
}保存配置文件后,重启 Claude Desktop 以使更改生效。
注意:
ZETRIX_RPC_URL和ZETRIX_WS_URL会覆盖所选网络的默认端点。您可以仅覆盖其中一个或两个。如果未设置,则使用上表中的默认值。
HTTP 传输 (API 服务器)
使用 Streamable HTTP 传输将 MCP 服务器作为 HTTP API 服务器运行。这允许远程 MCP 客户端通过网络连接。
启动服务器(默认为主网):
ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 npx zetrix-mcp-server使用测试网:
ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 ZETRIX_NETWORK=testnet npx zetrix-mcp-server端点:
端点 | 方法 | 描述 |
| POST | MCP 协议端点 (Streamable HTTP) |
| GET | 健康检查 — 返回 |
从 MCP 客户端连接:
{
"mcpServers": {
"zetrix": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}两个网络(主网 + 测试网):
在不同端口上运行两个服务器:
ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 ZETRIX_NETWORK=mainnet npx zetrix-mcp-server &
ZETRIX_TRANSPORT=http ZETRIX_PORT=3001 ZETRIX_NETWORK=testnet npx zetrix-mcp-server &然后配置您的 MCP 客户端:
{
"mcpServers": {
"zetrix-mainnet": {
"type": "http",
"url": "http://localhost:3000/mcp"
},
"zetrix-testnet": {
"type": "http",
"url": "http://localhost:3001/mcp"
}
}
}注意: HTTP 传输使用 MCP Streamable HTTP 规范。任何支持
StreamableHTTP传输的 MCP 客户端都可以连接到它。
服务器日志:
服务器将日志记录到 stderr。要查看日志,请在前台运行或重定向到文件:
# Foreground — logs show directly in terminal
ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 npx zetrix-mcp-server
# Background with logs to file
ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 npx zetrix-mcp-server 2> server.log &
tail -f server.log开发
项目结构
zetrix-mcp-server/
├── src/
│ ├── index.ts # MCP server (55 tool definitions + handlers)
│ ├── zetrix-client.ts # HTTP RPC client
│ ├── zetrix-sdk.ts # SDK wrapper (11 transaction operations)
│ ├── zetrix-websocket.ts # WebSocket client (protobuf binary)
│ ├── zetrix-encryption.ts # Crypto operations
│ ├── zetrix-contract-docs.ts # Contract documentation
│ └── zetrix-contract-generator.ts # Contract code generator
├── tests/
│ ├── test-server.js # HTTP RPC tests
│ ├── test-sdk.js # SDK tests
│ └── test-encryption.js # Crypto tests
├── docs/
│ ├── TEST_REPORT.md # Comprehensive test results
│ ├── DEVELOPER_GUIDE.md # Developer documentation
│ ├── ZETRIX_CONTRACT_DEVELOPMENT_RULES.md
│ ├── QUICKSTART.md # 5-minute setup guide
│ └── EXAMPLES.md # 20+ usage examples
└── dist/ # Compiled output构建
npm install
npm run build测试
npm test # HTTP RPC tests
ZETRIX_NETWORK=testnet npm test # Run on testnet
npm run test:sdk # SDK tests
npm run test:encryption # Crypto tests许可证
MIT
Available Tools
44 toolszetrix_call_contractB
Call smart contract in sandbox environment for debugging
Inputs: contractAddress, code, input, contractBalance, +4 more.
zetrix_check_healthB
Check the health status of the Zetrix node
Inputs: no named parameters.
zetrix_contract_generate_advancedA
Generate advanced multi-class Zetrix smart contract with interfaces, libraries, utilities, main contract, and comprehensive test specs. MANDATORY WORKFLOW: (1) First call zetrix_contract_init_dev_environment with contractName (e.g., 'CertificateContract'). (2) Then call this tool with the SAME contractName and outputDirectory set to './{contractName}'. Calling this tool WITHOUT initializing the project first will result in an error. Supports complex architectures with inheritance, composition, and modular design.
Inputs: contractName (required), contractType (required), features, tokenStandard, +2 more.
zetrix_contract_get_chain_functionsA
Get documentation for all built-in Chain object functions available in Zetrix smart contracts
Inputs: no named parameters.
zetrix_contract_get_structure_guideB
Get guide on how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance
Inputs: no named parameters.
zetrix_contract_get_testing_guideB
Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY
Inputs: no named parameters.
zetrix_contract_get_token_standardC
Get token standard specification (ZTP20, ZTP721, or ZTP1155)
Inputs: standard (required).
zetrix_contract_get_utils_functionsB
Get documentation for all built-in Utils object functions available in Zetrix smart contracts
Inputs: no named parameters.
zetrix_contract_init_dev_environmentB
Initialize a new Zetrix smart contract development environment using create-zetrix-tool. This creates a complete project structure with testing framework, examples, and utilities.
Inputs: contractName (required), workingDirectory.
zetrix_create_keypairB
Generate a new public-private key pair (for testing only)
Inputs: no named parameters.
zetrix_crypto_decrypt_keyC
Decrypt an encrypted private key with a password
Inputs: encryptedData (required), password (required).
zetrix_crypto_encrypt_keyC
Encrypt a private key with a password for secure storage
Inputs: privateKey (required), password (required).
zetrix_crypto_generate_keypairB
Generate a new Zetrix key pair with private key, public key, and address
Inputs: no named parameters.
zetrix_crypto_get_addressC
Get Zetrix address from public key
Inputs: publicKey (required).
zetrix_crypto_get_public_keyC
Derive public key from private key
Inputs: privateKey (required).
zetrix_crypto_signC
Sign a message with a private key
Inputs: message (required), privateKey (required).
zetrix_crypto_validate_keyC
Validate private key, public key, or address format
Inputs: type (required), value (required).
zetrix_crypto_verifyC
Verify a signature against a message and public key
Inputs: message (required), signature (required), publicKey (required).
zetrix_get_accountC
Get Zetrix account information including balance and metadata
Inputs: address (required).
zetrix_get_account_assetsB
Get asset holdings for an account
Inputs: address (required), code, issuer.
zetrix_get_account_baseB
Get basic account information without assets and metadata
Inputs: address (required).
zetrix_get_account_metadataC
Get metadata associated with an account
Inputs: address (required), key.
zetrix_get_balanceB
Get the ZETRIX balance of an account. Returns balance in both ZETA (micro units) and ZETRIX (main units). Note: 1 ZETRIX = 1,000,000 ZETA
Inputs: address (required).
zetrix_get_blockC
Get information about a specific block by height
Inputs: blockNumber (required).
zetrix_get_latest_blockB
Get the latest block information from Zetrix blockchain
Inputs: no named parameters.
zetrix_get_ledgerC
Get block/ledger information with optional details
Inputs: seq, withValidator, withConsValue, withFee.
zetrix_get_transactionC
Get transaction details by transaction hash
Inputs: hash (required).
zetrix_get_transaction_blobC
Serialize transaction data into hexadecimal format
Inputs: transaction (required).
zetrix_get_transaction_cacheC
Get pending transactions not yet executed
Inputs: hash, limit.
zetrix_get_transaction_historyC
Get completed transaction records
Inputs: hash, ledgerSeq.
zetrix_multi_queryC
Execute multiple API queries simultaneously
Inputs: items (required).
zetrix_sdk_call_contractA
Call a smart contract function (query only, no state change) using SDK
Inputs: contractAddress (required), input, sourceAddress.
zetrix_sdk_create_accountB
Create a new Zetrix account using the official SDK
Inputs: no named parameters.
zetrix_sdk_get_balanceC
Get account balance using the official SDK
Inputs: address (required).
zetrix_sdk_get_nonceC
Get account nonce (transaction sequence number)
Inputs: address (required).
zetrix_sdk_invoke_contractB
Invoke a smart contract function with state change (requires private key)
Inputs: sourceAddress (required), privateKey (required), contractAddress (required), amount (required), +2 more.
zetrix_sdk_is_activatedC
Check if an account is activated on the blockchain
Inputs: address (required).
zetrix_submit_transactionC
Submit signed transaction to blockchain for execution
Inputs: transactionBlob (required), signatures (required).
zetrix_test_transactionB
Evaluate transaction fees without blockchain submission
Inputs: items (required).
zetrix_ws_connectC
Connect and register to Zetrix WebSocket for real-time updates
Inputs: apiList.
zetrix_ws_disconnectB
Disconnect from WebSocket
Inputs: no named parameters.
zetrix_ws_statusB
Check WebSocket connection status
Inputs: no named parameters.
zetrix_ws_submit_transactionB
Submit transaction via WebSocket and get real-time status updates
Inputs: transaction (required), signatures (required), trigger.
zetrix_ws_subscribe_txC
Subscribe to transaction notifications for specific addresses
Inputs: addresses (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 44 tools
The tool set has clear thematic grouping (e.g., crypto, account, contract, SDK, WebSocket), but there is notable overlap within groups. For example, zetrix_get_account, zetrix_get_account_base, and zetrix_get_balance all retrieve account-related data with subtle distinctions that could confuse agents. Similarly, multiple contract call tools (zetrix_call_contract, zetrix_sdk_call_contract) and transaction submission tools (zetrix_submit_transaction, zetrix_ws_submit_transaction) have overlapping purposes, though descriptions provide some guidance.
Tool names follow a highly consistent pattern throughout: all start with 'zetrix_' prefix, use snake_case uniformly, and employ a verb_noun structure (e.g., zetrix_get_balance, zetrix_create_keypair). Minor deviations like 'zetrix_multi_query' (adjective_verb_noun) are rare and do not disrupt readability, maintaining excellent predictability across all 44 tools.
With 44 tools, the server is overly broad and heavy for a single MCP server, likely covering multiple domains (blockchain interaction, smart contract development, cryptography, WebSocket management). This high count increases complexity and cognitive load for agents, making it difficult to navigate efficiently. A more modular approach with separate servers for distinct functionalities would be more appropriate.
The tool surface is extensive and covers core blockchain operations comprehensively, including account management, transaction handling, contract development, and real-time updates. However, there are minor gaps: for instance, tools for updating or deleting accounts are missing, and some advanced contract management features (e.g., contract deployment or upgrade) are not explicitly covered, though the provided guides and generation tools mitigate this.
Maintenance
Related MCP Connectors
One workspace of tools for Claude and ChatGPT: connect 600+ apps, generate media, build tools.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
- platform7nDeprecatedtech.p7n
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
A second brain for Claude: remembers your work, plans your day, encrypted under a key only you hold.
Related MCP Servers
AlicenseAqualityDmaintenanceEnables read and write interactions with 60+ blockchain networks through Claude Desktop, providing a standardized multi-chain API for transaction management, account insights, staking, and token interactions.121MIT- AlicenseBqualityDmaintenanceProvides Claude with access to Ethereum and EVM-compatible blockchain operations, enabling wallet management, transaction handling, contract interactions, and blockchain queries through natural language.3593 npm10MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with the Stacks blockchain through Claude Desktop. Manage wallets, trade tokens on DEXs, stack STX for Bitcoin rewards, and track portfolio—all through natural conversation.6MIT
- AlicenseCqualityDmaintenanceEnables Claude Desktop to interact with the VeChain blockchain through natural language commands for token transfers, DEX trading, cross-chain bridges, NFT management, and VeBetter DAO operations.934MIT