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

@bithaven/mcp-sdk

v2.1.0

Published

Open-source SDK for Bithaven agent finance — check balances, send USDC payments, query history, and request approvals via MCP.

Readme

@bithaven/mcp-sdk

Open-source TypeScript SDK for Bithaven agent finance. Give your AI agents a USDC wallet with policy guardrails.

Quick Start (< 5 minutes)

1. Install

npm install @bithaven/mcp-sdk

2. Get an API Key

  1. Sign up at bithaven.io
  2. Create an agent wallet in the dashboard
  3. Generate an API key for that wallet
  4. Copy the bh_live_... key (shown once)

3. Use It

import { BithavenClient } from '@bithaven/mcp-sdk';

const client = new BithavenClient({
  apiKey: 'bh_live_your_key_here',
});

// Check balance
const balance = await client.checkBalance();
console.log(`Balance: ${balance.balance} ${balance.currency}`);

// Send payment
const tx = await client.sendPayment({
  toAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68',
  amount: '10.00',
  memo: 'API credits',
});
console.log(`Sent! TX: ${tx.txHash}`);

Claude Integration

Pass the pre-built tool definitions directly to Claude's tools parameter:

import { bithavenTools } from '@bithaven/mcp-sdk';

const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-5-20250929',
  tools: bithavenTools,
  messages: [{ role: 'user', content: 'Send 5 USDC to 0x...' }],
});

See examples/claude-agent.ts for the full agent loop.

API Reference

BithavenClient

const client = new BithavenClient({
  apiKey: 'bh_live_...',       // Required
  baseUrl: 'https://...',      // Optional (defaults to production)
});

Methods

| Method | Description | Returns | |--------|-------------|---------| | checkBalance() | Get wallet balance and remaining spend caps | BalanceResult | | sendPayment(input) | Send USDC (policy-evaluated, on-chain) | SendPaymentResult | | getTxHistory(input?) | Paginated transaction history | TxHistoryResult | | requestApproval(input) | Escalate to human for approval | RequestApprovalResult | | listTools() | Discover available MCP tools | Tool definitions |

Error Handling

import { PolicyDeniedError, InsufficientBalanceError, RateLimitError } from '@bithaven/mcp-sdk';

try {
  await client.sendPayment({ toAddress: '0x...', amount: '100' });
} catch (err) {
  if (err instanceof PolicyDeniedError) {
    console.log('Denied:', err.violations);
    // Fallback: request human approval
    await client.requestApproval({ toAddress: '0x...', amount: '100', reason: 'Large purchase' });
  }
  if (err instanceof InsufficientBalanceError) {
    console.log('Need more funds');
  }
  if (err instanceof RateLimitError) {
    console.log(`Wait ${err.retryAfter}s`);
  }
}

Tools

The SDK exports Claude-compatible tool definitions:

| Tool Name | Scope | Description | |-----------|-------|-------------| | bithaven_check_balance | read | Check balance and spend caps | | bithaven_send_payment | write | Send USDC with policy evaluation | | bithaven_get_tx_history | read | Transaction history | | bithaven_request_approval | write | Request human sign-off |

Rate Limits

| Tool | Limit | |------|-------| | check_balance | 60/min | | send_payment | 10/min | | get_tx_history | 30/min | | request_approval | 5/min |

License

MIT