Skip to main content
Glama
Zetrix MCP Server

Zetrix MCP Server

Official
by Zetrix-Chain

Zetrix MCP Server

A comprehensive Model Context Protocol (MCP) server for interacting with the Zetrix blockchain. Provides 55 tools across 7 categories — HTTP RPC, WebSocket (protobuf), SDK transactions, cryptography, and smart contract development. Supports both stdio and HTTP transport modes.

Zetrix Currency Information

Native Coin: ZETRIX

  • Main Unit: ZETRIX

  • Base Unit: ZETA

  • Conversion: 1 ZETRIX = 1,000,000 ZETA

  • Gas Price: Evaluated dynamically via testTransaction

Related MCP server: MCP Crypto Wallet EVM

Quick Start

npx zetrix-mcp-server

Or install globally:

npm install -g zetrix-mcp-server

Guides:

Features (56 Tools)

General (1 tool)

Tool

Description

zetrix_version

Get MCP server version and network info

HTTP RPC (16 tools)

Tool

Description

zetrix_check_health

Check node health status

zetrix_get_account

Get account info including balance and metadata

zetrix_get_block

Get block by height

zetrix_get_latest_block

Get latest block

zetrix_get_transaction

Get transaction by hash

zetrix_get_balance

Get balance in ZETA and ZETRIX

zetrix_create_keypair

Generate new keypair (testing only)

zetrix_get_account_base

Get basic account info

zetrix_get_account_assets

Get asset holdings

zetrix_get_account_metadata

Get account metadata

zetrix_get_transaction_history

Get completed transactions

zetrix_get_transaction_cache

Get pending transactions

zetrix_get_ledger

Get ledger/block info

zetrix_multi_query

Execute multiple queries

zetrix_get_transaction_blob

Serialize transaction to hex

zetrix_submit_transaction

Submit signed transaction

Contract Query (2 tools)

Tool

Description

zetrix_call_contract

Call contract in sandbox (read-only)

zetrix_test_transaction

Evaluate fees without submitting

WebSocket — Real-time (5 tools)

Uses protobuf binary encoding for communication with Zetrix nodes.

Tool

Description

zetrix_ws_connect

Connect and register via protobuf CHAIN_HELLO

zetrix_ws_submit_transaction

Submit transaction with real-time status

zetrix_ws_subscribe_tx

Subscribe to transaction notifications

zetrix_ws_disconnect

Disconnect from WebSocket

zetrix_ws_status

Check connection status

SDK Query (5 tools)

Tool

Description

zetrix_sdk_create_account

Create new account

zetrix_sdk_get_balance

Get balance via SDK

zetrix_sdk_is_activated

Check if account is activated

zetrix_sdk_get_nonce

Get account nonce

zetrix_sdk_call_contract

Call contract via SDK (read-only)

SDK Transactions (11 tools)

All transaction tools use evaluateFee (testTransaction) for dynamic gas pricing. Optional gasPrice/feeLimit overrides supported on all operations.

Tool

Description

zetrix_sdk_send_gas

Send native ZETRIX to another address

zetrix_sdk_activate_account

Activate a new account with initial balance

zetrix_sdk_set_metadata

Set key-value metadata on an account

zetrix_sdk_set_privilege

Set account weights, thresholds, and signers

zetrix_sdk_issue_asset

Issue a new custom token

zetrix_sdk_send_asset

Transfer a custom token

zetrix_sdk_create_contract

Deploy a smart contract (with optional owner)

zetrix_sdk_invoke_contract

Invoke contract with gas payment

zetrix_sdk_invoke_contract_by_asset

Invoke contract with asset transfer

zetrix_sdk_upgrade_contract

Upgrade contract code and/or transfer ownership

zetrix_sdk_create_log

Create an on-chain event log

Cryptography (8 tools)

Tool

Description

zetrix_crypto_generate_keypair

Generate new keypair (address, private key, public key)

zetrix_crypto_get_public_key

Derive public key from private key

zetrix_crypto_get_address

Get address from public key

zetrix_crypto_validate_key

Validate private key, public key, or address format

zetrix_crypto_sign

Sign a message (hex) with a private key

zetrix_crypto_verify

Verify a signature

zetrix_crypto_encrypt_key

Encrypt private key with password

zetrix_crypto_decrypt_key

Decrypt encrypted private key

Smart Contract Development (7 tools)

Tool

Description

zetrix_contract_get_chain_functions

Chain object function documentation

zetrix_contract_get_utils_functions

Utils object function documentation

zetrix_contract_get_structure_guide

Contract structure and ES5 patterns guide

zetrix_contract_get_token_standard

Token standard specs (ZTP20, ZTP721, ZTP1155)

zetrix_contract_init_dev_environment

Initialize dev project via create-zetrix-tool

zetrix_contract_generate_advanced

Generate multi-class contract architecture

zetrix_contract_get_testing_guide

Testing guide (TEST_INVOKE, TEST_QUERY)

Supported Networks

Network

HTTP RPC

WebSocket

Mainnet

https://node.zetrix.com

wss://ws-node.zetrix.com

Testnet

https://test-node.zetrix.com

wss://test-ws-node.zetrix.com

Configuration

Environment Variables

Variable

Description

Default

ZETRIX_NETWORK

Network selection (mainnet or testnet)

mainnet

ZETRIX_RPC_URL

Custom HTTP RPC endpoint (overrides network default)

—

ZETRIX_WS_URL

Custom WebSocket endpoint (overrides network default)

—

ZETRIX_TRANSPORT

Transport mode (stdio or http)

stdio

ZETRIX_PORT

HTTP server port (only used when ZETRIX_TRANSPORT=http)

3000

ZETRIX_PRIVATE_KEY

Default private key for signing transactions (optional, keeps key out of conversation)

—

ZETRIX_SOURCE_ADDRESS

Default source address for transactions (optional)

—

By setting ZETRIX_PRIVATE_KEY and ZETRIX_SOURCE_ADDRESS as environment variables, your private key is never exposed in the conversation. The LLM can execute transactions like "send 0.01 ZETRIX to ZTX3..." without ever seeing your key.

{
  "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"
      }
    }
  }
}

Note: These are optional. If not set, the LLM will need to ask for or be given the private key and source address in the conversation. If set, they are used as defaults — you can still override them per-tool call if needed.

Claude Code (CLI)

Add the MCP server directly from the command line:

Mainnet:

claude mcp add zetrix-mainnet -s user -- npx -y zetrix-mcp-server -e ZETRIX_NETWORK=mainnet

Testnet:

claude mcp add zetrix-testnet -s user -- npx -y zetrix-mcp-server -e ZETRIX_NETWORK=testnet

With custom RPC and WebSocket URLs:

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.com

Claude Desktop

Edit your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Windows (Microsoft Store): %LOCALAPPDATA%\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\claude_desktop_config.json

Testnet:

{
  "mcpServers": {
    "zetrix": {
      "command": "npx",
      "args": ["-y", "zetrix-mcp-server"],
      "env": {
        "ZETRIX_NETWORK": "testnet"
      }
    }
  }
}

Mainnet:

{
  "mcpServers": {
    "zetrix": {
      "command": "npx",
      "args": ["-y", "zetrix-mcp-server"],
      "env": {
        "ZETRIX_NETWORK": "mainnet"
      }
    }
  }
}

Both networks (mainnet + testnet):

{
  "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"
      }
    }
  }
}

With custom RPC and WebSocket URLs:

{
  "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"
      }
    }
  }
}

After saving the config file, restart Claude Desktop for changes to take effect.

Note: ZETRIX_RPC_URL and ZETRIX_WS_URL override the default endpoints for the selected network. You can override just one or both. If not set, the defaults from the table above are used.

HTTP Transport (API Server)

Run the MCP server as an HTTP API server using the Streamable HTTP transport. This allows remote MCP clients to connect over the network.

Start the server (defaults to mainnet):

ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 npx zetrix-mcp-server

With testnet:

ZETRIX_TRANSPORT=http ZETRIX_PORT=3000 ZETRIX_NETWORK=testnet npx zetrix-mcp-server

Endpoints:

Endpoint

Method

Description

/mcp

POST

MCP protocol endpoint (Streamable HTTP)

/health

GET

Health check — returns { status, version, network }

Connect from an MCP client:

{
  "mcpServers": {
    "zetrix": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    }
  }
}

Both networks (mainnet + testnet):

Run two servers on different ports:

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 &

Then configure your MCP client:

{
  "mcpServers": {
    "zetrix-mainnet": {
      "type": "http",
      "url": "http://localhost:3000/mcp"
    },
    "zetrix-testnet": {
      "type": "http",
      "url": "http://localhost:3001/mcp"
    }
  }
}

Note: The HTTP transport uses the MCP Streamable HTTP specification. Any MCP client that supports StreamableHTTP transport can connect to it.

Server logs:

The server logs to stderr. To view logs, run in the foreground or redirect to a file:

# 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

Development

Project Structure

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

Build

npm install
npm run build

Test

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

License

MIT

Available Tools

44 tools
zetrix_call_contractB

Call smart contract in sandbox environment for debugging

NameRequiredDescriptionDefault
contractAddressNoDeployed contract address (optional)
codeNoContract source code (optional)
inputNoFunction parameters (optional)
contractBalanceNoContract balance (optional)
feeLimitNoFee limit (optional)
gasPriceNoGas price (optional)
optTypeNoOperation type (optional)
sourceAddressNoSource address (optional)
zetrix_check_healthB

Check the health status of the Zetrix node

NameRequiredDescriptionDefault

No 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.

NameRequiredDescriptionDefault
contractNameYesName of the main contract (e.g., 'StableCoin', 'NFTMarketplace')
contractTypeYesType of contract to generate
featuresNoAdvanced features to include
tokenStandardNoToken standard (required if contractType is 'token' or 'nft')
includeTestsNoGenerate comprehensive test specifications (default: true)
outputDirectoryNoDirectory to output the contract files (defaults to current directory)
zetrix_contract_get_chain_functionsA

Get documentation for all built-in Chain object functions available in Zetrix smart contracts

NameRequiredDescriptionDefault

No parameters

zetrix_contract_get_structure_guideB

Get guide on how to structure Zetrix smart contracts with ES5 patterns, classes, and inheritance

NameRequiredDescriptionDefault

No parameters

zetrix_contract_get_testing_guideB

Get guide on testing Zetrix smart contracts with TEST_INVOKE and TEST_QUERY

NameRequiredDescriptionDefault

No parameters

zetrix_contract_get_token_standardC

Get token standard specification (ZTP20, ZTP721, or ZTP1155)

NameRequiredDescriptionDefault
standardYesToken standard to get documentation for
zetrix_contract_get_utils_functionsB

Get documentation for all built-in Utils object functions available in Zetrix smart contracts

NameRequiredDescriptionDefault

No 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.

NameRequiredDescriptionDefault
contractNameYesName of the contract project to create (alphanumeric and hyphens only)
workingDirectoryNoDirectory where to create the project (defaults to current directory)
zetrix_create_keypairB

Generate a new public-private key pair (for testing only)

NameRequiredDescriptionDefault

No parameters

zetrix_crypto_decrypt_keyC

Decrypt an encrypted private key with a password

NameRequiredDescriptionDefault
encryptedDataYesThe encrypted keystore data
passwordYesThe password used for encryption
zetrix_crypto_encrypt_keyC

Encrypt a private key with a password for secure storage

NameRequiredDescriptionDefault
privateKeyYesThe private key to encrypt
passwordYesThe password to use for encryption
zetrix_crypto_generate_keypairB

Generate a new Zetrix key pair with private key, public key, and address

NameRequiredDescriptionDefault

No parameters

zetrix_crypto_get_addressC

Get Zetrix address from public key

NameRequiredDescriptionDefault
publicKeyYesThe public key
zetrix_crypto_get_public_keyC

Derive public key from private key

NameRequiredDescriptionDefault
privateKeyYesThe encrypted private key
zetrix_crypto_signC

Sign a message with a private key

NameRequiredDescriptionDefault
messageYesThe message to sign (hex string)
privateKeyYesThe private key to sign with
zetrix_crypto_validate_keyC

Validate private key, public key, or address format

NameRequiredDescriptionDefault
typeYesType of key to validate
valueYesThe key or address to validate
zetrix_crypto_verifyC

Verify a signature against a message and public key

NameRequiredDescriptionDefault
messageYesThe original message (hex string)
signatureYesThe signature to verify
publicKeyYesThe public key to verify against
zetrix_get_accountC

Get Zetrix account information including balance and metadata

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_get_account_assetsB

Get asset holdings for an account

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
codeNoAsset code (optional, must be used with issuer)
issuerNoAsset issuer address (optional, must be used with code)
zetrix_get_account_baseB

Get basic account information without assets and metadata

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_get_account_metadataC

Get metadata associated with an account

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
keyNoSpecific metadata key (optional)
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

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_get_blockC

Get information about a specific block by height

NameRequiredDescriptionDefault
blockNumberYesThe block height/number to query
zetrix_get_latest_blockB

Get the latest block information from Zetrix blockchain

NameRequiredDescriptionDefault

No parameters

zetrix_get_ledgerC

Get block/ledger information with optional details

NameRequiredDescriptionDefault
seqNoBlock sequence number (optional)
withValidatorNoInclude validator list (optional)
withConsValueNoInclude consensus value (optional)
withFeeNoInclude fee configuration (optional)
zetrix_get_transactionC

Get transaction details by transaction hash

NameRequiredDescriptionDefault
hashYesThe transaction hash
zetrix_get_transaction_blobC

Serialize transaction data into hexadecimal format

NameRequiredDescriptionDefault
transactionYesTransaction object with source_address, nonce, fee_limit, gas_price, operations
zetrix_get_transaction_cacheC

Get pending transactions not yet executed

NameRequiredDescriptionDefault
hashNoTransaction hash (optional)
limitNoNumber of pending transactions to return (optional)
zetrix_get_transaction_historyC

Get completed transaction records

NameRequiredDescriptionDefault
hashNoTransaction hash (optional)
ledgerSeqNoBlock sequence number (optional)
zetrix_multi_queryC

Execute multiple API queries simultaneously

NameRequiredDescriptionDefault
itemsYesArray of query objects
zetrix_sdk_call_contractA

Call a smart contract function (query only, no state change) using SDK

NameRequiredDescriptionDefault
contractAddressYesThe deployed smart contract address
inputNoJSON string with method and params
sourceAddressNoOptional source address for the call
zetrix_sdk_create_accountB

Create a new Zetrix account using the official SDK

NameRequiredDescriptionDefault

No parameters

zetrix_sdk_get_balanceC

Get account balance using the official SDK

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_sdk_get_nonceC

Get account nonce (transaction sequence number)

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_sdk_invoke_contractB

Invoke a smart contract function with state change (requires private key)

NameRequiredDescriptionDefault
sourceAddressYesThe account address initiating the transaction
privateKeyYesPrivate key for signing the transaction
contractAddressYesThe smart contract address to invoke
amountYesAmount of ZTX to send with invocation (in micro-ZTX)
inputYesJSON string with method and params
metadataNoOptional transaction description
zetrix_sdk_is_activatedC

Check if an account is activated on the blockchain

NameRequiredDescriptionDefault
addressYesThe Zetrix account address
zetrix_submit_transactionC

Submit signed transaction to blockchain for execution

NameRequiredDescriptionDefault
transactionBlobYesSerialized transaction blob
signaturesYesArray of signature objects with sign_data and public_key
zetrix_test_transactionB

Evaluate transaction fees without blockchain submission

NameRequiredDescriptionDefault
itemsYesArray of test transaction items
zetrix_ws_connectC

Connect and register to Zetrix WebSocket for real-time updates

NameRequiredDescriptionDefault
apiListNoOptional list of API message types to register (numbers)
zetrix_ws_disconnectB

Disconnect from WebSocket

NameRequiredDescriptionDefault

No parameters

zetrix_ws_statusB

Check WebSocket connection status

NameRequiredDescriptionDefault

No parameters

zetrix_ws_submit_transactionB

Submit transaction via WebSocket and get real-time status updates

NameRequiredDescriptionDefault
transactionYesTransaction object
signaturesYesArray of signature objects with public_key and sign_data
triggerNoOptional trigger object
zetrix_ws_subscribe_txC

Subscribe to transaction notifications for specific addresses

NameRequiredDescriptionDefault
addressesYesArray of account addresses to subscribe to

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 44 tool updates
    • First observedzetrix_call_contract
    • First observedzetrix_check_health
    • First observedzetrix_contract_generate_advanced
    • First observedzetrix_contract_get_chain_functions
    • First observedzetrix_contract_get_structure_guide
    • First observedzetrix_contract_get_testing_guide
    • First observedzetrix_contract_get_token_standard
    • First observedzetrix_contract_get_utils_functions
    • First observedzetrix_contract_init_dev_environment
    • First observedzetrix_create_keypair
    • First observedzetrix_crypto_decrypt_key
    • First observedzetrix_crypto_encrypt_key
    • First observedzetrix_crypto_generate_keypair
    • First observedzetrix_crypto_get_address
    • First observedzetrix_crypto_get_public_key
    • First observedzetrix_crypto_sign
    • First observedzetrix_crypto_validate_key
    • First observedzetrix_crypto_verify
    • First observedzetrix_get_account
    • First observedzetrix_get_account_assets
    • First observedzetrix_get_account_base
    • First observedzetrix_get_account_metadata
    • First observedzetrix_get_balance
    • First observedzetrix_get_block
    • First observedzetrix_get_latest_block
    • First observedzetrix_get_ledger
    • First observedzetrix_get_transaction
    • First observedzetrix_get_transaction_blob
    • First observedzetrix_get_transaction_cache
    • First observedzetrix_get_transaction_history
    • First observedzetrix_multi_query
    • First observedzetrix_sdk_call_contract
    • First observedzetrix_sdk_create_account
    • First observedzetrix_sdk_get_balance
    • First observedzetrix_sdk_get_nonce
    • First observedzetrix_sdk_invoke_contract
    • First observedzetrix_sdk_is_activated
    • First observedzetrix_submit_transaction
    • First observedzetrix_test_transaction
    • First observedzetrix_ws_connect
    • First observedzetrix_ws_disconnect
    • First observedzetrix_ws_status
    • First observedzetrix_ws_submit_transaction
    • First observedzetrix_ws_subscribe_tx

TDQS

B3.1/5.0

Scored across 44 tools

Disambiguation3/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness4/5

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.

Related MCP Connectors

Related MCP Servers