Handshake58 for Agents

Pay for any service with USDC micropayments. No API keys.

Setup

Agents can do most of this autonomously. Only funding requires human action.

AGENT CAN DO

1

INSTALL

Install the MCP server (ask user to approve if needed):

npm install -g drain-mcp
2

WALLET

Create a Polygon private key or use an existing one:

Agent creates:require('viem').generatePrivateKey()
User provides:MetaMask → Account → Export Private Key
3

CONFIGURE

Add drain-mcp to the MCP client config with the private key.

REQUIRES HUMAN (or invite code)

4

FUND THE WALLET

Option A: User sends $5+ USDC on Polygon. Gas (POL) is provided free:

POST /api/gas-station {"address": "0x..."}

Option B: Redeem an invite code (no wallet needed — one is generated for you):

POST /api/invite/redeem {"code": "abc123"}

Or with existing wallet: handshake58.com/join/<code>

After funding, the agent operates fully autonomously — provider discovery, channel management, payments, and AI requests.

MCP Config

Add to Cursor, Claude Desktop, Cline, Windsurf, or any MCP-compatible client:

{
  "mcpServers": {
    "drain": {
      "command": "drain-mcp",
      "env": {
        "DRAIN_PRIVATE_KEY": "0x_the_exported_private_key"
      }
    }
  }
}

drain-mcp is an MCP server (not a CLI tool). It runs inside your client and provides 9 tools. Provider categories: llm, image, audio, video, code, multi-modal, scraping, search, data, scheduling, network, forecasting, other.

MCP Tools Available

Once configured, your agent has access to these 9 tools:

drain_providersList providers (filter by model, category)
drain_provider_infoProvider details + usage docs
drain_balanceCheck wallet USDC balance
drain_approveApprove USDC for the contract
drain_open_channelOpen a payment channel
drain_chatSend paid request (any provider type)
drain_channel_statusCheck channel status and balance
drain_channelsList all known channels
drain_cooperative_closeClose channel early (instant refund)
drain_close_channelClose expired channel, reclaim funds

Discover Providers

Get all available service providers with models and pricing:

GET https://handshake58.com/api/mcp/providers

Filters: ?limit=5 ?model=gpt-4o ?format=compact

Wallet Setup

Create a dedicated Polygon wallet:

  • Use MetaMask, Rabby, or any EVM-compatible wallet
  • Agents can also generate a wallet programmatically (ethers.js, viem, web3.py)
  • Export the private key from the wallet settings

Fund your wallet:

  • $5+ USDC on Polygon — gas (POL) provided automatically
  • Or: POST /api/invite/redeem with just the code — wallet generated automatically, no data stored

Protocol Fee

A 2% protocol fee is automatically deducted on-chain when providers claim payments. No separate fee transaction needed.

Just open a payment channel and start using the service.

Session fee: none
Protocol fee: 2% (on-chain)
Gas: ~$0.02

Contract Addresses

Channel: 0x0C2B3aA1e80629D572b1f200e6DF3586B3946A8A
USDC: 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
Chain: Polygon Mainnet (137)

Links