Enables querying blockchain data through the Native Indexer (NIX) system, providing tools for retrieving blocks, transactions, account information, balances, and network status across various blockchain networks including NEAR.
NIX MCP Server - Simplified Version
A simplified MCP (Model Context Protocol) server for querying NIX blockchain data using JSON and ABI, without protobuf dependencies.
Features
Simple JSON-based queries - No protobuf compilation required
Dynamic ABI discovery - Automatically fetches available queries from contracts
Automatic ABI caching - Caches ABIs from cdev environment on startup
Environment switching - Query different environments (dev, uat, prod, etc.)
JSON file support - Pass query parameters via JSON files
Three core tools:
list_queries- List all available queries from contract ABIget_query_abi- Get query structure with JSON examplesquery- Execute queries with JSON parameters
Prerequisites
Python 3.11+
cleoscommand-line tool (for blockchain queries)Access to Rodeos and Nodeos endpoints
Quick Start
1. Clone and Initialize
2. Configure
3. Run the Server
Available Tools
1. List Queries
Lists all available query actions from the contract ABI.
2. Get Query ABI
Returns the structure and JSON template for a specific query.
3. Execute Query
Executes a NIX query with JSON parameters.
Environment Support
The MCP server now supports dynamic environment switching without restarting. You can specify the target environment for each query:
Available Environments
dev - Development environment (default)
uat - User Acceptance Testing
cdev - Custody Development
perf - Performance testing
perf2 - Secondary performance testing
simnext - Simulation/Next environment
prod - Production environment
local - Local development
snapshot - Snapshot environment
Example: Query Different Environments
Usage Examples
Python Client
Discover Available Queries
Testing
Claude Desktop Integration
Add to your Claude Desktop configuration:
Project Structure
Environment Variables
NODEOS_ENV- Default environment to use when not specified (dev, uat, cdev, prod, etc.)RODEOS_API- Override Rodeos endpoint for all environmentsNODEOS_API- Override Nodeos endpoint for all environmentsCLEOS_PATH- Path to cleos binary (optional if in PATH)
You can also set environment-specific overrides:
RODEOS_API_DEV,RODEOS_API_UAT,RODEOS_API_PROD, etc.NODEOS_API_DEV,NODEOS_API_UAT,NODEOS_API_PROD, etc.
Transaction Query Example
Here's a complete example of querying a raw transaction as described in the expected flow:
Step 1: Find the appropriate query
Step 2: Get the query ABI structure
Step 3: Execute the query
Or using a JSON file:
The actual cleos command executed:
Common Query Templates
Example JSON files in examples/ directory:
raw_transaction_query.json- Query raw transaction detailsglobal_config_query.json- Query global configuration for a networknetwork_status_query.json- Query network status
Additional query types:
Global configurations (
globalconfs,globalconfn)Network status (
nwstatus)Account queries (
accounts,balances)Block queries (
blocks)Transaction queries (
transaction,transactions,rawtrxspb)
Troubleshooting
cleos not found
Ensure cleos is installed and in your PATH, or set CLEOS_PATH in .env
Connection errors
Verify your RODEOS_API and NODEOS_API endpoints are accessible
Import errors
Run uv sync to ensure all dependencies are installed
License
[Your License]
This server cannot be installed