npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chainreactionom/nano-mcp-server

v1.0.10

Published

Model Context Protocol (MCP) server for NANO cryptocurrency interactions

Downloads

42

Readme

NANO MCP (Model Context Protocol) Server

A high-performance NANO cryptocurrency utility library optimized for AI agent interactions, providing instant finality and fee-less transactions.

Features

  • ✨ Instant finality for quick agent decision making
  • 💸 Fee-less transactions for efficient resource allocation
  • 📈 Scalable architecture for large agent networks
  • ✅ Deterministic confirmation for reliable agent operations
  • 🔒 Secure key management and validation
  • 🚀 High-performance RPC operations
  • 🔄 Automated work generation
  • 📡 Real-time transaction monitoring

Installation

npm install @chainreactionom/nano-mcp-server

Configuration

Environment Variables

Create a .env file in your project root:

# Required Parameters
NANO_RPC_URL=https://rpc.nano.to/     # Required: URL of the NANO RPC server
NANO_RPC_KEY=your-rpc-key-here        # Required: Get from https://rpc.nano.to/
NANO_GPU_KEY=your-gpu-key-here        # Required: For work generation

# Optional Parameters
# Choose your representative from https://nanexplorer.com/nano/representatives
NANO_DEFAULT_REPRESENTATIVE=nano_3arg3asgtigae3xckabaaewkx3bzsh7nwz7jkmjos79ihyaxwphhm6qgjps4

Programmatic Configuration

import { NanoMCP } from '@chainreactionom/nano-mcp-server';

// Initialize with custom configuration
const mcp = await NanoMCP.initialize({
    rpcUrl: 'https://rpc.nano.to/',
    rpcKey: 'your-rpc-key',
    gpuKey: 'your-gpu-key',
    defaultRepresentative: 'your-representative-address' // Optional
});

Usage

Basic Operations

// Create a new instance
const nano = new NanoTransactions();

// Get account information
const accountInfo = await nano.getAccountInfo('nano_address');

// Get pending blocks
const pending = await nano.getPendingBlocks('nano_address');

// Generate work for a block
const work = await nano.generateWork('block_hash');

Send Transaction

// First get account info
const accountInfo = await nano.getAccountInfo(fromAddress);

// Create and process send block
const result = await nano.createSendBlock(
    fromAddress,
    privateKey,
    toAddress,
    '0.001', // Amount in NANO
    accountInfo
);

console.log('Send transaction result:', result);
// Result includes:
// - hash: Block hash
// - block: Block details
// - confirmationTime: "< 1 second"
// - fee: "0"

Receive Transactions

// Receive all pending blocks
const result = await nano.receiveAllPending(address, privateKey);

// For new accounts, create open block
const openResult = await nano.createOpenBlock(
    address,
    privateKey,
    sourceBlock,
    sourceAmount
);

Error Handling

The library provides detailed error messages and validation:

try {
    const result = await nano.createSendBlock(/* ... */);
} catch (error) {
    console.error('Transaction failed:', error.message);
    // Detailed error information:
    // - Invalid addresses
    // - Insufficient balance
    // - RPC errors
    // - Work generation failures
}

Advanced Features

Balance Validation

const accountInfo = await nano.getAccountInfo(address);
const balance = convert(accountInfo.balance, { from: Unit.raw, to: Unit.NANO });
console.log('Current balance:', balance, 'NANO');

Representative Management

// Get current representative
const info = await nano.getAccountInfo(address);
console.log('Current representative:', info.representative);

// Change representative (requires private key)
const result = await nano.changeRepresentative(address, privateKey, newRepresentative);

Testing

The library includes comprehensive test suites:

# Run all tests
npm test

# Run specific test suites
npm test -- --testPathPattern=rpc.test.ts
npm test -- --testPathPattern=mcp.test.ts

Test coverage includes:

  • RPC operations
  • Transaction creation and processing
  • Error handling
  • Configuration validation
  • Work generation
  • Account management
  • Balance operations
  • Representative management

Security Best Practices

  1. Never expose private keys in code or version control
  2. Use environment variables for sensitive configuration
  3. Validate all input addresses and amounts
  4. Monitor transaction confirmations
  5. Implement proper error handling
  6. Regular security audits
  7. Keep dependencies updated

Performance Optimization

The library is optimized for:

  • Minimal latency in transaction processing
  • Efficient work generation
  • Optimized RPC calls
  • Reduced network overhead
  • Memory-efficient operations

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - see LICENSE file for details

Support

  • Documentation: [Link to docs]
  • Issues: GitHub Issues
  • Community: Discord/Telegram

Version History

  • 1.0.9: Added comprehensive testing and enhanced error handling
  • 1.0.8: Improved representative management
  • 1.0.7: Enhanced transaction validation
  • 1.0.6: Added work generation optimization
  • 1.0.5: Initial release