Handshake58 for Agents

Pay for any AI service with USDC micropayments. No API keys. No subscriptions. One MCP server — two protocols: DRAIN and MPP.

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

Generate a private key locally — nothing sent over the network:

node -e "const w=require('ethers').Wallet.createRandom();console.log('Address:', w.address, '\nKey:', w.privateKey)"

Or: MetaMask → Account → Export Private Key

3

Configure

Add drain-mcp to the MCP client config:

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

Works for both DRAIN and MPP. Compatible with Cursor, Claude Desktop, Cline, Windsurf, or any MCP-compatible client.

Requires Human

4

Fund the Wallet

Send $5+ USDC on Polygon. Free gas:

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

After funding, the agent operates fully autonomously — provider discovery, payment, and AI requests.

Choose Your Protocol

Both protocols use the same MCP server and wallet. Pick the one that fits your use case — or use both.

MPP — Simple Path

  • · Per-request payment
  • · No channel or deposit needed
  • · 1 tool: mpp_chat
  • · No gas fees
  • · Best for: quick tasks, low volume

DRAIN — Power Path

  • · Payment channels (deposit once)
  • · Many off-chain requests per channel
  • · 11 tools for full control
  • · ~$0.02 gas per channel open/close
  • · Best for: high volume, cost efficiency

MPP Protocol — Simple Path

Fastest way to get started. HTTP 402-based per-request payments — no channel setup, no deposit, no gas fees. Each request is paid individually.

1.drain_providers(category: "llm", protocol: "mpp") — find MPP providers
2.mpp_chat(provider, messages) — send request, payment automatic

No channel or deposit required. Some Skills use both protocols simultaneously (mixed mode).

DRAIN Protocol — Power Path

Lower cost at volume. Payment channels on Polygon (USDC) — deposit once, make many off-chain requests. Close to reclaim unspent funds. ~$0.02 gas per channel.

1.drain_providers(category: "llm") — find providers
2.drain_open_channel(provider, amount, duration) — deposit USDC
3.drain_chat(channelId, messages) — send paid requests
4.drain_cooperative_close(channelId) — close, instant refund
5.drain_feedback(channelId, rating) — rate the session (optional)

AI Skills

Skills are pre-defined multi-provider workflows — sequences of AI steps across multiple providers, with execution instructions for agents.

Browse Skills

GET https://handshake58.com/api/skills?status=published

Get Skill Definition + Execution Instructions

GET https://handshake58.com/api/skills/<slug>

Returns: skill definition, step flow, provider roles, and a full step-by-step execution guide for your agent.

Protocol Filter

GET /api/skills/<slug>?protocol=drain
GET /api/skills/<slug>?protocol=mpp

Overrides the skill's default protocol. Use this if your agent only supports one payment method.

Important: The HTML page at /skills/<slug> is client-rendered and not readable by agents without JavaScript. Always use the API endpoint /api/skills/<slug> to fetch skill data programmatically.

MCP Tools (12 Total)

MPP Tool

mpp_chatSend request via MPP (no channel needed, per-request payment)

Shared Tools (work with both protocols)

drain_providersList providers (filter by model, category, protocol)
drain_provider_infoProvider details + usage docs
drain_balanceCheck wallet USDC balance
drain_feedbackRate a session (works / broken)

DRAIN-Only Tools

drain_approveApprove USDC for the contract
drain_open_channelOpen a payment channel
drain_chatSend paid request via DRAIN channel
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 https://handshake58.com/api/mcp/providers

Filters

?protocol=drainDRAIN-only providers?protocol=mppMPP-only providers?category=llmFilter by category?model=gpt-4oFilter by model?minScore=0.8Min Oracle quality score?limit=5Limit results?format=compactCompact response

Quality Oracle

All providers are monitored by the Bittensor Subnet 58 decentralized oracle. Miners score providers on latency, reliability, and response quality. Scores feed into provider rankings.

Use ?minScore=0.7 on the providers API to filter by oracle quality score. Verified skills on /skills/browse are tested by the HS58 team.

Protocol Fee

Session fee: none
Protocol fee: 2% (on-chain, deducted when provider claims)
Gas (DRAIN only): ~$0.02 per channel open/close
Gas (MPP): none — payment included in request

Contract Addresses

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

Links