Labsco
r3e-network logo

Neo N3 MCP Server

โ˜… 4

from r3e-network

Integrates with the Neo N3 blockchain for wallet management, asset transfers, contract interactions, and blockchain queries.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

MseeP.ai Security Assessment Badge

Neo N3 MCP Server

MCP Server for Neo N3 Blockchain Integration | Version 2.0.0

A production-ready MCP server providing Neo N3 blockchain integration with 27 tools, 3 fixed resources, and a parameterized block resource for wallet management, transaction lifecycle tracking, asset transfers, contract deployment, contract interactions, and blockchain queries.

๐Ÿ› ๏ธ MCP Client Integration

Claude Desktop / Cursor

{
  "mcpServers": {
    "neo-n3": {
      "command": "npx",
      "args": ["-y", "@r3e/neo-n3-mcp"],
      "disabled": false,
      "env": {
        "NEO_NETWORK": "mainnet",
        "NEO_MAINNET_RPC": "https://mainnet1.neo.coz.io:443",
        "NEO_TESTNET_RPC": "http://seed1t5.neo.org:20332",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Custom MCP Client

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';

const transport = new StdioClientTransport({
  command: 'npx',
  args: ['-y', '@r3e/neo-n3-mcp'],
  env: {
    NEO_NETWORK: 'mainnet',
    NEO_MAINNET_RPC: 'https://mainnet1.neo.coz.io:443',
    NEO_TESTNET_RPC: 'http://seed1t5.neo.org:20332',
  },
});

const client = new Client(
  { name: 'my-neo-client', version: '1.0.0' },
  { capabilities: {} }
);

await client.connect(transport);

๐Ÿ“Š Available Tools & Resources

๐Ÿ› ๏ธ Tools (27 available)

  • Network: get_network_mode, set_network_mode
  • Blockchain: get_blockchain_info, get_block_count, get_block, get_transaction, get_application_log, wait_for_transaction
  • Wallets: create_wallet, import_wallet, get_wallet
  • Assets: get_balance, get_unclaimed_gas, get_nep17_transfers, get_nep11_balances, get_nep11_transfers, transfer_assets, estimate_transfer_fees
  • Contracts: invoke_contract, deploy_contract, list_famous_contracts, get_contract_info, get_contract_status
  • NeoFS: neofs_create_container, neofs_get_containers
  • Advanced: claim_gas, estimate_invoke_fees

๐ŸŒ HTTP Endpoints

  • Health & metrics: /health, /metrics
  • Transactions: /api/transactions/:txid, /api/transactions/:txid/application-log, /api/transactions/:txid/wait
  • Accounts: /api/accounts/:address/balance, /api/accounts/:address/unclaimed-gas, /api/accounts/:address/nep17-transfers, /api/accounts/:address/nep11-balances, /api/accounts/:address/nep11-transfers, POST /api/accounts/claim-gas
  • Blocks: GET /api/blocks/:hashOrHeight
  • Transfers: POST /api/transfers, POST /api/transfers/estimate-fees
  • Contracts: GET /api/contracts/:reference, GET /api/contracts/:reference/status, POST /api/contracts/invoke, POST /api/contracts/invoke/estimate-fees, POST /api/contracts/:name/invoke, POST /api/contracts/deploy (requires confirm=true)
  • Wallets: POST /api/wallets, POST /api/wallets/import, GET /api/wallets/:address

๐Ÿ“ Resources (3 fixed + 1 template)

  • Status: neo://network/status, neo://mainnet/status, neo://testnet/status
  • Parameterized Block: neo://block/{height}

๐Ÿ” Security

  • Input Validation: All inputs validated and sanitized
  • Confirmation Required: Sensitive operations require explicit confirmation
  • Private Key Security: Keys encrypted and stored securely
  • Network Isolation: Separate configurations for mainnet/testnet
  • Rate Limiting: Configurable rate limiting for production deployments
  • Secure Logging: No sensitive data exposed in logs

โšก Performance & Reliability

  • Rate Limiting: Built-in rate limiting with configurable thresholds
  • Error Handling: Comprehensive error handling with proper MCP error codes
  • Network Resilience: Automatic fallback mechanisms for RPC calls
  • Production Ready: Systemd service configuration and monitoring support

๐Ÿ”„ Version Management & Release Process

Current Version: 2.0.0

This project follows Semantic Versioning with automated CI/CD pipeline for releases. See our Version Management Guide for detailed information.

๐Ÿš€ How to Trigger Next Version Release

# 1. First, do a dry run to see what will happen
./scripts/prepare-release.sh --type minor --dry-run

# 2. If everything looks good, run the actual release preparation
./scripts/prepare-release.sh --type minor

# 3. Push the changes (script will guide you)
git push

# 4. Create GitHub release (triggers full CI/CD pipeline)
gh release create v2.1.0 --generate-notes

Method 2: Manual NPM Version Commands

# Check current version
npm run version:check

# Bump version manually
npm run version:patch   # 2.0.0 โ†’ 2.0.1 (bug fixes)
npm run version:minor   # 2.0.0 โ†’ 2.1.0 (new features)
npm run version:major   # 2.0.0 โ†’ 3.0.0 (breaking changes)

# Then commit and push
git add . && git commit -m "chore: bump version to 2.1.0"
git push

Method 3: GitHub Release (Direct)

# Using GitHub CLI
gh release create v2.1.0 --generate-notes

# Or manually through GitHub web interface:
# 1. Go to https://github.com/r3e-network/neo-n3-mcp/releases
# 2. Click "Create a new release"
# 3. Tag: v2.1.0, Title: "Release v2.1.0"
# 4. Auto-generate release notes
# 5. Publish release

๐Ÿ”„ What Happens When You Create a Release

The automated CI/CD pipeline triggers the following workflow:

Phase 1: Testing & Validation โšก

  • โœ… Multi-version testing: Node.js 18.x, 20.x, 22.x on ubuntu-latest
  • โœ… Code quality: Linting and type checking
  • โœ… Unit tests: Core functionality validation
  • โœ… Coverage reporting: Automatic upload to Codecov

Phase 2: Build & Docker ๐Ÿ”จ

  • โœ… TypeScript compilation: Build validation
  • โœ… Docker builds: Both development and production images
  • โœ… Container testing: Docker functionality validation
  • โœ… Compose validation: Configuration testing

Phase 3: Security & Audit ๐Ÿ”’

  • โœ… Security audit: npm audit for vulnerabilities
  • โœ… Dependency check: audit-ci for security issues
  • โœ… Package updates: Check for outdated dependencies

Phase 4: Publishing ๐Ÿ“ฆ (Only on release)

  • ๐Ÿš€ NPM Publishing: Automatic package publishing to npm registry
  • ๐Ÿณ Docker Publishing: Multi-tag image publishing to Docker Hub
  • ๐Ÿ“‹ Versioned tags: Semantic versioning with proper tagging

Phase 5: Deployment ๐ŸŒ (Only on release)

  • ๐ŸŽฏ Production deployment: Automated deployment notification
  • ๐Ÿ“Š Release tracking: Version monitoring and validation

๐Ÿ“‹ Release Types

TypeVersion ChangeUse CaseExample
patch2.0.0 โ†’ 2.0.1Bug fixes, security patches./scripts/prepare-release.sh --type patch
minor2.0.0 โ†’ 2.1.0New features, enhancements./scripts/prepare-release.sh --type minor
major2.0.0 โ†’ 3.0.0Breaking changes./scripts/prepare-release.sh --type major

๐ŸŽฏ Quick Release Commands

# For next minor release (recommended for new features)
./scripts/prepare-release.sh --type minor

# For patch release (bug fixes)
./scripts/prepare-release.sh --type patch

# For major release (breaking changes)
./scripts/prepare-release.sh --type major

# Test what would happen (dry run)
./scripts/prepare-release.sh --type minor --dry-run

๐Ÿ“Š Latest Changes (v2.0.0)

  • โœ… npm Dependency: Replaced vendored neon-js 3.x with @cityofzion/neon-js@5.x from npm โ€” no more bundled vendor code
  • โœ… Full Type Safety: Zero any types in production code โ€” proper neon-js types flow through the entire codebase
  • โœ… Rate Limiting Enforced: Rate limiting is now integrated into HTTP and MCP request pipelines (was defined but never called)
  • โœ… Config Validation: Server validates environment variables at startup and fails fast with descriptive errors
  • โœ… Log Rotation: Logs rotate at 10MB with up to 3 rotated files retained
  • โœ… Clean Package Surface: Only dist/, README.md, and LICENSE ship in the npm tarball

๐Ÿ“š Release Documentation

๐Ÿ” Required Secrets (Already Configured)

  • โœ… NPM_TOKEN - For NPM registry publishing
  • โœ… DOCKER_USERNAME - Docker Hub username
  • โœ… DOCKER_PASSWORD - Docker Hub access token

๐Ÿ“š Documentation

๐Ÿ“„ License

MIT License - see LICENSE file for details.