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 🙏

© 2026 – Pkg Stats / Ryan Hefner

tchcash

v0.1.2

Published

ThaiChain wallet + MPP payment proxy for AI agents

Readme

tchcash

ThaiChain wallet + MPP payment proxy for AI agents

tchcash is an MCP server that runs locally on your machine, acting as a wallet client for AI agents. It enables agents to automatically pay for MPP/x402 APIs on ThaiChain without manual intervention.

Features

  • ✅ Automatic wallet creation - Creates a new wallet and saves to .tchcash/wallet.json
  • ✅ Balance checking - Verify TCH balance before using paid APIs
  • ✅ Automatic payment handling - Uses mppx SDK to handle 402 Payment Required flow
  • ✅ MCP stdio transport - Compatible with Claude, Cursor, and other MCP clients
  • ✅ ThaiChain native - Supports TCH (TIP-20 token) on ThaiChain (chainId: 7)

Installation

Option 1: Install from npm (Recommended)

# Using npm
npm install -g tchcash

# Using pnpm
pnpm add -g tchcash

# Or run directly with npx
npx tchcash

Option 2: Local Development

# Clone repository
git clone https://github.com/thaichain/tchcash.git
cd tchcash

# Install dependencies
pnpm install

# Build
pnpm build

# Link locally (for testing)
pnpm link --global

Then use in MCP config:

{
  "mcpServers": {
    "tchcash": {
      "command": "tchcash"
    }
  }
}

Usage

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "tchcash": {
      "command": "tchcash"
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "tchcash": {
      "command": "tchcash"
    }
  }
}

ZCode

Create .mcp.json in project:

{
  "tchcash": {
    "command": "tchcash"
  }
}

MCP Tools

setup_wallet

Creates a new ThaiChain wallet or loads an existing one. The wallet is automatically saved to .tchcash/wallet.json on your local machine.

Parameters:

  • force_new (optional, boolean) - If true, creates a new wallet even if one exists

Example:

{
  "name": "setup_wallet",
  "arguments": {}
}

check_balance

Checks the TCH balance of the wallet saved in .tchcash/wallet.json.

Parameters: None

Example:

{
  "name": "check_balance",
  "arguments": {}
}

fetch_market_data

Fetches crypto market data (BTC, ETH, TCH prices) from tchmpp server. tchcash automatically pays $0.01 from the wallet.

Parameters: None

Example:

{
  "name": "fetch_market_data",
  "arguments": {}
}

fetch_weather

Fetches weather data for Bangkok, Thailand. tchcash automatically pays $0.005 from the wallet.

Parameters: None

Example:

{
  "name": "fetch_weather",
  "arguments": {}
}

fetch_data

Fetches sample data. tchcash automatically pays $0.01 from the wallet.

Parameters: None

Example:

{
  "name": "fetch_data",
  "arguments": {}
}

fetch_url

Calls any paid API on tchmpp server. tchcash automatically pays from the wallet.

Parameters:

  • path (string, required) - URL path (e.g., /api/v1/market or /api/v1/generate)
  • method (optional, string) - HTTP method (GET, POST), default: GET
  • body (optional, string) - Request body (JSON string) for POST requests

Example:

{
  "name": "fetch_url",
  "arguments": {
    "path": "/api/v1/generate",
    "method": "POST",
    "body": "{\"prompt\":\"Hello\"}"
  }
}

Workflow

  1. Setup wallet - Call setup_wallet to create a wallet
  2. Fund wallet - Tell user to transfer TCH to the address (recommended 10 TCH)
  3. Check balance - Call check_balance to verify funds
  4. Call APIs - Call fetch_market_data, fetch_weather, etc.

Architecture

┌─────────┐      ┌──────────────────┐      ┌──────────────┐
│  Agent  │ ───► │ tchcash MCP      │ ───► │ tchmpp       │
│ (Claude)│ stdio│ - wallet store   │ HTTP │ (Cloudflare) │
│         │ ◄─── │ - mppx SDK       │ ◄─── │              │
└─────────┘      └──────────────────┘      └──────────────┘
                 Handles 402 challenge
                 Signs + broadcasts TX
                 Sends proof back

Security

  • Private key is saved to .tchcash/wallet.json on your local machine
  • NEVER commit this file to Git (it's in .gitignore)
  • tchcash does NOT send private keys to external servers
  • mppx SDK handles payment locally on your machine only

Chain Information

  • Name: ThaiChain
  • Chain ID: 7
  • CAIP-2: eip155:7
  • RPC: https://rpc.thaichain.org
  • Explorer: https://exp.thaichain.org
  • Token: TCH (TIP-20, 6 decimals)

Development

# Install dependencies
pnpm install

# Build
pnpm build

# Run dev
pnpm dev

# Type check
pnpm typecheck

License

MIT